summaryrefslogtreecommitdiff
path: root/ctdb/tools
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2015-02-09 20:20:44 +1100
committerAmitay Isaacs <amitay@samba.org>2015-04-07 07:43:13 +0200
commit13dc4a98426b30e7226015b1d8a86ec2e80d6228 (patch)
tree0e881629f499fd522f69feb500de592423ca05a3 /ctdb/tools
parentee9619c28b594b7fec8093b522ac205e5d4eb0ea (diff)
downloadsamba-13dc4a98426b30e7226015b1d8a86ec2e80d6228.tar.gz
ctdb-tool: Update "reloadnodes" to disable recoveries
If a recovery occurs when some nodes have reloaded and others haven't then the nodemaps with be inconsistent so bad things will happen. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb/tools')
-rw-r--r--ctdb/tools/ctdb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 2c906a5423e..c1014956b21 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -6361,6 +6361,7 @@ static int control_reload_nodes_file(struct ctdb_context *ctdb, int argc, const
TALLOC_CTX *tmp_ctx = talloc_new(NULL);
struct ctdb_node_map *file_nodemap;
uint32_t *conn;
+ uint32_t timeout;
assert_current_node_only(ctdb);
@@ -6400,12 +6401,24 @@ static int control_reload_nodes_file(struct ctdb_context *ctdb, int argc, const
conn[i]));
}
+ /* Another timeout could be used, such as ReRecoveryTimeout or
+ * a new one for this purpose. However, this is the simplest
+ * option. */
+ timeout = options.timelimit;
+ srvid_broadcast(ctdb, CTDB_SRVID_DISABLE_RECOVERIES, &timeout,
+ "Disable recoveries", true);
+
+
ret = ctdb_client_async_control(ctdb, CTDB_CONTROL_RELOAD_NODES_FILE,
conn, 0, TIMELIMIT(),
true, tdb_null,
NULL, reload_nodes_fail_callback,
NULL);
+ timeout = 0;
+ srvid_broadcast(ctdb, CTDB_SRVID_DISABLE_RECOVERIES, &timeout,
+ "Enable recoveries", true);
+
/* initiate a recovery */
control_recover(ctdb, argc, argv);