This appears to show nested elections:
2026-05-12T12:15:56.130174+05:30 nsds1 ctdb-recoverd[826]: Leader broadcast timeout
2026-05-12T12:15:56.130206+05:30 nsds1 ctdb-recoverd[826]: Start election
2026-05-12T12:15:56.130329+05:30 nsds1 ctdb-recoverd[826]: Attempting to take cluster lock (!/usr/libexec/ctdb/ctdb_mutex_fcntl_helper /mnt/lustre/mac167/nsds_conf/.nsds_config/cluster_lock 5 20)
2026-05-12T12:16:01.131882+05:30 nsds1 ctdb-recoverd[826]: Leader broadcast timeout
2026-05-12T12:16:01.131918+05:30 nsds1 ctdb-recoverd[826]: Start election
There is no sign that the first election ended. Starting another one
causes bad state interactions. Apart from causing confusion for
multiple pieces of state (e.g. rec->election_in_progress), a nested
call to _cluster_lock_lock() will leak rec->cluster_lock_handle
because it will overwrite it with the new in-progress handle.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=16152
Reported-by: Agam S <sagam@ddn.com>
Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Jul 9 15:24:42 UTC 2026 on atb-devel-224
D_ERR("Start election\n");
+ /* Do not allow nested elections */
+ if (rec->election_in_progress) {
+ return;
+ }
+
/* set all nodes to recovery mode to stop all internode traffic */
ret = set_recovery_mode(ctdb, rec, rec->nodemap, CTDB_RECOVERY_ACTIVE);
if (ret != 0) {