summaryrefslogtreecommitdiff
path: root/ctdb/server/ctdb_monitor.c
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-04-18 20:30:14 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-05-24 14:08:07 +1000
commit6d9667f01ca492b0623b23ea35f612bcc5da893e (patch)
tree658b2918516afdaee10be3ac11cba6a5191a22a0 /ctdb/server/ctdb_monitor.c
parentb5ebff6931adf0564bb1cbb98a9283382c578564 (diff)
downloadsamba-6d9667f01ca492b0623b23ea35f612bcc5da893e.tar.gz
ctdbd: Add new runstate CTDB_RUNSTATE_FIRST_RECOVERY
This adds more serialisation to the startup, ensuring that the "startup" event runs after everything to do with the first recovery (including the "recovered" event). Given that it now takes longer to get to the "startup" state, the initscript needs to wait until ctdbd gets to "first_recovery". Signed-off-by: Martin Schwenke <martin@meltin.net> Pair-programmed-with: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit ed6814ff0a59ddbb1c1b3128b505380f60d7aeb7)
Diffstat (limited to 'ctdb/server/ctdb_monitor.c')
-rw-r--r--ctdb/server/ctdb_monitor.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_monitor.c b/ctdb/server/ctdb_monitor.c
index 1e556e00d87..1608804c308 100644
--- a/ctdb/server/ctdb_monitor.c
+++ b/ctdb/server/ctdb_monitor.c
@@ -307,7 +307,6 @@ static void ctdb_wait_until_recovered(struct event_context *ev, struct timed_eve
}
ctdb->db_persistent_check_errors = 0;
- DEBUG(DEBUG_NOTICE,(__location__ " Recoveries finished. Running the \"startup\" event.\n"));
event_add_timed(ctdb->ev, ctdb->monitor->monitor_context,
timeval_current(),
ctdb_check_health, ctdb);
@@ -323,6 +322,14 @@ static void ctdb_check_health(struct event_context *ev, struct timed_event *te,
struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
int ret = 0;
+ if (ctdb->runstate < CTDB_RUNSTATE_STARTUP) {
+ DEBUG(DEBUG_NOTICE,("Not yet in startup runstate. Wait one more second\n"));
+ event_add_timed(ctdb->ev, ctdb->monitor->monitor_context,
+ timeval_current_ofs(1, 0),
+ ctdb_check_health, ctdb);
+ return;
+ }
+
if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL ||
(ctdb->monitor->monitoring_mode == CTDB_MONITORING_DISABLED &&
ctdb->runstate == CTDB_RUNSTATE_RUNNING)) {
@@ -333,6 +340,7 @@ static void ctdb_check_health(struct event_context *ev, struct timed_event *te,
}
if (ctdb->runstate == CTDB_RUNSTATE_STARTUP) {
+ DEBUG(DEBUG_NOTICE,("Recoveries finished. Running the \"startup\" event.\n"));
ret = ctdb_event_script_callback(ctdb,
ctdb->monitor->monitor_context, ctdb_startup_callback,
ctdb, false,