summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-01-18 20:02:42 +1100
committerAmitay Isaacs <amitay@samba.org>2020-08-18 05:02:25 +0000
commit762d1d8a9605f97973a2c1176de5d29fcc61d15a (patch)
tree4a3e3cd5f7109b36c4d1c7895ce0fa3f43dcff82 /ctdb
parent368c83bfe3bbfff568d14f65e7b1ffa41d5349ac (diff)
downloadsamba-762d1d8a9605f97973a2c1176de5d29fcc61d15a.tar.gz
ctdb-recoverd: Change get_remote_nodemaps() to use connected nodes
The plan here is to use the nodemaps retrieved by get_remote_nodes() in update_local_flags(). This will improve efficiency, since get_remote_nodes() fetches flags from nodes in parallel. It also means that get_remote_nodes() can be used exactly once early on in main_loop() to retrieve remote nodemaps. Retrieving nodemaps multiple times is unnecessary and racy - a single monitoring iteration should not fetch flags multiple times and compare them. This introduces a temporary behaviour change but it will be of no consequence when the above changes are made. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14466 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/server/ctdb_recoverd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index b910aacce7c..0cdaab75878 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -2288,7 +2288,7 @@ static int get_remote_nodemaps(struct ctdb_recoverd *rec,
return -1;
}
- nodes = list_of_active_nodes(ctdb, rec->nodemap, mem_ctx, true);
+ nodes = list_of_connected_nodes(ctdb, rec->nodemap, mem_ctx, true);
state.remote_nodemaps = t;
state.rec = rec;
@@ -2631,8 +2631,7 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
goto takeover_run_checks;
}
- /* get the nodemap for all active remote nodes
- */
+ /* Get the nodemaps for all connected remote nodes */
ret = get_remote_nodemaps(rec, mem_ctx, &remote_nodemaps);
if (ret != 0) {
DBG_ERR("Failed to read remote nodemaps\n");