New version 1.2.15
[sahlberg/ctdb.git] / server / ctdb_monitor.c
index 48a3f32ac8a448b62f3c2d635f3f071227acc4ae..7f5da5c3377875d817519f7f50cc2cdc90ea04ab 100644 (file)
@@ -19,7 +19,7 @@
 */
 
 #include "includes.h"
-#include "lib/events/events.h"
+#include "lib/tevent/tevent.h"
 #include "system/filesys.h"
 #include "system/wait.h"
 #include "../include/ctdb_private.h"
@@ -91,6 +91,7 @@ void ctdb_run_notification_script(struct ctdb_context *ctdb, const char *event)
        if (child == 0) {
                int ret;
 
+               debug_extra = talloc_asprintf(NULL, "notification-%s:", event);
                ret = ctdb_run_notification_script_child(ctdb, event);
                if (ret != 0) {
                        DEBUG(DEBUG_ERR,(__location__ " Notification script failed\n"));
@@ -202,7 +203,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 = 2;
                ctdb_run_notification_script(ctdb, "startup");
        }
 
@@ -245,7 +246,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"));
@@ -301,7 +302,7 @@ static void ctdb_wait_until_recovered(struct event_context *ev, struct timed_eve
 
        DEBUG(DEBUG_NOTICE,(__location__ " Recoveries finished. Running the \"startup\" event.\n"));
        event_add_timed(ctdb->ev, ctdb->monitor->monitor_context,
-                            timeval_current_ofs(1, 0), 
+                            timeval_current(),
                             ctdb_check_health, ctdb);
 }