Abort an ongoing failover if one is going on. */
| 5082 | |
| 5083 | /* Abort an ongoing failover if one is going on. */ |
| 5084 | void abortFailover(redisMaster *mi, const char *err) { |
| 5085 | if (g_pserver->failover_state == NO_FAILOVER) return; |
| 5086 | |
| 5087 | if (g_pserver->target_replica_host) { |
| 5088 | serverLog(LL_NOTICE,"FAILOVER to %s:%d aborted: %s", |
| 5089 | g_pserver->target_replica_host,g_pserver->target_replica_port,err); |
| 5090 | } else { |
| 5091 | serverLog(LL_NOTICE,"FAILOVER to any replica aborted: %s",err); |
| 5092 | } |
| 5093 | if (g_pserver->failover_state == FAILOVER_IN_PROGRESS) { |
| 5094 | replicationUnsetMaster(mi); |
| 5095 | } |
| 5096 | clearFailoverState(); |
| 5097 | } |
| 5098 | |
| 5099 | /* |
| 5100 | * FAILOVER [TO <HOST> <PORT> [FORCE]] [ABORT] [TIMEOUT <timeout>] |
no test coverage detected