[SCM] CTDB repository - branch 1.3 updated - ctdb-1.9.1-338-g939e7c9

Ronnie Sahlberg sahlberg at samba.org
Tue Mar 1 01:21:51 MST 2011


The branch, 1.3 has been updated
       via  939e7c925edf14e89f94f7084f35e3992cab08ce (commit)
       via  e3522164c42ff36154dc6be4d96441bd46dcdacb (commit)
       via  c906747d52c08588cdace0f92480b533f87ca95f (commit)
       via  fffee2f8d7e78afdb375f457064d0e9ef77c8d30 (commit)
      from  b629b1146543c397cb10cb0339720daa0fbee0e0 (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=1.3


- Log -----------------------------------------------------------------
commit 939e7c925edf14e89f94f7084f35e3992cab08ce
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Mar 1 12:09:42 2011 +1100

    If/when the recovery daemon terminates unexpectedly, try to restart it again from the main daemon instead of just shutting down the main deamon too.
    
    While it does not address the reason for recovery daemon shutting down, it reduces the impact of such issues and makes the system more robust.

commit e3522164c42ff36154dc6be4d96441bd46dcdacb
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Mar 1 10:48:04 2011 +1100

    version 1.2.200

commit c906747d52c08588cdace0f92480b533f87ca95f
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Feb 25 10:33:12 2011 +1100

    ATTACH_DB: simplify the code slightly and change the semantics to only
    refuse a db attach during recovery IF we can associate the request from a
    genuine real client instead of deciding this on whether client_id is zero or
    
    This will suppress/avoid messages like these :
    DB Attach to database %s refused. Can not match clientid...

commit fffee2f8d7e78afdb375f457064d0e9ef77c8d30
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Feb 25 10:06:08 2011 +1100

    Dont return error if trying to set db priority on a db that does not yet exist.
    Just treat as a nop.
    
    When the database is created later it will get its priority set properly.

-----------------------------------------------------------------------

Summary of changes:
 packaging/RPM/ctdb.spec.in |    4 +++-
 server/ctdb_ltdb_server.c  |   15 ++++++---------
 server/ctdb_recoverd.c     |   25 +++++++++++++++----------
 3 files changed, 24 insertions(+), 20 deletions(-)


Changeset truncated at 500 lines:

diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index 06ca44b..97c42b4 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -3,7 +3,7 @@ Name: ctdb
 Summary: Clustered TDB
 Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
-Version: 1.3.2
+Version: 1.2.200
 Release: 1GITHASH
 Epoch: 0
 License: GNU GPL version 3
@@ -143,6 +143,8 @@ development libraries for ctdb
 %{_libdir}/libctdb.a
 
 %changelog
+* Tue Mar 1 2011 : Version 1.2.200
+ - Rename the version to 1.2.200 instead of 1.3.x
 * Fri Feb 25 2011 : Version 1.3.2
  - Fix for split brain during early startup
  - fix for TRANS3 causing transactions to fail
diff --git a/server/ctdb_ltdb_server.c b/server/ctdb_ltdb_server.c
index 3e90b2d..19a68ec 100644
--- a/server/ctdb_ltdb_server.c
+++ b/server/ctdb_ltdb_server.c
@@ -805,6 +805,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
 	const char *db_name = (const char *)indata.dptr;
 	struct ctdb_db_context *db;
 	struct ctdb_node *node = ctdb->nodes[ctdb->pnn];
+	struct ctdb_client *client = NULL;
 
 	/* dont allow any local clients to attach while we are in recovery mode
 	 * except for the recovery daemon.
@@ -812,13 +813,9 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
 	 * recovery daemons.
 	 */
 	if (client_id != 0) {
-		struct ctdb_client *client = ctdb_reqid_find(ctdb, client_id, struct ctdb_client);
-
-		if (client == NULL) {
-			DEBUG(DEBUG_ERR,("DB Attach to database %s refused. Can not match clientid:%d to a client structure.\n", db_name, client_id));
-			return -1;
-		}
-
+		client = ctdb_reqid_find(ctdb, client_id, struct ctdb_client);
+	}
+	if (client != NULL) {
 		/* If the node is inactive it is not part of the cluster
 		   and we should not allow clients to attach to any
 		   databases
@@ -1195,12 +1192,12 @@ int32_t ctdb_control_set_db_priority(struct ctdb_context *ctdb, TDB_DATA indata)
 	ctdb_db = find_ctdb_db(ctdb, db_prio->db_id);
 	if (!ctdb_db) {
 		DEBUG(DEBUG_ERR,("Unknown db_id 0x%x in ctdb_set_db_priority\n", db_prio->db_id));
-		return -1;
+		return 0;
 	}
 
 	if ((db_prio->priority<1) || (db_prio->priority>NUM_DB_PRIORITIES)) {
 		DEBUG(DEBUG_ERR,("Trying to set invalid priority : %u\n", db_prio->priority));
-		return -1;
+		return 0;
 	}
 
 	ctdb_db->priority = db_prio->priority;
diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index b82f0e7..13dafa7 100644
--- a/server/ctdb_recoverd.c
+++ b/server/ctdb_recoverd.c
@@ -70,6 +70,7 @@ struct ctdb_recoverd {
 #define CONTROL_TIMEOUT() timeval_current_ofs(ctdb->tunable.recover_timeout, 0)
 #define MONITOR_TIMEOUT() timeval_current_ofs(ctdb->tunable.recover_interval, 0)
 
+static void ctdb_restart_recd(struct event_context *ev, struct timed_event *te, struct timeval t, void *private_data);
 
 /*
   ban a node for a period of time
@@ -3518,18 +3519,12 @@ static void ctdb_check_recd(struct event_context *ev, struct timed_event *te,
 	struct ctdb_context *ctdb = talloc_get_type(p, struct ctdb_context);
 
 	if (kill(ctdb->recoverd_pid, 0) != 0) {
-		DEBUG(DEBUG_ERR,("Recovery daemon (pid:%d) is no longer running. Shutting down main daemon\n", (int)ctdb->recoverd_pid));
+		DEBUG(DEBUG_ERR,("Recovery daemon (pid:%d) is no longer running. Trying to restart recovery daemon.\n", (int)ctdb->recoverd_pid));
 
-		ctdb_stop_recoverd(ctdb);
-		ctdb_stop_keepalive(ctdb);
-		ctdb_stop_monitoring(ctdb);
-		ctdb_release_all_ips(ctdb);
-		if (ctdb->methods != NULL) {
-			ctdb->methods->shutdown(ctdb);
-		}
-		ctdb_event_script(ctdb, CTDB_EVENT_SHUTDOWN);
+		event_add_timed(ctdb->ev, ctdb, timeval_zero(), 
+				ctdb_restart_recd, ctdb);
 
-		exit(10);	
+		return;
 	}
 
 	event_add_timed(ctdb->ev, ctdb, 
@@ -3631,3 +3626,13 @@ void ctdb_stop_recoverd(struct ctdb_context *ctdb)
 	DEBUG(DEBUG_NOTICE,("Shutting down recovery daemon\n"));
 	kill(ctdb->recoverd_pid, SIGTERM);
 }
+
+static void ctdb_restart_recd(struct event_context *ev, struct timed_event *te, 
+		       struct timeval t, void *private_data)
+{
+	struct ctdb_context *ctdb = talloc_get_type(private_data, struct ctdb_context);
+
+	DEBUG(DEBUG_ERR,("Restarting recovery daemon\n"));
+	ctdb_stop_recoverd(ctdb);
+	ctdb_start_recoverd(ctdb);
+}


-- 
CTDB repository


More information about the samba-cvs mailing list