]> git.saurik.com Git - redis.git/blobdiff - src/cluster.c
Clear the importing status from the slot if a CLUSTER SETSLOT command permanently...
[redis.git] / src / cluster.c
index ed07a84fa31241a45d0afeeee4c6e739c9465e58..e876baebef0f627fc5e617dafc499dcbdf0c5713 100644 (file)
@@ -1305,6 +1305,11 @@ void clusterCommand(redisClient *c) {
                 server.cluster.migrating_slots_to[slot])
                 server.cluster.migrating_slots_to[slot] = NULL;
 
                 server.cluster.migrating_slots_to[slot])
                 server.cluster.migrating_slots_to[slot] = NULL;
 
+            /* If this node was importing this slot, assigning the slot to
+             * itself also clears the importing status. */
+            if (n == server.cluster.myself && server.cluster.importing_slots_from[slot])
+                server.cluster.importing_slots_from[slot] = NULL;
+
             clusterDelSlot(slot);
             clusterAddSlot(n,slot);
         } else {
             clusterDelSlot(slot);
             clusterAddSlot(n,slot);
         } else {