- /* 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;
}
}
+ /* 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) {