recoverd: when the recmaster is banned, use that information when forcing an election
authorMichael Adam <obnox@samba.org>
Wed, 26 Jun 2013 07:23:22 +0000 (09:23 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 26 Aug 2013 11:35:56 +0000 (13:35 +0200)
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 <obnox@samba.org>
(cherry picked from commit 932360992b08a5483d90c0590218ba0fd756119e)

server/ctdb_recoverd.c

index 3f63c5c379b41fece35eca2a9aff51158eba9670..042625875bad21e11cc4f98c81c0b9038acd4ff5 100644 (file)
@@ -3086,6 +3086,12 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
 
        if (recmaster_nodemap->nodes[j].flags & NODE_FLAGS_INACTIVE) {
                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;
        }