Cluster: when slave changes master, remove it from the old master.

This commit is contained in:
antirez 2013-03-25 15:01:25 +01:00
parent 70091a2f63
commit c39e34d007

View File

@ -933,6 +933,8 @@ int clusterProcessPacket(clusterLink *link) {
/* Master node changed for this slave? */
if (sender->slaveof != master) {
if (sender->slaveof)
clusterNodeRemoveSlave(sender->slaveof,sender);
clusterNodeAddSlave(master,sender);
sender->slaveof = master;
}