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

Function sentinelFailoverStateMachine

src/sentinel.cpp:4974–4996  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4972}
4973
4974void sentinelFailoverStateMachine(sentinelRedisInstance *ri) {
4975 serverAssert(ri->flags & SRI_MASTER);
4976
4977 if (!(ri->flags & SRI_FAILOVER_IN_PROGRESS)) return;
4978
4979 switch(ri->failover_state) {
4980 case SENTINEL_FAILOVER_STATE_WAIT_START:
4981 sentinelFailoverWaitStart(ri);
4982 break;
4983 case SENTINEL_FAILOVER_STATE_SELECT_SLAVE:
4984 sentinelFailoverSelectSlave(ri);
4985 break;
4986 case SENTINEL_FAILOVER_STATE_SEND_SLAVEOF_NOONE:
4987 sentinelFailoverSendSlaveOfNoOne(ri);
4988 break;
4989 case SENTINEL_FAILOVER_STATE_WAIT_PROMOTION:
4990 sentinelFailoverWaitPromotion(ri);
4991 break;
4992 case SENTINEL_FAILOVER_STATE_RECONF_SLAVES:
4993 sentinelFailoverReconfNextSlave(ri);
4994 break;
4995 }
4996}
4997
4998/* Abort a failover in progress:
4999 *

Callers 1

Tested by

no test coverage detected