eventscript: don't make ourselves healthy if we're under ban_count
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 7 Dec 2009 13:22:01 +0000 (23:52 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 7 Dec 2009 13:22:01 +0000 (23:52 +1030)
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>
server/ctdb_monitor.c

index c7bbb48a2558cad202cd6a03f08fc9291ba70d06..0e5fbc2eb477ec421ca61719cfd83458e10425ad 100644 (file)
@@ -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;