ctdb-recoverd: Do not retrieve nodemap from recovery master
authorMartin Schwenke <martin@meltin.net>
Tue, 5 May 2020 13:49:05 +0000 (23:49 +1000)
committerStefan Metzmacher <metze@samba.org>
Thu, 27 Aug 2020 10:48:07 +0000 (10:48 +0000)
It is already in rec->nodemap.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 9475ab044161e687b9ced3a477746393565b49b1)

ctdb/server/ctdb_recoverd.c

index e24a4578a2d2a6c41ccbd2c0f79d5d0dc818051f..71be10d81dc5c6c13d87d0bcc8ee47f98c9eea3e 100644 (file)
@@ -437,27 +437,13 @@ static int update_flags_on_all_nodes(struct ctdb_recoverd *rec,
        struct ctdb_node_map_old *nodemap=NULL;
        struct ctdb_node_flag_change c;
        TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
-       uint32_t recmaster;
        uint32_t *nodes;
        int ret;
 
-       /* find the recovery master */
-       ret = ctdb_ctrl_getrecmaster(ctdb, tmp_ctx, timeout, CTDB_CURRENT_NODE, &recmaster);
-       if (ret != 0) {
-               DEBUG(DEBUG_ERR, (__location__ " Unable to get recmaster from local node\n"));
-               talloc_free(tmp_ctx);
-               return ret;
-       }
+       nodemap = rec->nodemap;
 
-       /* read the node flags from the recmaster */
-       ret = ctdb_ctrl_getnodemap(ctdb, timeout, recmaster, tmp_ctx, &nodemap);
-       if (ret != 0) {
-               DBG_ERR("Unable to get nodemap from node %u\n", recmaster);
-               talloc_free(tmp_ctx);
-               return -1;
-       }
        if (pnn >= nodemap->num) {
-               DBG_ERR("Nodemap from recmaster does not contain node %d\n", pnn);
+               DBG_ERR("Nodemap does not contain node %d\n", pnn);
                talloc_free(tmp_ctx);
                return -1;
        }