speed startup: immediately run first monitor event after startup.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Jun 2010 13:20:07 +0000 (22:50 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Jun 2010 13:20:07 +0000 (22:50 +0930)
Once we've done a startup, we need to run a monitor event successfully
to be marked as healthy.  Rather than wait the usual 5 seconds, run it
immediately (which will then reset next_interval to 5 seconds).

Seconds between ctdbd first log message and node healthy:
BEFORE: 23.58
AFTER: 18.09

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
server/ctdb_monitor.c

index 48a3f32ac8a448b62f3c2d635f3f071227acc4ae..12ef36fb41730bd4a7a68bde7b1ce10e0f83f63f 100644 (file)
@@ -202,7 +202,7 @@ static void ctdb_startup_callback(struct ctdb_context *ctdb, int status, void *p
        } else if (status == 0) {
                DEBUG(DEBUG_NOTICE,("startup event OK - enabling monitoring\n"));
                ctdb->done_startup = true;
-               ctdb->monitor->next_interval = 5;
+               ctdb->monitor->next_interval = 0;
                ctdb_run_notification_script(ctdb, "startup");
        }