]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
we must repoint dmaster to an invalid node during recovery to stop the
authorRonnie Sahlberg <sahlberg@ronnie>
Tue, 8 May 2007 04:51:55 +0000 (14:51 +1000)
committerRonnie Sahlberg <sahlberg@ronnie>
Tue, 8 May 2007 04:51:55 +0000 (14:51 +1000)
shortcut from working

(This used to be ctdb commit 5e18930be8c0efb87aa9e2780d9457634b24e156)

ctdb/direct/recoverd.c

index cebfab98512b0411f59276be72acb6e4a143e001..f8e76adb9ef924879484f08cbe496b4d8a51308e 100644 (file)
@@ -378,21 +378,21 @@ static int do_recovery(struct ctdb_context *ctdb, struct event_context *ev,
 
 
 
-       /* pull all remote databases onto the local node */
-       ret = pull_all_remote_databases(ctdb, nodemap, vnn, dbmap, mem_ctx);
+       /* repoint all local and remote database records to an invalid
+          node as being dmaster to stop the shortcut from working
+        */
+       ret = update_dmaster_on_all_databases(ctdb, nodemap, vnn, dbmap, mem_ctx);
        if (ret != 0) {
-               DEBUG(0, (__location__ "Unable to pull remote databases\n"));
+               DEBUG(0, (__location__ "Unable to update dmaster on all databases\n"));
                return -1;
        }
 
 
 
-       /* repoint all local and remote database records to the local
-          node as being dmaster
-        */
-       ret = update_dmaster_on_all_databases(ctdb, nodemap, vnn, dbmap, mem_ctx);
+       /* pull all remote databases onto the local node */
+       ret = pull_all_remote_databases(ctdb, nodemap, vnn, dbmap, mem_ctx);
        if (ret != 0) {
-               DEBUG(0, (__location__ "Unable to update dmaster on all databases\n"));
+               DEBUG(0, (__location__ "Unable to pull remote databases\n"));
                return -1;
        }
 
@@ -439,6 +439,17 @@ static int do_recovery(struct ctdb_context *ctdb, struct event_context *ev,
        }
 
 
+       /* repoint all local and remote database records to the local
+          node as being dmaster
+        */
+       ret = update_dmaster_on_all_databases(ctdb, nodemap, vnn, dbmap, mem_ctx);
+       if (ret != 0) {
+               DEBUG(0, (__location__ "Unable to update dmaster on all databases\n"));
+               return -1;
+       }
+
+
+
        /* disable recovery mode */
        ret = set_recovery_mode(ctdb, nodemap, CTDB_RECOVERY_NORMAL);
        if (ret!=0) {