Abort a failover in progress: * * This function can only be called before the promoted slave acknowledged * the slave -> master switch. Otherwise the failover can't be aborted and * will reach its end (possibly by timeout). */
| 5001 | * the slave -> master switch. Otherwise the failover can't be aborted and |
| 5002 | * will reach its end (possibly by timeout). */ |
| 5003 | void sentinelAbortFailover(sentinelRedisInstance *ri) { |
| 5004 | serverAssert(ri->flags & SRI_FAILOVER_IN_PROGRESS); |
| 5005 | serverAssert(ri->failover_state <= SENTINEL_FAILOVER_STATE_WAIT_PROMOTION); |
| 5006 | |
| 5007 | ri->flags &= ~(SRI_FAILOVER_IN_PROGRESS|SRI_FORCE_FAILOVER); |
| 5008 | ri->failover_state = SENTINEL_FAILOVER_STATE_NONE; |
| 5009 | ri->failover_state_change_time = mstime(); |
| 5010 | if (ri->promoted_slave) { |
| 5011 | ri->promoted_slave->flags &= ~SRI_PROMOTED; |
| 5012 | ri->promoted_slave = NULL; |
| 5013 | } |
| 5014 | } |
| 5015 | |
| 5016 | /* ======================== SENTINEL timer handler ========================== |
| 5017 | * This is the "main" our Sentinel, being sentinel completely non blocking |
no test coverage detected