ctdbd: Don't ban self if init or shutdown event fails
authorAmitay Isaacs <amitay@gmail.com>
Tue, 2 Jul 2013 02:40:37 +0000 (12:40 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 2 Jul 2013 07:47:06 +0000 (17:47 +1000)
There is no point in banning the node if init or shutdown event times
out since it's going to quit anyway.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit ef1c4e99ca66e7a990bc557f34abb624c315e6ba)

server/eventscript.c

index 0715b467ff33672deba1c8506baa5aab33c97c72..1e245c81bb25303be16984d847fa09660387f2e3 100644 (file)
@@ -890,7 +890,11 @@ int ctdb_event_script_args(struct ctdb_context *ctdb, enum ctdb_eventscript_call
                                  " Immediately banning ourself for %d seconds\n",
                                  ctdb_eventscript_call_names[call],
                                  ctdb->tunable.recovery_ban_period));
-               ctdb_ban_self(ctdb);
+
+               /* Don't ban self if CTDB is starting up or shutting down */
+               if (call != CTDB_EVENT_INIT && call != CTDB_EVENT_SHUTDOWN) {
+                       ctdb_ban_self(ctdb);
+               }
        }
 
        return status.status;