MCPcopy Create free account
hub / github.com/F-Stack/f-stack / sentinelFailoverSelectSlave

Function sentinelFailoverSelectSlave

app/redis-6.2.6/src/sentinel.c:4769–4786  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4767}
4768
4769void sentinelFailoverSelectSlave(sentinelRedisInstance *ri) {
4770 sentinelRedisInstance *slave = sentinelSelectSlave(ri);
4771
4772 /* We don't handle the timeout in this state as the function aborts
4773 * the failover or go forward in the next state. */
4774 if (slave == NULL) {
4775 sentinelEvent(LL_WARNING,"-failover-abort-no-good-slave",ri,"%@");
4776 sentinelAbortFailover(ri);
4777 } else {
4778 sentinelEvent(LL_WARNING,"+selected-slave",slave,"%@");
4779 slave->flags |= SRI_PROMOTED;
4780 ri->promoted_slave = slave;
4781 ri->failover_state = SENTINEL_FAILOVER_STATE_SEND_SLAVEOF_NOONE;
4782 ri->failover_state_change_time = mstime();
4783 sentinelEvent(LL_NOTICE,"+failover-state-send-slaveof-noone",
4784 slave, "%@");
4785 }
4786}
4787
4788void sentinelFailoverSendSlaveOfNoOne(sentinelRedisInstance *ri) {
4789 int retval;

Callers 1

Calls 4

sentinelSelectSlaveFunction · 0.85
sentinelEventFunction · 0.85
sentinelAbortFailoverFunction · 0.85
mstimeFunction · 0.70

Tested by

no test coverage detected