summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2012-07-06 20:36:48 +1000
committerMartin Schwenke <martin@meltin.net>2012-08-08 16:14:52 +1000
commit97248de3a965b333c341724aecf08cb81d676eed (patch)
tree6f3f5a6a02d41f71366bf1dc73fc09907cee18d3
parent20b75046faf8ed04f9e508ac697837d1d72bace8 (diff)
downloadsamba-97248de3a965b333c341724aecf08cb81d676eed.tar.gz
samba-97248de3a965b333c341724aecf08cb81d676eed.tar.xz
samba-97248de3a965b333c341724aecf08cb81d676eed.zip
recoverd: An inactive node should not force recovery master elections
An inactive node can't become the recovery master. So if an inactive node notices that the recovery master is inactive, it shouldn't force an election for recovery master and nominate itself as a candidate. This can cause the recovery master to flip-flop between nodes when all nodes are inactive. If there is actually an active node then it will trigger the election. This is fairly cosmetic but is a step along the way towards ironing out weirdness when all nodes are stopped. Also, fix a related comment. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit e7dc10da3ced54ea9d719ad167ee42dcca8dce75)
-rw-r--r--ctdb/server/ctdb_recoverd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index 9608774dbd..11b516a271 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -3387,7 +3387,7 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
return;
}
- /* grap the nodemap from the recovery master to check if it is banned */
+ /* get nodemap from the recovery master to check if it is inactive */
ret = ctdb_ctrl_getnodemap(ctdb, CONTROL_TIMEOUT(), nodemap->nodes[j].pnn,
mem_ctx, &recmaster_nodemap);
if (ret != 0) {
@@ -3397,7 +3397,8 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
}
- if (recmaster_nodemap->nodes[j].flags & NODE_FLAGS_INACTIVE) {
+ if ((recmaster_nodemap->nodes[j].flags & NODE_FLAGS_INACTIVE) &&
+ (rec->node_flags & NODE_FLAGS_INACTIVE) == 0) {
DEBUG(DEBUG_NOTICE, ("Recmaster node %u no longer available. Force reelection\n", nodemap->nodes[j].pnn));
force_election(rec, pnn, nodemap);
return;