Commit e7628be2 authored by antirez's avatar antirez
Browse files

Cluster: set node->slaveof correctly when a node state is updated.

parent d6457577
...@@ -854,7 +854,10 @@ int clusterProcessPacket(clusterLink *link) { ...@@ -854,7 +854,10 @@ int clusterProcessPacket(clusterLink *link) {
sender->flags &= ~REDIS_NODE_MASTER; sender->flags &= ~REDIS_NODE_MASTER;
sender->flags |= REDIS_NODE_SLAVE; sender->flags |= REDIS_NODE_SLAVE;
if (sender->numslaves) clusterNodeResetSlaves(sender); if (sender->numslaves) clusterNodeResetSlaves(sender);
if (master) clusterNodeAddSlave(master,sender); if (master) {
clusterNodeAddSlave(master,sender);
sender->slaveof = master;
}
} }
} }
......
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