summaryrefslogtreecommitdiffstats
path: root/ctdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-06-06 21:56:54 +1000
committerAndrew Tridgell <tridge@samba.org>2007-06-06 21:56:54 +1000
commit8fbca613d405e3fe70ad31cf118d7bdddb03000e (patch)
tree372d582021d34a50e99d20d9678097700144a912 /ctdb
parent4a7f116746fb93fff9b1b5e9d6719245daa64444 (diff)
downloadsamba-8fbca613d405e3fe70ad31cf118d7bdddb03000e.tar.gz
samba-8fbca613d405e3fe70ad31cf118d7bdddb03000e.tar.xz
samba-8fbca613d405e3fe70ad31cf118d7bdddb03000e.zip
get parents idea of recmode and recmaster when deciding if we should do a takeover run
(This used to be ctdb commit 0e8124acd2f1a9b34292c1ee13c7e4cd6fe49876)
Diffstat (limited to 'ctdb')
-rw-r--r--ctdb/common/ctdb_recoverd.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ctdb/common/ctdb_recoverd.c b/ctdb/common/ctdb_recoverd.c
index cdbeab377c..8a376d66f3 100644
--- a/ctdb/common/ctdb_recoverd.c
+++ b/ctdb/common/ctdb_recoverd.c
@@ -996,8 +996,17 @@ static void monitor_handler(struct ctdb_context *ctdb, uint64_t srvid,
}
nodemap->nodes[i].flags = c->flags;
+
+ ret = ctdb_ctrl_getrecmaster(ctdb, CONTROL_TIMEOUT(),
+ CTDB_CURRENT_NODE, &ctdb->recovery_master);
+
+ if (ret == 0) {
+ ret = ctdb_ctrl_getrecmode(ctdb, CONTROL_TIMEOUT(),
+ CTDB_CURRENT_NODE, &ctdb->recovery_mode);
+ }
- if (ctdb->recovery_master == ctdb->vnn &&
+ if (ret == 0 &&
+ ctdb->recovery_master == ctdb->vnn &&
ctdb->recovery_mode == CTDB_RECOVERY_NORMAL &&
ctdb->takeover.enabled) {
ret = ctdb_takeover_run(ctdb, nodemap);