From: Volker Lendecke Date: Tue, 18 Nov 2025 09:31:01 +0000 (+0100) Subject: ctdb: Fix ctdb startup with inconsistent cluster lock settings X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66ebdb917054f4841f583ee21f910a1869712b53;p=thirdparty%2Fsamba.git ctdb: Fix ctdb startup with inconsistent cluster lock settings 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 Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Wed Nov 19 03:04:13 UTC 2025 on atb-devel-224 --- diff --git a/ctdb/server/ctdb_recover.c b/ctdb/server/ctdb_recover.c index 5a40618487e..18dc250f5ce 100644 --- a/ctdb/server/ctdb_recover.c +++ b/ctdb/server/ctdb_recover.c @@ -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"));