ctdb-recoverd: Do not fetch the nodemap from the recovery master
authorMartin Schwenke <martin@meltin.net>
Thu, 13 Jun 2019 14:23:22 +0000 (00:23 +1000)
committerStefan Metzmacher <metze@samba.org>
Thu, 27 Aug 2020 10:48:08 +0000 (10:48 +0000)
The nodemap has already been fetched from the local node and is
actually passed to this function.  Care must be taken to avoid
referencing the "remote" nodemap for the recovery master.  It also
isn't useful to do so, since it would be the same nodemap.

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>
(cherry picked from commit d50919b0cb28f299c9b6985271b29d4f27c5f619)

ctdb/server/ctdb_recoverd.c

index 0cdaab75878f7caf3808849f66ab47575c043e19..2b01c897f3da61a2549eff7f7424f9cb2ed9a372 100644 (file)
@@ -2288,7 +2288,7 @@ static int get_remote_nodemaps(struct ctdb_recoverd *rec,
                return -1;
        }
 
-       nodes = list_of_connected_nodes(ctdb, rec->nodemap, mem_ctx, true);
+       nodes = list_of_connected_nodes(ctdb, rec->nodemap, mem_ctx, false);
 
        state.remote_nodemaps = t;
        state.rec = rec;
@@ -2641,6 +2641,9 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
        /* verify that all other nodes have the same nodemap as we have
        */
        for (j=0; j<nodemap->num; j++) {
+               if (nodemap->nodes[j].pnn == ctdb->pnn) {
+                       continue;
+               }
                if (nodemap->nodes[j].flags & NODE_FLAGS_INACTIVE) {
                        continue;
                }
@@ -2677,6 +2680,9 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
         * up-to-date information for all the nodes.
         */
        for (j=0; j<nodemap->num; j++) {
+               if (nodemap->nodes[j].pnn == ctdb->pnn) {
+                       continue;
+               }
                if (nodemap->nodes[j].flags & NODE_FLAGS_INACTIVE) {
                        continue;
                }
@@ -2684,6 +2690,9 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
        }
 
        for (j=0; j<nodemap->num; j++) {
+               if (nodemap->nodes[j].pnn == ctdb->pnn) {
+                       continue;
+               }
                if (nodemap->nodes[j].flags & NODE_FLAGS_INACTIVE) {
                        continue;
                }