Commit 0f9422d5 authored by antirez's avatar antirez
Browse files

Cluster: update slaves lists in clusterSetMaster().

parent 5383ab0b
...@@ -2501,8 +2501,12 @@ void clusterSetMaster(clusterNode *n) { ...@@ -2501,8 +2501,12 @@ void clusterSetMaster(clusterNode *n) {
if (myself->flags & REDIS_NODE_MASTER) { if (myself->flags & REDIS_NODE_MASTER) {
myself->flags &= ~REDIS_NODE_MASTER; myself->flags &= ~REDIS_NODE_MASTER;
myself->flags |= REDIS_NODE_SLAVE; myself->flags |= REDIS_NODE_SLAVE;
} else {
if (myself->slaveof)
clusterNodeRemoveSlave(myself->slaveof,myself);
} }
myself->slaveof = n; myself->slaveof = n;
clusterNodeAddSlave(n,myself);
replicationSetMaster(n->ip, n->port); replicationSetMaster(n->ip, n->port);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment