summaryrefslogtreecommitdiff
path: root/ctdb/server/ctdb_recoverd.c
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2020-05-05 23:45:15 +1000
committerMartin Schwenke <martins@samba.org>2020-07-24 04:41:25 +0000
commitcb3a3147b7a3a29d7806733791e1fa6ba2e46680 (patch)
tree5f2ef80f2925b7b545e245c1bc259155a9139f1a /ctdb/server/ctdb_recoverd.c
parent6982fcb3e6c940d0047aac3b6bfbc9dfdc8d7214 (diff)
downloadsamba-cb3a3147b7a3a29d7806733791e1fa6ba2e46680.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>
Diffstat (limited to 'ctdb/server/ctdb_recoverd.c')
-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);