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

ctdb-recoverd: Take cluster lock when election completes

It is no longer just a recovery lock but is always held by the cluster
leader.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2018-09-20 14:13:58 +10:00 committed by Martin Schwenke
parent 011e880002
commit 0f2250f4f9

View File

@ -653,11 +653,23 @@ static void ctdb_election_timeout(struct tevent_context *ev,
struct timeval t, void *p)
{
struct ctdb_recoverd *rec = talloc_get_type(p, struct ctdb_recoverd);
bool ok;
rec->election_in_progress = false;
rec->election_timeout = NULL;
fast_start = false;
D_WARNING("Election period ended, leader=%u\n", rec->leader);
if (!this_node_is_leader(rec)) {
return;
}
ok = cluster_lock_take(rec);
if (!ok) {
D_ERR("Unable to get cluster lock, banning node\n");
ctdb_ban_node(rec, rec->pnn);
}
}