Skip to content

Commit 025b707

Browse files
JohnSullyJohn Sully
authored andcommitted
Fix crossslot error migrating batches of keys
1 parent 596c513 commit 025b707

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cluster.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5993,7 +5993,7 @@ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, in
59935993
if (!equalStringObjects(firstkey,thiskey)) {
59945994
clusterNode* nThisKey = g_pserver->cluster->slots[slot];
59955995

5996-
if (nThisKey != n || migrating_slot || importing_slot || g_pserver->cluster->migrating_slots_to[slot] != nullptr || g_pserver->cluster->importing_slots_from[slot] != nullptr) {
5996+
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)) {
59975997
/* Error: multiple keys from different slots. */
59985998
getKeysFreeResult(&result);
59995999
if (error_code)

0 commit comments

Comments
 (0)