Election-in-progress is set by unknown leader broadcast, so needs to
be cleared in all cases when election completes.
This was seen in a case where the leader node stalled, so didn't send
leader broadcasts for some time. The node continued to hold the
cluster lock, so another node could not become leader. However, after
the node returned to normal it still did not send leader broadcasts
because election-in-progress was never cleared.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14958
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
if (cluster_lock_held(rec)) {
cluster_lock_release(rec);
}
- return;
+ goto done;
}
/*
* attempt to retake it. This provides stability.
*/
if (cluster_lock_held(rec)) {
- return;
+ goto done;
}
rec->leader = CTDB_UNKNOWN_PNN;
D_WARNING("Took cluster lock, leader=%"PRIu32"\n", rec->leader);
}
+done:
rec->election_in_progress = false;
}