[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Wed Mar 6 07:10:01 UTC 2024
The branch, master has been updated
via 6005de8cb39 ctdb-scripts: Remove usage of releaseip-pre, takeip-pre pseudo-events
via 2de2d5dd201 ctdb-scripts: Remove unnecessary 06.nfs.script
via e3294e55269 ctdb-doc: Put NFS in grace on startipreallocate
via 34c76ffec50 ctdb-doc: Factor out grace period function
via 9631e3569d7 ctdb-client: Remove unused function
via a4e492f728d ctdb-scripts: Add handling for startipreallocate
via 7dacbcd0ec7 ctdb: send a CTDB_SRVID_START_IPREALLOCATE message after CTDB_EVENT_START_IPREALLOCATE
via 2483a2ae209 ctdb-takeover: Use CTDB_CONTROL_START_IPREALLOCATE
via b7cc56d22db ctdb-server: Implement CTDB_CONTROL_START_IPREALLOCATE
via 9a20dfe97a0 ctdb-protocol: Add new control CTDB_CONTROL_START_IPREALLOCATE
via d97e642ba8b ctdb-daemon: Implement startipreallocate event
via 786adccaa93 ctdb-protocol: Add new event startipreallocate
via ed67e650579 ctdb-common: Remove old runstate/string translation functions
via 318d526a0d1 ctdb-common: Remove unused variable ctdb_eventscript_call_names.
via 9f68656b473 ctdb-daemon: Use ctdb_event_to_string()
from da7f056fb5d lib/ldb-samba: Remove unused ldb.set_opaque_integer()
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 6005de8cb39320a06ff33c4b3c725ba14f72951a
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Thu Oct 26 23:38:22 2023 -0700
ctdb-scripts: Remove usage of releaseip-pre, takeip-pre pseudo-events
These were generated by 06.nfs.script.
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Wed Mar 6 07:09:06 UTC 2024 on atb-devel-224
commit 2de2d5dd2018708eeca7e8a7c66015f81bcaf693
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Thu Oct 26 23:35:25 2023 -0700
ctdb-scripts: Remove unnecessary 06.nfs.script
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit e3294e552690afe2e7b5fae03e684542d45cc5ce
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Thu Oct 26 23:07:47 2023 -0700
ctdb-doc: Put NFS in grace on startipreallocate
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Reviewed-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 34c76ffec50d9d4e85a33859b5694bc8c01e304d
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Thu Oct 26 23:03:01 2023 -0700
ctdb-doc: Factor out grace period function
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Reviewed-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 9631e3569d77857f92deed41faa888f62f2c541e
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Thu Oct 26 03:09:07 2023 -0700
ctdb-client: Remove unused function
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Reviewed-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit a4e492f728d895d59730de7d8f2e4f3a9ac8b7f4
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Thu Oct 26 03:32:00 2023 -0700
ctdb-scripts: Add handling for startipreallocate
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Reviewed-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 7dacbcd0ec79a3a2198aebc43040d2693375adcf
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Tue Feb 27 00:13:57 2024 -0800
ctdb: send a CTDB_SRVID_START_IPREALLOCATE message after CTDB_EVENT_START_IPREALLOCATE
Event scripts run the "start_ipreallocate" hook in order to notice
that some ip addresses in the cluster potentially changed.
CTDB_SRVID_START_IPREALLOCATE gives C code a chance to get notified as well
once the event scripts are finished.
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Reviewed-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 2483a2ae209c86b441fb4763cd595cb9254e5382
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Wed Oct 25 03:30:27 2023 -0700
ctdb-takeover: Use CTDB_CONTROL_START_IPREALLOCATE
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Reviewed-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit b7cc56d22dbd117f4c32a794f3116a61b3c8a7ee
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Wed Oct 25 23:55:17 2023 -0700
ctdb-server: Implement CTDB_CONTROL_START_IPREALLOCATE
Trigger a "startipreallocate" event, but only if in RUNNING runstate.
"startipreallocate" is intended to allow an NFS server to be put into
grace on all nodes before any locks are released as part of releaseip
during failover. If node A is leader and initiates a takeover run
then node B may be connected/active but may not have completed
startup. In this case, the attempt to put NFS-Ganesha into grace on
node B will fail, startipreallocate will fail, and the node will be
banned.
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Reviewed-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 9a20dfe97a03d772a5bb73e4becd7865acb3644f
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Wed Oct 25 02:14:24 2023 -0700
ctdb-protocol: Add new control CTDB_CONTROL_START_IPREALLOCATE
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Reviewed-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit d97e642ba8b9f415d391f7ac41501bc81e83c919
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Wed Oct 25 04:29:33 2023 -0700
ctdb-daemon: Implement startipreallocate event
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Reviewed-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 786adccaa934bd1980fd337ddd374f9c6e7421be
Author: Vinit Agnihotri <vagnihotri at ddn.com>
Date: Wed Oct 25 23:50:30 2023 -0700
ctdb-protocol: Add new event startipreallocate
A new event is needed for NFS lock reclaim to ensure all nodes are in
grace before any locks are released. This event must take place before
releaseip.
Signed-off-by: Vinit Agnihotri <vagnihotri at ddn.com>
Reviewed-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit ed67e650579b26e30b91775ffaa4ea7765d0b26f
Author: Martin Schwenke <mschwenke at ddn.com>
Date: Sat Feb 10 15:41:38 2024 +1100
ctdb-common: Remove old runstate/string translation functions
The canonical versions are in protocol utils.
These were unused apart from some stray forward declarations in
tools/ctdb.c and a single call in ctdb_set_runstate(), where
ctdb_runstate_to_string() can be used instead.
Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 318d526a0d13aa9e92a1ee2ca5f850ca94e219cd
Author: Martin Schwenke <mschwenke at ddn.com>
Date: Sat Feb 10 15:36:32 2024 +1100
ctdb-common: Remove unused variable ctdb_eventscript_call_names.
Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
commit 9f68656b4733d31d7274548130848122f64cebec
Author: Martin Schwenke <mschwenke at ddn.com>
Date: Sat Feb 10 15:34:03 2024 +1100
ctdb-daemon: Use ctdb_event_to_string()
ctdb_eventscript_call_names() will be dropped so the mapping between
events and strings is only maintained in one place.
Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
Reviewed-by: Volker Lendecke <vl at samba.org>
-----------------------------------------------------------------------
Summary of changes:
ctdb/client/client_control_sync.c | 28 ----
ctdb/client/client_sync.h | 4 -
ctdb/common/common.h | 4 -
ctdb/common/ctdb_util.c | 57 +-------
ctdb/config/events/README | 10 ++
ctdb/config/events/legacy/06.nfs.script | 39 ------
ctdb/config/events/legacy/60.nfs.script | 4 +
ctdb/config/nfs-linux-kernel-callout | 2 +-
ctdb/doc/ctdb-script.options.5.xml | 3 +-
ctdb/doc/ctdb.1.xml | 3 -
ctdb/doc/examples/nfs-ganesha-callout | 40 ++++--
ctdb/include/ctdb_private.h | 3 +
ctdb/include/ctdb_protocol.h | 3 -
ctdb/protocol/protocol.h | 5 +
ctdb/protocol/protocol_api.h | 3 +
ctdb/protocol/protocol_client.c | 19 +++
ctdb/protocol/protocol_control.c | 6 +
ctdb/protocol/protocol_debug.c | 3 +
ctdb/protocol/protocol_message.c | 9 ++
ctdb/protocol/protocol_util.c | 1 +
ctdb/server/ctdb_control.c | 4 +
ctdb/server/ctdb_takeover.c | 73 +++++++++++
ctdb/server/ctdb_takeover_helper.c | 143 ++++++++++++++++++++-
ctdb/server/eventscript.c | 12 +-
.../UNIT/eventscripts/06.nfs.releaseip.001.sh | 12 --
.../UNIT/eventscripts/06.nfs.releaseip.002.sh | 12 --
ctdb/tests/UNIT/eventscripts/06.nfs.takeip.001.sh | 12 --
ctdb/tests/UNIT/eventscripts/06.nfs.takeip.002.sh | 12 --
ctdb/tests/UNIT/eventscripts/scripts/06.nfs.sh | 4 -
ctdb/tests/UNIT/takeover_helper/031.sh | 1 +
ctdb/tests/scripts/integration_real_cluster.bash | 1 -
ctdb/tests/src/fake_ctdbd.c | 19 +++
ctdb/tests/src/protocol_common_ctdb.c | 11 ++
ctdb/tests/src/protocol_ctdb_test.c | 2 +-
ctdb/tools/ctdb.c | 3 -
35 files changed, 347 insertions(+), 220 deletions(-)
delete mode 100755 ctdb/config/events/legacy/06.nfs.script
delete mode 100755 ctdb/tests/UNIT/eventscripts/06.nfs.releaseip.001.sh
delete mode 100755 ctdb/tests/UNIT/eventscripts/06.nfs.releaseip.002.sh
delete mode 100755 ctdb/tests/UNIT/eventscripts/06.nfs.takeip.001.sh
delete mode 100755 ctdb/tests/UNIT/eventscripts/06.nfs.takeip.002.sh
delete mode 100644 ctdb/tests/UNIT/eventscripts/scripts/06.nfs.sh
Changeset truncated at 500 lines:
diff --git a/ctdb/client/client_control_sync.c b/ctdb/client/client_control_sync.c
index c786fc7dbca..18bd411b64c 100644
--- a/ctdb/client/client_control_sync.c
+++ b/ctdb/client/client_control_sync.c
@@ -2110,34 +2110,6 @@ int ctdb_ctrl_reload_public_ips(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
return 0;
}
-int ctdb_ctrl_ipreallocated(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- struct ctdb_client_context *client,
- int destnode, struct timeval timeout)
-{
- struct ctdb_req_control request;
- struct ctdb_reply_control *reply;
- int ret;
-
- ctdb_req_control_ipreallocated(&request);
- ret = ctdb_client_control(mem_ctx, ev, client, destnode, timeout,
- &request, &reply);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,
- ("Control IPREALLOCATED failed to node %u, ret=%d\n",
- destnode, ret));
- return ret;
- }
-
- ret = ctdb_reply_control_ipreallocated(reply);
- if (ret != 0) {
- DEBUG(DEBUG_ERR,
- ("Control IPREALLOCATED failed, ret=%d\n", ret));
- return ret;
- }
-
- return 0;
-}
-
int ctdb_ctrl_get_runstate(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
struct ctdb_client_context *client,
int destnode, struct timeval timeout,
diff --git a/ctdb/client/client_sync.h b/ctdb/client/client_sync.h
index 618879e3216..2d168e02dfe 100644
--- a/ctdb/client/client_sync.h
+++ b/ctdb/client/client_sync.h
@@ -386,10 +386,6 @@ int ctdb_ctrl_reload_public_ips(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
struct ctdb_client_context *client,
int destnode, struct timeval timeout);
-int ctdb_ctrl_ipreallocated(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
- struct ctdb_client_context *client,
- int destnode, struct timeval timeout);
-
int ctdb_ctrl_get_runstate(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
struct ctdb_client_context *client,
int destnode, struct timeval timeout,
diff --git a/ctdb/common/common.h b/ctdb/common/common.h
index 9a73bec1ac6..4f48e8926da 100644
--- a/ctdb/common/common.h
+++ b/ctdb/common/common.h
@@ -149,10 +149,6 @@ struct ctdb_node_map_old *ctdb_node_list_to_map(struct ctdb_node **nodes,
uint32_t num_nodes,
TALLOC_CTX *mem_ctx);
-const char *runstate_to_string(enum ctdb_runstate runstate);
-
-enum ctdb_runstate runstate_from_string(const char *label);
-
void ctdb_set_runstate(struct ctdb_context *ctdb, enum ctdb_runstate runstate);
uint32_t *ctdb_key_to_idkey(TALLOC_CTX *mem_ctx, TDB_DATA key);
diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c
index 5c7731c5d2a..3ca1f772eba 100644
--- a/ctdb/common/ctdb_util.c
+++ b/ctdb/common/ctdb_util.c
@@ -594,66 +594,11 @@ ctdb_node_list_to_map(struct ctdb_node **nodes, uint32_t num_nodes,
return node_map;
}
-const char *ctdb_eventscript_call_names[] = {
- "init",
- "setup",
- "startup",
- "startrecovery",
- "recovered",
- "takeip",
- "releaseip",
- "stopped",
- "monitor",
- "status",
- "shutdown",
- "reload",
- "updateip",
- "ipreallocated"
-};
-
/* Runstate handling */
-static struct {
- enum ctdb_runstate runstate;
- const char * label;
-} runstate_map[] = {
- { CTDB_RUNSTATE_UNKNOWN, "UNKNOWN" },
- { CTDB_RUNSTATE_INIT, "INIT" },
- { CTDB_RUNSTATE_SETUP, "SETUP" },
- { CTDB_RUNSTATE_FIRST_RECOVERY, "FIRST_RECOVERY" },
- { CTDB_RUNSTATE_STARTUP, "STARTUP" },
- { CTDB_RUNSTATE_RUNNING, "RUNNING" },
- { CTDB_RUNSTATE_SHUTDOWN, "SHUTDOWN" },
- { -1, NULL },
-};
-
-const char *runstate_to_string(enum ctdb_runstate runstate)
-{
- int i;
- for (i=0; runstate_map[i].label != NULL ; i++) {
- if (runstate_map[i].runstate == runstate) {
- return runstate_map[i].label;
- }
- }
-
- return runstate_map[0].label;
-}
-
-enum ctdb_runstate runstate_from_string(const char *label)
-{
- int i;
- for (i=0; runstate_map[i].label != NULL; i++) {
- if (strcasecmp(runstate_map[i].label, label) == 0) {
- return runstate_map[i].runstate;
- }
- }
-
- return CTDB_RUNSTATE_UNKNOWN;
-}
-
void ctdb_set_runstate(struct ctdb_context *ctdb, enum ctdb_runstate runstate)
{
DEBUG(DEBUG_NOTICE,("Set runstate to %s (%d)\n",
- runstate_to_string(runstate), runstate));
+ ctdb_runstate_to_string(runstate), runstate));
if (runstate <= ctdb->runstate) {
ctdb_fatal(ctdb, "runstate must always increase");
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 <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
diff --git a/ctdb/config/events/legacy/06.nfs.script b/ctdb/config/events/legacy/06.nfs.script
deleted file mode 100755
index b937d433254..00000000000
--- a/ctdb/config/events/legacy/06.nfs.script
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/sh
-# script to manage nfs in a clustered environment
-
-[ -n "$CTDB_BASE" ] || \
- CTDB_BASE=$(d=$(dirname "$0") && cd -P "$d" && dirname "$PWD")
-
-. "${CTDB_BASE}/functions"
-
-service_name="nfs"
-
-load_script_options "service" "60.nfs"
-
-ctdb_setup_state_dir "service" "$service_name"
-
-######################################################################
-
-nfs_callout_pre ()
-{
- _event="$1"
- shift
-
- nfs_callout "${_event}-pre" "$@"
-}
-
-######################################################################
-
-# script_state_dir set by ctdb_setup_state_dir()
-# shellcheck disable=SC2154
-nfs_callout_init "$script_state_dir"
-
-case "$1" in
-takeip)
- nfs_callout_pre "$@"
- ;;
-
-releaseip)
- nfs_callout_pre "$@"
- ;;
-esac
diff --git a/ctdb/config/events/legacy/60.nfs.script b/ctdb/config/events/legacy/60.nfs.script
index b7ae0746be5..001140611a2 100755
--- a/ctdb/config/events/legacy/60.nfs.script
+++ b/ctdb/config/events/legacy/60.nfs.script
@@ -269,6 +269,10 @@ takeip)
ctdb_service_set_reconfigure
;;
+startipreallocate)
+ nfs_callout "$@" || exit $?
+ ;;
+
releaseip)
nfs_callout "$@" || exit $?
ctdb_service_set_reconfigure
diff --git a/ctdb/config/nfs-linux-kernel-callout b/ctdb/config/nfs-linux-kernel-callout
index f2f3e3824d0..0d427b6d828 100755
--- a/ctdb/config/nfs-linux-kernel-callout
+++ b/ctdb/config/nfs-linux-kernel-callout
@@ -431,7 +431,7 @@ monitor-post)
register)
nfs_register
;;
-monitor-pre | releaseip | takeip | releaseip-pre | takeip-pre)
+monitor-pre | releaseip | takeip | startipreallocate)
# Not required/implemented
:
;;
diff --git a/ctdb/doc/ctdb-script.options.5.xml b/ctdb/doc/ctdb-script.options.5.xml
index a01b10a949c..ef3ad416d0d 100644
--- a/ctdb/doc/ctdb-script.options.5.xml
+++ b/ctdb/doc/ctdb-script.options.5.xml
@@ -758,8 +758,7 @@ CTDB_PER_IP_ROUTING_TABLE_ID_HIGH=9000
<title>60.nfs</title>
<para>
- This event script (along with 06.nfs) provides CTDB's NFS
- service management.
+ This event script provides CTDB's NFS service management.
</para>
<para>
diff --git a/ctdb/doc/ctdb.1.xml b/ctdb/doc/ctdb.1.xml
index 75934ef50e3..e97da35489a 100644
--- a/ctdb/doc/ctdb.1.xml
+++ b/ctdb/doc/ctdb.1.xml
@@ -656,7 +656,6 @@ Interface[2]: Name:eth5 Link:up References:2 (active)
00.ctdb OK 0.014 Sat Dec 17 19:39:11 2016
01.reclock OK 0.013 Sat Dec 17 19:39:11 2016
05.system OK 0.029 Sat Dec 17 19:39:11 2016
-06.nfs OK 0.014 Sat Dec 17 19:39:11 2016
10.interface OK 0.037 Sat Dec 17 19:39:11 2016
11.natgw OK 0.011 Sat Dec 17 19:39:11 2016
11.routing OK 0.007 Sat Dec 17 19:39:11 2016
@@ -680,7 +679,6 @@ Interface[2]: Name:eth5 Link:up References:2 (active)
00.ctdb OK 0.011 Sat Dec 17 19:40:46 2016
01.reclock OK 0.010 Sat Dec 17 19:40:46 2016
05.system OK 0.030 Sat Dec 17 19:40:46 2016
-06.nfs OK 0.014 Sat Dec 17 19:40:46 2016
10.interface OK 0.041 Sat Dec 17 19:40:46 2016
11.natgw OK 0.008 Sat Dec 17 19:40:46 2016
11.routing OK 0.007 Sat Dec 17 19:40:46 2016
@@ -717,7 +715,6 @@ Interface[2]: Name:eth5 Link:up References:2 (active)
* 00.ctdb
* 01.reclock
* 05.system
-* 06.nfs
* 10.interface
11.natgw
11.routing
diff --git a/ctdb/doc/examples/nfs-ganesha-callout b/ctdb/doc/examples/nfs-ganesha-callout
index 7c7b07413ab..0c21c47da9a 100755
--- a/ctdb/doc/examples/nfs-ganesha-callout
+++ b/ctdb/doc/examples/nfs-ganesha-callout
@@ -254,31 +254,43 @@ service_check ()
#-------------------------------------------------
-nfs_releaseip ()
+grace_period()
{
+ _arg="$1"
+
if [ -x "/usr/bin/grace_period" ]; then
- /usr/bin/grace_period "2:${2}"
+ /usr/bin/grace_period "$_arg"
else
dbus-send --print-reply --system --dest=org.ganesha.nfsd \
- /org/ganesha/nfsd/admin org.ganesha.nfsd.admin.grace \
- string:"2:${2}"
+ /org/ganesha/nfsd/admin org.ganesha.nfsd.admin.grace \
+ string:"$_arg"
fi
}
+nfs_startipreallocate()
+{
+ grace_period "0:"
+}
+
+nfs_releaseip()
+{
+ _ip="$2"
+
+ # NFS-Ganesha recovery code only processes items matching $_ip
+ grace_period "2:${_ip}"
+}
+
nfs_takeip ()
{
+ _ip="$2"
+
case $state_fs in
glusterfs)
- check_ln "$NODESTATEDIR" "${GANSTATEDIR}/${2}"
+ check_ln "$NODESTATEDIR" "${GANSTATEDIR}/${_ip}"
;;
esac
- if [ -x "/usr/bin/grace_period" ]; then
- /usr/bin/grace_period "5:${2}"
- else
- dbus-send --print-reply --system --dest=org.ganesha.nfsd \
- /org/ganesha/nfsd/admin org.ganesha.nfsd.admin.grace \
- string:"5:${2}"
- fi
+
+ grace_period "5:${_ip}"
}
##################################################
@@ -322,6 +334,7 @@ startup
stop
start
check
+startipreallocate
releaseip
takeip
monitor-list-shares
@@ -339,11 +352,12 @@ startup) nfs_startup ;;
stop) service_stop "$1" ;;
start) service_start "$1" ;;
check) service_check "$1" ;;
+startipreallocate) nfs_startipreallocate ;;
releaseip) nfs_releaseip "$@" ;;
takeip) nfs_takeip "$@" ;;
monitor-list-shares) nfs_monitor_list_shares ;;
register) nfs_register ;;
-monitor-pre|monitor-post|releaseip-pre|takeip-pre)
+monitor-pre|monitor-post)
# Not required/implemented
:
;;
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 80278123778..cee95792ead 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -887,6 +887,9 @@ int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
int32_t ctdb_control_ipreallocated(struct ctdb_context *ctdb,
struct ctdb_req_control_old *c,
bool *async_reply);
+int32_t ctdb_control_start_ipreallocate(struct ctdb_context *ctdb,
+ struct ctdb_req_control_old *c,
+ bool *async_reply);
int ctdb_set_public_addresses(struct ctdb_context *ctdb, bool check_addresses);
diff --git a/ctdb/include/ctdb_protocol.h b/ctdb/include/ctdb_protocol.h
index 31af4201040..bec849e857c 100644
--- a/ctdb/include/ctdb_protocol.h
+++ b/ctdb/include/ctdb_protocol.h
@@ -52,9 +52,6 @@ struct ctdb_script_list_old {
struct ctdb_script scripts[1];
};
-/* Mapping from enum to names. */
-extern const char *ctdb_eventscript_call_names[];
-
/*
packet structures
*/
diff --git a/ctdb/protocol/protocol.h b/ctdb/protocol/protocol.h
index 009a0df06af..99440b39125 100644
--- a/ctdb/protocol/protocol.h
+++ b/ctdb/protocol/protocol.h
@@ -143,6 +143,9 @@ struct ctdb_call {
/* SRVID to inform clients that CTDB_EVENT_IPREALLOCATED finished */
#define CTDB_SRVID_IPREALLOCATED 0xF302000000000000LL
+/* SRVID to inform clients that CTDB_EVENT_START_IPREALLOCATE finished */
+#define CTDB_SRVID_START_IPREALLOCATE 0xF303000000000000LL
+
/* SRVID to inform recovery daemon of the node flags - OBSOLETE */
#define CTDB_SRVID_SET_NODE_FLAGS 0xF400000000000000LL
@@ -386,6 +389,7 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS = 0,
CTDB_CONTROL_ENABLE_NODE = 158,
CTDB_CONTROL_TCP_CLIENT_DISCONNECTED = 159,
CTDB_CONTROL_TCP_CLIENT_PASSED = 160,
+ CTDB_CONTROL_START_IPREALLOCATE = 161,
};
#define MAX_COUNT_BUCKETS 16
@@ -764,6 +768,7 @@ enum ctdb_event {
CTDB_EVENT_RELOAD, /* Deprecated, do not use */
CTDB_EVENT_UPDATE_IP, /* IP updating: old interface, new interface, IP address, netmask bits. */
CTDB_EVENT_IPREALLOCATED, /* when a takeover_run() completes */
+ CTDB_EVENT_START_IPREALLOCATE, /* When a takeover_run() starts */
CTDB_EVENT_MAX
};
diff --git a/ctdb/protocol/protocol_api.h b/ctdb/protocol/protocol_api.h
index 48e4e84391d..6cc47a43980 100644
--- a/ctdb/protocol/protocol_api.h
+++ b/ctdb/protocol/protocol_api.h
@@ -603,6 +603,9 @@ int ctdb_reply_control_disable_node(struct ctdb_reply_control *reply);
void ctdb_req_control_enable_node(struct ctdb_req_control *request);
int ctdb_reply_control_enable_node(struct ctdb_reply_control *reply);
+void ctdb_req_control_start_ipreallocate(struct ctdb_req_control *request);
+int ctdb_reply_control_start_ipreallocate(struct ctdb_reply_control *reply);
+
/* From protocol/protocol_debug.c */
void ctdb_packet_print(uint8_t *buf, size_t buflen, FILE *fp);
diff --git a/ctdb/protocol/protocol_client.c b/ctdb/protocol/protocol_client.c
index 9ca2d4e7b8d..082383bc038 100644
--- a/ctdb/protocol/protocol_client.c
+++ b/ctdb/protocol/protocol_client.c
@@ -2350,3 +2350,22 @@ int ctdb_reply_control_enable_node(struct ctdb_reply_control *reply)
{
return ctdb_reply_control_generic(reply, CTDB_CONTROL_ENABLE_NODE);
}
+
+/* CTDB_CONTROL_START_IPREALLOCATE */
+
+void ctdb_req_control_start_ipreallocate(struct ctdb_req_control *request)
+{
+ request->opcode = CTDB_CONTROL_START_IPREALLOCATE;
+ request->pad = 0;
+ request->srvid = 0;
+ request->client_id = 0;
+ request->flags = 0;
+
+ request->rdata.opcode = CTDB_CONTROL_START_IPREALLOCATE;
+}
+
+int ctdb_reply_control_start_ipreallocate(struct ctdb_reply_control *reply)
+{
+ return ctdb_reply_control_generic(reply,
+ CTDB_CONTROL_START_IPREALLOCATE);
+}
diff --git a/ctdb/protocol/protocol_control.c b/ctdb/protocol/protocol_control.c
index e4491159937..8b8de1a81e3 100644
--- a/ctdb/protocol/protocol_control.c
+++ b/ctdb/protocol/protocol_control.c
@@ -418,6 +418,9 @@ static size_t ctdb_req_control_data_len(struct ctdb_req_control_data *cd)
case CTDB_CONTROL_TCP_CLIENT_PASSED:
len = ctdb_connection_len(cd->data.conn);
break;
+
+ case CTDB_CONTROL_START_IPREALLOCATE:
+ break;
}
return len;
@@ -1414,6 +1417,9 @@ static size_t ctdb_reply_control_data_len(struct ctdb_reply_control_data *cd)
case CTDB_CONTROL_TCP_CLIENT_PASSED:
break;
+
+ case CTDB_CONTROL_START_IPREALLOCATE:
+ break;
}
return len;
diff --git a/ctdb/protocol/protocol_debug.c b/ctdb/protocol/protocol_debug.c
index f1e1fc070d9..cfa8b47672d 100644
--- a/ctdb/protocol/protocol_debug.c
+++ b/ctdb/protocol/protocol_debug.c
@@ -247,6 +247,7 @@ static void ctdb_opcode_print(uint32_t opcode, FILE *fp)
{ CTDB_CONTROL_ENABLE_NODE, "ENABLE_NODE" },
{ CTDB_CONTROL_TCP_CLIENT_DISCONNECTED, "TCP_CLIENT_DISCONNECTED" },
{ CTDB_CONTROL_TCP_CLIENT_PASSED, "TCP_CLIENT_PASSED" },
+ { CTDB_CONTROL_START_IPREALLOCATE, "START_IPREALLOCATE" },
{ MAP_END, "" },
};
@@ -303,6 +304,8 @@ static void ctdb_srvid_print(uint64_t srvid, FILE *fp)
fprintf(fp, "TAKE_IP");
} else if (srvid == CTDB_SRVID_IPREALLOCATED) {
fprintf(fp, "IPREALLOCATED");
+ } else if (srvid == CTDB_SRVID_START_IPREALLOCATE) {
+ fprintf(fp, "START_IPREALLOCATE");
--
Samba Shared Repository
More information about the samba-cvs
mailing list