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