ctdb-tests: Correctly handle adding a deleted node at the end
commit8ba8fef8ac4525d98fd2213ca57d9e983a045af6
authorMartin Schwenke <mschwenke@ddn.com>
Thu, 11 Jul 2024 02:14:07 +0000 (11 12:14 +1000)
committerGünther Deschner <gd@samba.org>
Wed, 17 Jul 2024 00:06:53 +0000 (17 00:06 +0000)
tree59bc910160966df7b7c7523ede657a70eee6f793
parent340563633cab974f3b3420137fedf2dec85ca88c
ctdb-tests: Correctly handle adding a deleted node at the end

The current fake_ctdbd code for reloading the nodes file overruns the
allocation when adding a deleted node at the end.  This is a very
unlikely case, but it might as well work.

Check the size of the internal node map when marking a node deleted.
Also, update the code that adds a node to correctly set the deleted
flag when appropriate.

The included test case tests this.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Jul 17 00:06:53 UTC 2024 on atb-devel-224
ctdb/tests/UNIT/tool/ctdb.reloadnodes.040.sh [new file with mode: 0755]
ctdb/tests/src/fake_ctdbd.c