From e7f90f00963c23afe6397c3b8cee1f2c8ab7a00f Mon Sep 17 00:00:00 2001 From: John Sully Date: Wed, 27 Sep 2023 07:38:09 +0000 Subject: [PATCH] Fix bug where we erroneously answer queries belonging to another shard --- src/cluster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cluster.cpp b/src/cluster.cpp index a5e4d0636..8e830df80 100644 --- a/src/cluster.cpp +++ b/src/cluster.cpp @@ -5991,7 +5991,7 @@ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, in /* If it is not the first key, make sure it is exactly * the same key as the first we saw. */ if (!equalStringObjects(firstkey,thiskey)) { - clusterNode* nThisKey = g_pserver->cluster->slots[slot]; + clusterNode* nThisKey = g_pserver->cluster->slots[thisslot]; if ((slot != thisslot) && (nThisKey != n || migrating_slot || importing_slot || g_pserver->cluster->migrating_slots_to[slot] != nullptr || g_pserver->cluster->importing_slots_from[slot] != nullptr)) { /* Error: multiple keys from different slots. */