From: Ronnie Sahlberg Date: Tue, 8 May 2007 04:51:55 +0000 (+1000) Subject: we must repoint dmaster to an invalid node during recovery to stop the X-Git-Tag: tevent-0.9.20~348^2~2766^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5efa3d88c5b122a8b735bca587ac82e1853d8b3e;p=thirdparty%2Fsamba.git we must repoint dmaster to an invalid node during recovery to stop the shortcut from working (This used to be ctdb commit 5e18930be8c0efb87aa9e2780d9457634b24e156) --- diff --git a/ctdb/direct/recoverd.c b/ctdb/direct/recoverd.c index cebfab98512..f8e76adb9ef 100644 --- a/ctdb/direct/recoverd.c +++ b/ctdb/direct/recoverd.c @@ -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) {