ctdb-daemon: Implement startipreallocate event
authorVinit Agnihotri <vagnihotri@ddn.com>
Wed, 25 Oct 2023 11:29:33 +0000 (04:29 -0700)
committerVolker Lendecke <vl@samba.org>
Wed, 6 Mar 2024 06:05:38 +0000 (06:05 +0000)
Signed-off-by: Vinit Agnihotri <vagnihotri@ddn.com>
Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
ctdb/config/events/README
ctdb/server/eventscript.c

index 6553830326a6639d9fa2f8a4ec1e669fdfc117fc..65286df7db13122571468b154c9f67d655f322d6 100644 (file)
@@ -137,6 +137,16 @@ takeip <interface> <ip-address> <netmask-bits>
        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 <interface> <ip-address> <netmask-bits>
 
        This event is triggered for each public IP address released by
index 73355ab8eacf0bc99b81e43dd57b3963d44414da..ca6ab22df1c298f7a4391111983eb3d4459b9737 100644 (file)
@@ -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;