Check whether to switch to fail when setting the node to pfail in cron (#1061)
This may speed up the transition to the fail state a bit. Previously we would only check when we received a pfail/fail report from others in gossip. If myself is the last vote, we can directly switch to fail in here without waiting for the next gossip packet. Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
parent
33b824137e
commit
c0014ef15e
@ -5217,7 +5217,7 @@ void clusterCron(void) {
|
||||
if (!(node->flags & (CLUSTER_NODE_PFAIL | CLUSTER_NODE_FAIL))) {
|
||||
node->flags |= CLUSTER_NODE_PFAIL;
|
||||
update_state = 1;
|
||||
if (server.cluster->size == 1 && clusterNodeIsVotingPrimary(myself)) {
|
||||
if (clusterNodeIsVotingPrimary(myself)) {
|
||||
markNodeAsFailingIfNeeded(node);
|
||||
} else {
|
||||
serverLog(LL_NOTICE, "NODE %.40s (%s) possibly failing.", node->name, node->human_nodename);
|
||||
|
Loading…
x
Reference in New Issue
Block a user