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)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 2 Jul 2013 07:47:06 +0000 (17:47 +1000)
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 b501817475f92623218cf07f9fff34d88ae21a1b..15d7bbe04a50d8972908ad9427a5535506669307 100644 (file)
@@ -3339,6 +3339,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;
        }