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.
This commit is contained in:
Binbin 2022-02-28 15:46:57 +08:00 committed by GitHub
parent a6fd237537
commit ad7a6275ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -5026,7 +5026,7 @@ void clusterCommand(client *c) {
" Reset current node (default: soft).",
"SET-CONFIG-EPOCH <epoch>",
" Set config epoch of current node.",
"SETSLOT <slot> (IMPORTING|MIGRATING|STABLE|NODE <node-id>)",
"SETSLOT <slot> (IMPORTING <node-id>|MIGRATING <node-id>|STABLE|NODE <node-id>)",
" Set slot state.",
"REPLICAS <node-id>",
" Return <node-id> replicas.",

View File

@ -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}
};

View File

@ -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"
},
{