From 3c65197b7aa662f9f9293e5794a56a31ab409752 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 26 Jun 2013 09:23:22 +0200 Subject: [PATCH] recoverd: when the recmaster is banned, use that information when forcing an election When we trigger an election because the recmaster considers itself inactive, update our local nodemap with the recmaster's flags before calling force_election(). This way, we don't send the inactive node freeze commands (e.g.) that may fail and then lead to ourselves getting banned. The theory is that this should help avoiding banning loops. Signed-off-by: Michael Adam (This used to be ctdb commit 932360992b08a5483d90c0590218ba0fd756119e) --- ctdb/server/ctdb_recoverd.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c index 901f24e6214..b6b2f6b8735 100644 --- a/ctdb/server/ctdb_recoverd.c +++ b/ctdb/server/ctdb_recoverd.c @@ -3553,6 +3553,12 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec, 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)); + /* + * update our nodemap to carry the recmaster's notion of + * its own flags, so that we don't keep freezing the + * inactive recmaster node... + */ + nodemap->nodes[j].flags = recmaster_nodemap->nodes[j].flags; force_election(rec, pnn, nodemap); return; } -- 2.11.4.GIT