mirror of
https://github.com/redis/redis.git
synced 2026-04-21 03:01:35 -04:00
Cluster: update slaves lists in clusterSetMaster().
This commit is contained in:
@@ -2501,8 +2501,12 @@ void clusterSetMaster(clusterNode *n) {
|
||||
if (myself->flags & REDIS_NODE_MASTER) {
|
||||
myself->flags &= ~REDIS_NODE_MASTER;
|
||||
myself->flags |= REDIS_NODE_SLAVE;
|
||||
} else {
|
||||
if (myself->slaveof)
|
||||
clusterNodeRemoveSlave(myself->slaveof,myself);
|
||||
}
|
||||
myself->slaveof = n;
|
||||
clusterNodeAddSlave(n,myself);
|
||||
replicationSetMaster(n->ip, n->port);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user