From 0b0a8884fcf14badca86f8416d25c7e8d9d81836 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 21 Feb 2013 11:44:58 +0100 Subject: [PATCH] Cluster: always use cluster(Add|Del)Slot to modify the cluster slots table. --- src/cluster.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cluster.c b/src/cluster.c index 64d773786..a872cc512 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -46,6 +46,7 @@ sds clusterGenNodesDescription(void); clusterNode *clusterLookupNode(char *name); int clusterNodeAddSlave(clusterNode *master, clusterNode *slave); int clusterAddSlot(clusterNode *n, int slot); +int clusterDelSlot(int slot); /* ----------------------------------------------------------------------------- * Initialization @@ -669,7 +670,8 @@ int clusterProcessPacket(clusterLink *link) { if (server.cluster->slots[j] == NULL || server.cluster->slots[j]->flags & REDIS_NODE_FAIL) { - server.cluster->slots[j] = sender; + clusterDelSlot(j); + clusterAddSlot(sender,j); update_state = update_config = 1; } }