]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb: Fix ctdb startup with inconsistent cluster lock settings
authorVolker Lendecke <vl@samba.org>
Tue, 18 Nov 2025 09:31:01 +0000 (10:31 +0100)
committerMartin Schwenke <martins@samba.org>
Wed, 19 Nov 2025 03:04:13 +0000 (03:04 +0000)
ctdb_shutdown_sequence() normally exits. When we end up here, it is
because we have received a reclock callback twice. We can't handle
that, we have already removed "state", which would be referenced deep
in run_start_recovery_event() returning here another time.

The bug is triggered since b84fbd7b3fedc998 introduced a nested event
loop, making ctdb_shutdown_sequence() return into
start_recovery_reclock_callback() due to multiple reclock checks being
triggered somehow (not sure exactly how, but we should not crash under
any circumstance).

Reproducer: Run one ctdb daemon with cluster lock set, try to start
another one without cluster lock set.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15950
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Wed Nov 19 03:04:13 UTC 2025 on atb-devel-224

ctdb/server/ctdb_recover.c

index 5a40618487e6f8e6dd08926d8cf16696b3e0588b..18dc250f5ce067ab7036407ca9588452762828f9 100644 (file)
@@ -977,6 +977,8 @@ static void start_recovery_reclock_callback(struct ctdb_context *ctdb,
                       local == NULL ? "NULL" : local));
                talloc_free(state);
                ctdb_shutdown_sequence(ctdb, 1);
+               /* In case above returns due to duplicate shutdown */
+               return;
        }
        DEBUG(DEBUG_INFO,
              ("Recovery lock consistency check successful\n"));