From d6601de73fa0fa3b48dbef8ee9d1e054c5254ecd Mon Sep 17 00:00:00 2001 From: Binbin Date: Sun, 10 Sep 2023 14:33:00 +0800 Subject: [PATCH] Fix that slot return in CLUSTER SHARDS should be integer (#12561) An unintentional change was introduced in #10536, we used to use addReplyLongLong and now it is addReplyBulkLonglong, revert it back the previous behavior. (cherry picked from commit 4031a187321be26fc96c044fec3ee759841e8379) --- src/cluster.c | 2 +- src/commands/cluster-shards.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index c6d7e484e..27d109914 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -5703,7 +5703,7 @@ void addShardReplyForClusterShards(client *c, list *nodes) { serverAssert((n->slot_info_pairs_count % 2) == 0); addReplyArrayLen(c, n->slot_info_pairs_count); for (int i = 0; i < n->slot_info_pairs_count; i++) - addReplyBulkLongLong(c, (unsigned long)n->slot_info_pairs[i]); + addReplyLongLong(c, (unsigned long)n->slot_info_pairs[i]); } else { /* If no slot info pair is provided, the node owns no slots */ addReplyArrayLen(c, 0); diff --git a/src/commands/cluster-shards.json b/src/commands/cluster-shards.json index dcaad3ea3..e7a082953 100644 --- a/src/commands/cluster-shards.json +++ b/src/commands/cluster-shards.json @@ -26,7 +26,7 @@ "description": "an even number element array specifying the start and end slot numbers for slot ranges owned by this shard", "type": "array", "items": { - "type": "string" + "type": "integer" } }, "nodes": {