ctdb-recoverd: Use race for cluster lock as election when lock is enabled
commit73555e8248aff683b6cb3a02262a66ab52f2c665
authorMartin Schwenke <martin@meltin.net>
Wed, 18 Mar 2020 04:14:39 +0000 (18 15:14 +1100)
committerMartin Schwenke <martins@samba.org>
Mon, 17 Jan 2022 10:21:33 +0000 (17 10:21 +0000)
tree58a11768369bf2c80e5abaf38360d2d4b18c96ed
parent938d64c8ff3d1776c2d5959714c4c11eba7278c4
ctdb-recoverd: Use race for cluster lock as election when lock is enabled

If the cluster is partitioned then nodes in one partition can not take
the lock anyway, so election is pointless.  It just introduces
unnecessary corner cases.

Instead just race for the lock.

When a node notices a lack of leader and notifies other nodes of an
election via an unknown leader broadcast, the cluster lock election is
hooked into this broadcast.

The test needs to be updated because losing the cluster lock can now
result in a leadership change.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recoverd.c
ctdb/tests/INTEGRATION/simple/cluster.015.reclock_remove_lock.sh