From 025b7077f75a51da723b653381ab1433a116a72a Mon Sep 17 00:00:00 2001 From: John Sully Date: Tue, 26 Sep 2023 04:01:51 +0000 Subject: [PATCH] Fix crossslot error migrating batches of keys --- src/cluster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cluster.cpp b/src/cluster.cpp index c054f4cf4..a5e4d0636 100644 --- a/src/cluster.cpp +++ b/src/cluster.cpp @@ -5993,7 +5993,7 @@ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, in if (!equalStringObjects(firstkey,thiskey)) { clusterNode* nThisKey = g_pserver->cluster->slots[slot]; - if (nThisKey != n || migrating_slot || importing_slot || g_pserver->cluster->migrating_slots_to[slot] != nullptr || g_pserver->cluster->importing_slots_from[slot] != nullptr) { + 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. */ getKeysFreeResult(&result); if (error_code)