Abort an ongoing failover if one is going on. */
| 3570 | |
| 3571 | /* Abort an ongoing failover if one is going on. */ |
| 3572 | void abortFailover(const char *err) { |
| 3573 | if (server.failover_state == NO_FAILOVER) return; |
| 3574 | |
| 3575 | if (server.target_replica_host) { |
| 3576 | serverLog(LL_NOTICE,"FAILOVER to %s:%d aborted: %s", |
| 3577 | server.target_replica_host,server.target_replica_port,err); |
| 3578 | } else { |
| 3579 | serverLog(LL_NOTICE,"FAILOVER to any replica aborted: %s",err); |
| 3580 | } |
| 3581 | if (server.failover_state == FAILOVER_IN_PROGRESS) { |
| 3582 | replicationUnsetMaster(); |
| 3583 | } |
| 3584 | clearFailoverState(); |
| 3585 | } |
| 3586 | |
| 3587 | /* |
| 3588 | * FAILOVER [TO <HOST> <PORT> [FORCE]] [ABORT] [TIMEOUT <timeout>] |
no test coverage detected