diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2009-07-09 14:44:03 +1000 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2009-07-09 14:44:03 +1000 |
commit | 0c5f5ae58ddfbfa68a8cd1651ceb942cb2e3dd81 (patch) | |
tree | fae7483435635771f1428d12a5ebecff22449cca /ctdb/server/ctdb_recoverd.c | |
parent | b57811bee6ec0a5eea7a43a4dc7324b29ce45d16 (diff) | |
download | samba-0c5f5ae58ddfbfa68a8cd1651ceb942cb2e3dd81.tar.gz samba-0c5f5ae58ddfbfa68a8cd1651ceb942cb2e3dd81.tar.xz samba-0c5f5ae58ddfbfa68a8cd1651ceb942cb2e3dd81.zip |
stopped nodes can not win a recmaster election
stopped nodes must yield the recmaster role
(This used to be ctdb commit b75ac1185481060ab71bd743e1e48d333d716eba)
Diffstat (limited to 'ctdb/server/ctdb_recoverd.c')
-rw-r--r-- | ctdb/server/ctdb_recoverd.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 8f6106f614d..d601ca60a82 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -1660,11 +1660,21 @@ static bool ctdb_election_win(struct ctdb_recoverd *rec, struct election_message return false; } + /* we cant win if we are stopped */ + if (rec->node_flags & NODE_FLAGS_STOPPED) { + return false; + } + /* we will automatically win if the other node is banned */ if (em->node_flags & NODE_FLAGS_BANNED) { return true; } + /* we will automatically win if the other node is banned */ + if (em->node_flags & NODE_FLAGS_STOPPED) { + return true; + } + /* try to use the most connected node */ if (cmp == 0) { cmp = (int)myem.num_connected - (int)em->num_connected; @@ -2831,7 +2841,14 @@ again: goto again; } } - + /* If the local node is stopped, verify we are not the recmaster + and yield this role if so + */ + if ((nodemap->nodes[pnn].flags & NODE_FLAGS_STOPPED) && (rec->recmaster == pnn)) { + DEBUG(DEBUG_ERR,("Local node is STOPPED. Yielding recmaster role\n")); + force_election(rec, pnn, nodemap); + goto again; + } /* check that we (recovery daemon) and the local ctdb daemon agrees on whether we are banned or not |