From: Vinit Agnihotri Date: Wed, 25 Oct 2023 11:29:33 +0000 (-0700) Subject: ctdb-daemon: Implement startipreallocate event X-Git-Tag: tdb-1.4.11~1517 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d97e642ba8b9f415d391f7ac41501bc81e83c919;p=thirdparty%2Fsamba.git ctdb-daemon: Implement startipreallocate event Signed-off-by: Vinit Agnihotri Reviewed-by: Martin Schwenke Reviewed-by: Volker Lendecke --- diff --git a/ctdb/config/events/README b/ctdb/config/events/README index 6553830326a..65286df7db1 100644 --- a/ctdb/config/events/README +++ b/ctdb/config/events/README @@ -137,6 +137,16 @@ takeip that public IP addresses have changed so that service reconfiguration will occur in the "ipreallocated" event. +startipreallocate + + This event is triggered on all nodes before ip address is + released on node. This can be used to perform action needed + to complete before ip is given away to other node. + + Example: 60.nfs would use this event to put nfs-ganesha server + on all nodes in grace period so that locks can be reclaimed + safely in lock reclaim phase. + releaseip This event is triggered for each public IP address released by diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c index 73355ab8eac..ca6ab22df1c 100644 --- a/ctdb/server/eventscript.c +++ b/ctdb/server/eventscript.c @@ -714,6 +714,7 @@ static bool check_options(enum ctdb_event call, const char *options) case CTDB_EVENT_MONITOR: case CTDB_EVENT_SHUTDOWN: case CTDB_EVENT_IPREALLOCATED: + case CTDB_EVENT_START_IPREALLOCATE: return count_words(options) == 0; case CTDB_EVENT_TAKE_IP: /* interface, IP address, netmask bits. */ @@ -739,6 +740,7 @@ static bool event_allowed_during_recovery(enum ctdb_event event) CTDB_EVENT_SHUTDOWN, CTDB_EVENT_RELEASE_IP, CTDB_EVENT_IPREALLOCATED, + CTDB_EVENT_START_IPREALLOCATE, }; size_t i;