]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-recoverd: Consistently have caller set election-in-progress
authorMartin Schwenke <martin@meltin.net>
Sat, 22 Jan 2022 18:49:18 +0000 (05:49 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 14 Feb 2022 01:47:31 +0000 (01:47 +0000)
The problem here is that election-in-progress must be set to
potentially avoid restarting the election broadcast timeout in
main_loop(), so this is already done by leader_handler().

Have force_election() set election-in-progress for all election types
and do not bother setting it in cluster_lock_election().

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>
ctdb/server/ctdb_recoverd.c

index 7a13339bf37e95a27b28fa1ea2dcf82c253e46ae..a28a287b5aa07b58618d33f0dd24fd911efeb3fd 100644 (file)
@@ -1848,7 +1848,6 @@ static void cluster_lock_election(struct ctdb_recoverd *rec)
        }
 
        rec->leader = CTDB_UNKNOWN_PNN;
-       rec->election_in_progress = true;
 
        ok = cluster_lock_take(rec);
        if (ok) {
@@ -1877,13 +1876,14 @@ static void force_election(struct ctdb_recoverd *rec)
                return;
        }
 
+       rec->election_in_progress = true;
+
        if (cluster_lock_enabled(rec)) {
                cluster_lock_election(rec);
                return;
        }
 
        talloc_free(rec->election_timeout);
-       rec->election_in_progress = true;
        rec->election_timeout = tevent_add_timer(
                        ctdb->ev, ctdb,
                        fast_start ?