diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-06-06 21:56:54 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2007-06-06 21:56:54 +1000 |
commit | 8fbca613d405e3fe70ad31cf118d7bdddb03000e (patch) | |
tree | 372d582021d34a50e99d20d9678097700144a912 /ctdb | |
parent | 4a7f116746fb93fff9b1b5e9d6719245daa64444 (diff) | |
download | samba-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.c | 11 |
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); |