speed startup: add --sloppy-start.
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Jun 2010 13:22:34 +0000 (22:52 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 22 Jun 2010 13:22:34 +0000 (22:52 +0930)
The extra recovery interval wait was introduced in 821333afb458 but no
explanation was provided in that message.  Nonetheless, if starting
the entire cluster for the first time, it should be safe to skip this.

We use the commandline arg --sloppy-start which should discourage
people from using it outside testing.

Seconds between ctdbd first log message and node healthy:
BEFORE: 16.10
AFTER: 4.03

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

index 642a55e25c21d7376f3fb1f52645633832999cca..3abbe33b609a8a88a0edc1d1a10f0d33435b6e48 100644 (file)
@@ -1299,6 +1299,7 @@ int32_t ctdb_control_recd_ping(struct ctdb_context *ctdb);
 int32_t ctdb_control_set_recmaster(struct ctdb_context *ctdb, uint32_t opcode, TDB_DATA indata);
 
 extern int script_log_level;
+extern bool fast_start;
 
 int32_t ctdb_control_get_event_script_status(struct ctdb_context *ctdb,
                                             uint32_t call_type,
index 9038ef0982e2c29feaa5f52a3c0e22fa28957b7c..3343501624571d1e8f90076350a9701cda078ba7 100644 (file)
@@ -245,7 +245,7 @@ static void ctdb_wait_until_recovered(struct event_context *ev, struct timed_eve
        }
 
 
-       if (timeval_elapsed(&ctdb->last_recovery_finished) < (ctdb->tunable.rerecovery_timeout + 3)) {
+       if (!fast_start && timeval_elapsed(&ctdb->last_recovery_finished) < (ctdb->tunable.rerecovery_timeout + 3)) {
                ctdb->db_persistent_startup_generation = INVALID_GENERATION;
 
                DEBUG(DEBUG_NOTICE,(__location__ " wait for pending recoveries to end. Wait one more second.\n"));
index 12e754e1bac6e1e5775bc760143a9eb15d1ad184..e20a742f56ab1cf3a59fef67e9086cbc45c21f19 100644 (file)
@@ -64,6 +64,7 @@ static struct {
 };
 
 int script_log_level;
+bool fast_start;
 
 /*
   called by the transport layer when a packet comes in
@@ -144,6 +145,7 @@ int main(int argc, const char *argv[])
                  &options.max_persistent_check_errors, 0,
                  "max allowed persistent check errors (default 0)", NULL },
                { "log-ringbuf-size", 0, POPT_ARG_INT, &log_ringbuf_size, DEBUG_ERR, "Number of log messages we can store in the memory ringbuffer", NULL },
+               { "sloppy-start", 0, POPT_ARG_NONE, &fast_start, 0, "Do not perform full recovery on start", NULL },
                POPT_TABLEEND
        };
        int opt, ret;