Fix bug where we erroneously answer queries belonging to another shard

This commit is contained in:
John Sully 2023-09-27 07:38:09 +00:00
parent 025b7077f7
commit e7f90f0096

View File

@ -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. */