Cluster: use clusterSetNodeAsMaster() during slave failover.

clusterHandleSlaveFailover() was reimplementing what
clusterSetNodeAsMaster() without any good reason.
This commit is contained in:
antirez 2014-05-15 17:03:28 +02:00
parent 8c6e92c3bc
commit 67133d2f48

View File

@ -2504,10 +2504,7 @@ void clusterHandleSlaveFailover(void) {
* this slave to a master.
*
* 1) Turn this node into a master. */
clusterNodeRemoveSlave(myself->slaveof, myself);
myself->flags &= ~REDIS_NODE_SLAVE;
myself->flags |= REDIS_NODE_MASTER;
myself->slaveof = NULL;
clusterSetNodeAsMaster(myself);
replicationUnsetMaster();
/* 2) Claim all the slots assigned to our master. */