recoverd: All inactive nodes should yield recovery master role
authorMartin Schwenke <martin@meltin.net>
Fri, 6 Jul 2012 10:43:46 +0000 (20:43 +1000)
committerMichael Adam <obnox@samba.org>
Mon, 26 Aug 2013 11:35:49 +0000 (13:35 +0200)
Not just stopped nodes.  In reality, this means that banned nodes will
also yield, since nodes in the other inactive states won't be running
a daemon.

This seems sensible since if another node notices that an inactive
node is the recovery master then it will force an election anyway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit fc18188b7b63eb0dafbc47e3abf80e306e1dfc31)

server/ctdb_recoverd.c

index 273cce4cc2cfdf2e1a20264ad72db1cf662b8738..dd2a31e5ad0c8a80910f01648ea8b8a084cbafd3 100644 (file)
@@ -3006,8 +3006,8 @@ static void main_loop(struct ctdb_context *ctdb, struct ctdb_recoverd *rec,
        /* 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"));
+       if ((nodemap->nodes[pnn].flags & NODE_FLAGS_INACTIVE) && (rec->recmaster == pnn)) {
+               DEBUG(DEBUG_ERR,("Local node is INACTIVE. Yielding recmaster role\n"));
                force_election(rec, pnn, nodemap);
                return;
        }