summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2020-05-05 23:45:15 +1000
committerStefan Metzmacher <metze@samba.org>2020-08-27 10:48:07 +0000
commit3e3124afa3bbbcece4885e945fa801ad4e489e05 (patch)
tree66af319c5062c74490a1c5a849823669c0681849
parent5ad1f837d65b656bf73b0415de3b862d42fb840f (diff)
downloadsamba-3e3124afa3bbbcece4885e945fa801ad4e489e05.tar.gz
ctdb-recoverd: Change update_flags_on_all_nodes() to take rec argument
This makes fields such as recmaster and nodemap easily available if required. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit cb3a3147b7a3a29d7806733791e1fa6ba2e46680)
-rw-r--r--ctdb/server/ctdb_recoverd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 2aa9a14678b..05dd933c3f8 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -427,10 +427,11 @@ static int set_recovery_mode(struct ctdb_context *ctdb,
/*
* Update flags on all connected nodes
*/
-static int update_flags_on_all_nodes(struct ctdb_context *ctdb,
+static int update_flags_on_all_nodes(struct ctdb_recoverd *rec,
uint32_t pnn,
uint32_t flags)
{
+ struct ctdb_context *ctdb = rec->ctdb;
int ret;
ret = ctdb_ctrl_modflags(ctdb, CONTROL_TIMEOUT(), pnn, flags, ~flags);
@@ -1127,7 +1128,7 @@ static int do_recovery(struct ctdb_recoverd *rec,
continue;
}
- ret = update_flags_on_all_nodes(ctdb,
+ ret = update_flags_on_all_nodes(rec,
i,
nodemap->nodes[i].flags);
if (ret != 0) {
@@ -2615,7 +2616,7 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
if (i == j) {
DEBUG(DEBUG_ERR,("Use flags 0x%02x from remote node %d for cluster update of its own flags\n", remote_nodemaps[j]->nodes[i].flags, j));
update_flags_on_all_nodes(
- ctdb,
+ rec,
nodemap->nodes[i].pnn,
remote_nodemaps[j]->nodes[i].flags);
ctdb_set_culprit(rec, nodemap->nodes[j].pnn);
@@ -2625,7 +2626,7 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
} else {
DEBUG(DEBUG_ERR,("Use flags 0x%02x from local recmaster node for cluster update of node %d flags\n", nodemap->nodes[i].flags, i));
update_flags_on_all_nodes(
- ctdb,
+ rec,
nodemap->nodes[i].pnn,
nodemap->nodes[i].flags);
ctdb_set_culprit(rec, nodemap->nodes[j].pnn);