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

Function clearFailoverState

src/replication.cpp:5073–5081  ·  view source on GitHub ↗

Resets the internal failover configuration, this needs * to be called after a failover either succeeds or fails * as it includes the client unpause. */

Source from the content-addressed store, hash-verified

5071 * to be called after a failover either succeeds or fails
5072 * as it includes the client unpause. */
5073void clearFailoverState() {
5074 g_pserver->failover_end_time = 0;
5075 g_pserver->force_failover = 0;
5076 zfree(g_pserver->target_replica_host);
5077 g_pserver->target_replica_host = NULL;
5078 g_pserver->target_replica_port = 0;
5079 g_pserver->failover_state = NO_FAILOVER;
5080 unpauseClients();
5081}
5082
5083/* Abort an ongoing failover if one is going on. */
5084void abortFailover(redisMaster *mi, const char *err) {

Callers 2

syncWithMasterFunction · 0.85
abortFailoverFunction · 0.85

Calls 2

zfreeFunction · 0.85
unpauseClientsFunction · 0.85

Tested by

no test coverage detected