Commit 1bd769ba authored by Sebastien Decugis's avatar Sebastien Decugis
Browse files

Change state first, otherwise failover might re-select the same peer

parent 6d37281c
......@@ -192,12 +192,12 @@ int fd_psm_change_state(struct fd_peer * peer, int new_state)
STATE_STR(new_state),
peer->p_hdr.info.pi_diamid);
peer->p_hdr.info.runtime.pir_state = new_state;
if (old == STATE_OPEN) {
CHECK_FCT( leave_open_state(peer) );
}
peer->p_hdr.info.runtime.pir_state = new_state;
if (new_state == STATE_OPEN) {
CHECK_FCT( enter_open_state(peer) );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment