ctdb-recoverd: Move VNN map retrieval to where it is needed
authorMartin Schwenke <martin@meltin.net>
Tue, 27 Oct 2015 03:35:09 +0000 (14:35 +1100)
committerAmitay Isaacs <amitay@samba.org>
Mon, 16 Nov 2015 07:42:12 +0000 (08:42 +0100)
The VNN map is only needed on the recovery master, so no need for all
recovery daemons to retrieve it.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recoverd.c

index 9ff73bdb2f564cb902c6e057a5b8190a3b62b7f4..64ef2036dffaa03745314954a9d4ecf7d381b596 100644 (file)
@@ -3390,14 +3390,6 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 
        pnn = ctdb_get_pnn(ctdb);
 
-       /* get the vnnmap */
-       ret = ctdb_ctrl_getvnnmap(ctdb, CONTROL_TIMEOUT(), pnn, mem_ctx, &vnnmap);
-       if (ret != 0) {
-               DEBUG(DEBUG_ERR, (__location__ " Unable to get vnnmap from node %u\n", pnn));
-               return;
-       }
-
-
        /* get nodemap */
        TALLOC_FREE(rec->nodemap);
        ret = ctdb_ctrl_getnodemap(ctdb, CONTROL_TIMEOUT(), pnn, rec, &rec->nodemap);
@@ -3606,6 +3598,13 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
        }
 
 
+       /* get the vnnmap */
+       ret = ctdb_ctrl_getvnnmap(ctdb, CONTROL_TIMEOUT(), pnn, mem_ctx, &vnnmap);
+       if (ret != 0) {
+               DEBUG(DEBUG_ERR, (__location__ " Unable to get vnnmap from node %u\n", pnn));
+               return;
+       }
+
        if (rec->need_recovery) {
                /* a previous recovery didn't finish */
                do_recovery(rec, mem_ctx, pnn, nodemap, vnnmap);