MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / abortFailover

Function abortFailover

src/replication.cpp:5084–5097  ·  view source on GitHub ↗

Abort an ongoing failover if one is going on. */

Source from the content-addressed store, hash-verified

5082
5083/* Abort an ongoing failover if one is going on. */
5084void abortFailover(redisMaster *mi, const char *err) {
5085 if (g_pserver->failover_state == NO_FAILOVER) return;
5086
5087 if (g_pserver->target_replica_host) {
5088 serverLog(LL_NOTICE,"FAILOVER to %s:%d aborted: %s",
5089 g_pserver->target_replica_host,g_pserver->target_replica_port,err);
5090 } else {
5091 serverLog(LL_NOTICE,"FAILOVER to any replica aborted: %s",err);
5092 }
5093 if (g_pserver->failover_state == FAILOVER_IN_PROGRESS) {
5094 replicationUnsetMaster(mi);
5095 }
5096 clearFailoverState();
5097}
5098
5099/*
5100 * FAILOVER [TO <HOST> <PORT> [FORCE]] [ABORT] [TIMEOUT <timeout>]

Callers 3

syncWithMasterFunction · 0.85
failoverCommandFunction · 0.85
updateFailoverStatusFunction · 0.85

Calls 3

serverLogFunction · 0.85
replicationUnsetMasterFunction · 0.85
clearFailoverStateFunction · 0.85

Tested by

no test coverage detected