提交 5130c253 编写于 作者: A antirez

Cluster: set the slaves->slaveof filed to NULL when master is freed.

Related to issue #2289.
上级 98f56f8f
......@@ -821,6 +821,14 @@ int clusterCountNonFailingSlaves(clusterNode *n) {
void freeClusterNode(clusterNode *n) {
sds nodename;
int j;
/* If the node is a master with associated slaves, we have to set
* all the slaves->slaveof fields to NULL (unknown). */
if (nodeIsMaster(n)) {
for (j = 0; j < n->numslaves; j++)
n->slaves[j]->slaveof = NULL;
}
nodename = sdsnewlen(n->name, REDIS_CLUSTER_NAMELEN);
redisAssert(dictDelete(server.cluster->nodes,nodename) == DICT_OK);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册