From ad7a6275ff9493f0d74a01005b6e19f460b3f8dd Mon Sep 17 00:00:00 2001 From: Binbin Date: Mon, 28 Feb 2022 15:46:57 +0800 Subject: [PATCH] Fix node-id type in cluster-setslot (#10348) * The type of node-id should be string, not integer. * Also improve the CLUSTER SETSLOT help message. --- src/cluster.c | 2 +- src/commands.c | 6 +++--- src/commands/cluster-setslot.json | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index ef381f29a..32335bbf9 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -5026,7 +5026,7 @@ void clusterCommand(client *c) { " Reset current node (default: soft).", "SET-CONFIG-EPOCH ", " Set config epoch of current node.", -"SETSLOT (IMPORTING|MIGRATING|STABLE|NODE )", +"SETSLOT (IMPORTING |MIGRATING |STABLE|NODE )", " Set slot state.", "REPLICAS ", " Return replicas.", diff --git a/src/commands.c b/src/commands.c index 2de24bc2a..d3b2e45b3 100644 --- a/src/commands.c +++ b/src/commands.c @@ -588,9 +588,9 @@ NULL /* CLUSTER SETSLOT subcommand argument table */ struct redisCommandArg CLUSTER_SETSLOT_subcommand_Subargs[] = { -{"node-id",ARG_TYPE_INTEGER,-1,"IMPORTING",NULL,NULL,CMD_ARG_NONE}, -{"node-id",ARG_TYPE_INTEGER,-1,"MIGRATING",NULL,NULL,CMD_ARG_NONE}, -{"node-id",ARG_TYPE_INTEGER,-1,"NODE",NULL,NULL,CMD_ARG_NONE}, +{"node-id",ARG_TYPE_STRING,-1,"IMPORTING",NULL,NULL,CMD_ARG_NONE}, +{"node-id",ARG_TYPE_STRING,-1,"MIGRATING",NULL,NULL,CMD_ARG_NONE}, +{"node-id",ARG_TYPE_STRING,-1,"NODE",NULL,NULL,CMD_ARG_NONE}, {"stable",ARG_TYPE_PURE_TOKEN,-1,"STABLE",NULL,NULL,CMD_ARG_NONE}, {0} }; diff --git a/src/commands/cluster-setslot.json b/src/commands/cluster-setslot.json index dc9af6138..5d1aa45fc 100644 --- a/src/commands/cluster-setslot.json +++ b/src/commands/cluster-setslot.json @@ -26,17 +26,17 @@ "arguments": [ { "name": "node-id", - "type": "integer", + "type": "string", "token": "IMPORTING" }, { "name": "node-id", - "type": "integer", + "type": "string", "token": "MIGRATING" }, { "name": "node-id", - "type": "integer", + "type": "string", "token": "NODE" }, {