summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_monitor.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-12-07 23:52:01 +1030
committerRusty Russell <rusty@rustcorp.com.au>2009-12-07 23:52:01 +1030
commit9914d3f561b49134f7495ec5574b94e27b314512 (patch)
treef792d2fa48bc772cfa3601fb25af8e98e69c1121 /ctdb/server/ctdb_monitor.c
parent928b8dcb319ca7d3f7e14f1ff3c90fe33bbbad5a (diff)
downloadsamba-9914d3f561b49134f7495ec5574b94e27b314512.tar.gz
samba-9914d3f561b49134f7495ec5574b94e27b314512.tar.xz
samba-9914d3f561b49134f7495ec5574b94e27b314512.zip
eventscript: don't make ourselves healthy if we're under ban_count
If we've timed out, but we've not timed out more than ctdb->tunable.script_ban_count, we pretend we haven't. There's a logic bug in the way this is done: if we were unhealthy before, this would set us to "healthy" again (status == 0). I don't think this would happen in real life, but it's a little surprising. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit e6488c0e05bab5c4c2c0a6370930b0b27e5ed56e)
Diffstat (limited to 'ctdb/server/ctdb_monitor.c')
-rw-r--r--ctdb/server/ctdb_monitor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_monitor.c b/ctdb/server/ctdb_monitor.c
index c7bbb48a255..0e5fbc2eb47 100644
--- a/ctdb/server/ctdb_monitor.c
+++ b/ctdb/server/ctdb_monitor.c
@@ -130,7 +130,7 @@ static void ctdb_health_callback(struct ctdb_context *ctdb, int status, void *p)
DEBUG(DEBUG_ERR, ("Maximum timeout count %u reached for eventscript. Making node unhealthy\n", ctdb->tunable.script_ban_count));
} else {
/* We pretend this is OK. */
- status = 0;
+ goto after_change_status;
}
}
@@ -168,6 +168,7 @@ static void ctdb_health_callback(struct ctdb_context *ctdb, int status, void *p)
}
+after_change_status:
next_interval = ctdb->monitor->next_interval;
ctdb->monitor->next_interval *= 2;