Dont allow clients to connect to databases untile we are well past and through
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 11 Mar 2011 22:42:07 +0000 (09:42 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Fri, 11 Mar 2011 22:43:55 +0000 (09:43 +1100)
the initial recovery phase

CQ S1022412

server/ctdb_ltdb_server.c
server/ctdb_monitor.c

index 3cf5cfc18fc63214946e10001bb8ebfa2e6a2871..f153eeb1425f070f89bddf99ff4a5cbf9bda5687 100644 (file)
@@ -1029,7 +1029,8 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
                }
 
                if (ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE
-                && client->pid != ctdb->recoverd_pid) {
+                && client->pid != ctdb->recoverd_pid
+                && !ctdb->done_startup) {
                        struct ctdb_deferred_attach_context *da_ctx = talloc(client, struct ctdb_deferred_attach_context);
 
                        if (da_ctx == NULL) {
index f96dde48020a4e4de73e153bc554e5449f8ac050..820e082bc8a563f37176df0f5c0d0f7d12327146 100644 (file)
@@ -304,6 +304,7 @@ static void ctdb_wait_until_recovered(struct event_context *ev, struct timed_eve
                           "ctdb_start_monitoring: ctdb_recheck_persistent_health() OK\n"));
 
        DEBUG(DEBUG_NOTICE,(__location__ " Recoveries finished. Running the \"startup\" event.\n"));
+       DEBUG(DEBUG_ERR,(__location__ " Allow clients to attach to databases.\n"));
        event_add_timed(ctdb->ev, ctdb->monitor->monitor_context,
                             timeval_current(),
                             ctdb_check_health, ctdb);