Commit 8c6e8680 authored by antirez's avatar antirez
Browse files

Cluster: use clusterSetNodeAsMaster() during slave failover.

clusterHandleSlaveFailover() was reimplementing what
clusterSetNodeAsMaster() without any good reason.
parent 41a72416
...@@ -2504,10 +2504,7 @@ void clusterHandleSlaveFailover(void) { ...@@ -2504,10 +2504,7 @@ void clusterHandleSlaveFailover(void) {
* this slave to a master. * this slave to a master.
* *
* 1) Turn this node into a master. */ * 1) Turn this node into a master. */
clusterNodeRemoveSlave(myself->slaveof, myself); clusterSetNodeAsMaster(myself);
myself->flags &= ~REDIS_NODE_SLAVE;
myself->flags |= REDIS_NODE_MASTER;
myself->slaveof = NULL;
replicationUnsetMaster(); replicationUnsetMaster();
/* 2) Claim all the slots assigned to our master. */ /* 2) Claim all the slots assigned to our 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