1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

ctdb-recoverd: Always cancel election in progress

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>
This commit is contained in:
Martin Schwenke 2022-01-21 18:09:47 +11:00 committed by Amitay Isaacs
parent 18437fd6a7
commit 188a902156

View File

@ -1836,7 +1836,7 @@ static void cluster_lock_election(struct ctdb_recoverd *rec)
if (cluster_lock_held(rec)) {
cluster_lock_release(rec);
}
return;
goto done;
}
/*
@ -1844,7 +1844,7 @@ static void cluster_lock_election(struct ctdb_recoverd *rec)
* attempt to retake it. This provides stability.
*/
if (cluster_lock_held(rec)) {
return;
goto done;
}
rec->leader = CTDB_UNKNOWN_PNN;
@ -1856,6 +1856,7 @@ static void cluster_lock_election(struct ctdb_recoverd *rec)
D_WARNING("Took cluster lock, leader=%"PRIu32"\n", rec->leader);
}
done:
rec->election_in_progress = false;
}