Fix bug where we erroneously answer queries belonging to another shard
This commit is contained in:
parent
025b7077f7
commit
e7f90f0096
@ -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
|
/* If it is not the first key, make sure it is exactly
|
||||||
* the same key as the first we saw. */
|
* the same key as the first we saw. */
|
||||||
if (!equalStringObjects(firstkey,thiskey)) {
|
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)) {
|
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. */
|
/* Error: multiple keys from different slots. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user