From 5efa3d88c5b122a8b735bca587ac82e1853d8b3e Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Tue, 8 May 2007 14:51:55 +1000 Subject: [PATCH] we must repoint dmaster to an invalid node during recovery to stop the shortcut from working (This used to be ctdb commit 5e18930be8c0efb87aa9e2780d9457634b24e156) --- ctdb/direct/recoverd.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) 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) { -- 2.47.3