daemon: Do not ignore timed out monitor events
authorAmitay Isaacs <amitay@gmail.com>
Tue, 23 Oct 2012 04:06:33 +0000 (15:06 +1100)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 22 Nov 2012 02:02:19 +0000 (13:02 +1100)
If an eventscript times out for monitor event, it is considered successful
and the remaining eventscripts are not run. This can make a node prematurely
healthy, cause healthy node to fail over IPs to this node and this node will
not be able to host those IPs. Thus causing loss of access and in case of NAT-GW
configuration, loss of a default route.

Cherry-pick-from: 5205d545e8d8c72d73b9d5fd148df6de30392fc8

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
server/ctdb_tunables.c
server/eventscript.c

index 092c30fe9b404265a11c8db3d7139f2fbab342a2..609c71a66d04307bf35791de2ea8325d9b1b9bf8 100644 (file)
@@ -37,7 +37,7 @@ static const struct {
        { "MonitorInterval",     15,  offsetof(struct ctdb_tunable, monitor_interval) },
        { "TickleUpdateInterval",20,  offsetof(struct ctdb_tunable, tickle_update_interval) },
        { "EventScriptTimeout",  30,  offsetof(struct ctdb_tunable, script_timeout) },
-       { "EventScriptTimeoutCount", 1,  offsetof(struct ctdb_tunable, script_timeout_count) },
+       { "EventScriptTimeoutCount", 20,  offsetof(struct ctdb_tunable, script_timeout_count) },
        { "EventScriptUnhealthyOnTimeout", 0, offsetof(struct ctdb_tunable, script_unhealthy_on_timeout) },/* OBSOLETE */
        { "RecoveryGracePeriod", 120,  offsetof(struct ctdb_tunable, recovery_grace_period) },
        { "RecoveryBanPeriod",  300,  offsetof(struct ctdb_tunable, recovery_ban_period) },
index c42aaa4480f4fa0f3f6abe64890b3b8bece1d8ce..a1bcf0150d2b0052f90b5134900feb62645a3f44 100644 (file)
@@ -561,7 +561,6 @@ static void ctdb_event_script_timeout(struct event_context *ev, struct timed_eve
        case CTDB_EVENT_TAKE_IP:
        case CTDB_EVENT_RELEASE_IP:
        case CTDB_EVENT_STOPPED:
-       case CTDB_EVENT_MONITOR:
        case CTDB_EVENT_STATUS:
                state->scripts->scripts[state->current].status = 0;
                DEBUG(DEBUG_ERR,("Ignoring hung script for %s call %d\n", state->options, state->call));