From 8c6e86805c8c0861f0bffb6d9c7c3f7fb2045224 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 15 May 2014 17:03:28 +0200 Subject: [PATCH] Cluster: use clusterSetNodeAsMaster() during slave failover. clusterHandleSlaveFailover() was reimplementing what clusterSetNodeAsMaster() without any good reason. --- src/cluster.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/cluster.c b/src/cluster.c index 3199f0de..59193680 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -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. */ -- GitLab