mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Cluster: update slaves lists in clusterSetMaster().
This commit is contained in:
parent
5383ab0bc6
commit
0f9422d575
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user