ctdb-recoverd: Update capabilities before the database recovery
authorAmitay Isaacs <amitay@gmail.com>
Thu, 17 Sep 2015 06:07:37 +0000 (16:07 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 7 Oct 2015 12:53:29 +0000 (14:53 +0200)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
ctdb/server/ctdb_recoverd.c

index 4527e010ec19e12641a5023f40b20ef2257ed9ef..5ae887035b387741d9679106a9526f1ca12af545 100644 (file)
@@ -1920,13 +1920,6 @@ static int db_recovery_serial(struct ctdb_recoverd *rec, TALLOC_CTX *mem_ctx,
 
        DEBUG(DEBUG_NOTICE, (__location__ " Recovery - committed databases\n"));
 
-       /* update the capabilities for all nodes */
-       ret = update_capabilities(rec, nodemap);
-       if (ret!=0) {
-               DEBUG(DEBUG_ERR, (__location__ " Unable to update node capabilities.\n"));
-               return -1;
-       }
-
        /* build a new vnn map with all the currently active and
           unbanned nodes */
        vnnmap = talloc(mem_ctx, struct ctdb_vnn_map);
@@ -2098,6 +2091,13 @@ static int do_recovery(struct ctdb_recoverd *rec,
        */
        sync_recovery_lock_file_across_cluster(rec);
 
+       /* update the capabilities for all nodes */
+       ret = update_capabilities(rec, nodemap);
+       if (ret!=0) {
+               DEBUG(DEBUG_ERR, (__location__ " Unable to update node capabilities.\n"));
+               return -1;
+       }
+
        ret = db_recovery_serial(rec, mem_ctx, pnn, nodemap, vnnmap, dbmap);
        if (ret != 0) {
                goto fail;