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

Function resetManualFailover

src/cluster.cpp:3509–3517  ·  view source on GitHub ↗

Reset the manual failover state. This works for both masters and slaves * as all the state about manual failover is cleared. * * The function can be used both to initialize the manual failover state at * startup or to abort a manual failover in progress. */

Source from the content-addressed store, hash-verified

3507 * The function can be used both to initialize the manual failover state at
3508 * startup or to abort a manual failover in progress. */
3509void resetManualFailover(void) {
3510 if (g_pserver->cluster->mf_end) {
3511 checkClientPauseTimeoutAndReturnIfPaused();
3512 }
3513 g_pserver->cluster->mf_end = 0; /* No manual failover in progress. */
3514 g_pserver->cluster->mf_can_start = 0;
3515 g_pserver->cluster->mf_slave = NULL;
3516 g_pserver->cluster->mf_master_offset = -1;
3517}
3518
3519/* If a manual failover timed out, abort it. */
3520void manualFailoverCheckTimeout(void) {

Callers 7

clusterInitFunction · 0.85
clusterResetFunction · 0.85
clusterProcessPacketFunction · 0.85
clusterSetMasterFunction · 0.85
clusterCommandFunction · 0.85

Tested by

no test coverage detected