]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
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)
committerKarolin Seeger <kseeger@samba.org>
Tue, 25 Aug 2020 13:57:29 +0000 (13:57 +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 92bb9413b883a2c99adad643e39f6a2f87b7ba62..138177a91875bf3eb03be4d7b6affa862e72ccf4 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;
                }