[SCM] CTDB repository - branch 1.0.112 updated - ctdb-1.0.111-160-g86f6bda

Ronnie Sahlberg sahlberg at samba.org
Sun Mar 6 22:10:43 MST 2011


The branch, 1.0.112 has been updated
       via  86f6bda454b0da811ae5287cc7daf2994fb55a26 (commit)
       via  07620d6f7d06dd9d6bb8ae3026c8be7a091f6e4e (commit)
      from  5ecf7341e21506ff1ba75946736e537a1ab97e1e (commit)

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


- Log -----------------------------------------------------------------
commit 86f6bda454b0da811ae5287cc7daf2994fb55a26
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Mar 7 15:09:16 2011 +1100

    new version 1.0.112-42

commit 07620d6f7d06dd9d6bb8ae3026c8be7a091f6e4e
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Mar 7 15:05:09 2011 +1100

    CTDB_FATAL() try to drop all ip addresses when shutting down through ctdb_fatal()
    
    If we shutdown through a ctdb_fatal(), unless there is an external mechanism to trap this and restart ctdb, we will get a duplicate address problem since addresses held on the node remain which collides with the addresses when failed over to other nodes.
    
    During ctdb_fatal(), spawn a child process to try to drop all held public addresses.

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

Summary of changes:
 common/ctdb_util.c         |    3 +++
 include/ctdb_private.h     |    5 +++++
 packaging/RPM/ctdb.spec.in |    5 ++++-
 server/ctdb_daemon.c       |    5 +++++
 server/ctdb_recover.c      |   11 +++++++++++
 5 files changed, 28 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_util.c b/common/ctdb_util.c
index 835bbfd..50a8a0d 100644
--- a/common/ctdb_util.c
+++ b/common/ctdb_util.c
@@ -57,6 +57,9 @@ void ctdb_set_error(struct ctdb_context *ctdb, const char *fmt, ...)
 void ctdb_fatal(struct ctdb_context *ctdb, const char *msg)
 {
 	DEBUG(DEBUG_ALERT,("ctdb fatal error: %s\n", msg));
+	if (ctdb->emergency_shutdown != NULL) {
+		ctdb->emergency_shutdown(ctdb);
+	}
 	abort();
 }
 
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 41a761a..38aab19 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -474,6 +474,9 @@ struct ctdb_context {
 
 	/* used in the recovery daemon to remember the ip allocation */
 	struct trbt_tree *ip_tree;
+
+	/* emergency shutdown cleanup */
+	void (*emergency_shutdown)(struct ctdb_context *);
 };
 
 struct ctdb_db_context {
@@ -1576,4 +1579,6 @@ int verify_remote_ip_allocation(struct ctdb_context *ctdb,
 int update_ip_assignment_tree(struct ctdb_context *ctdb,
 				struct ctdb_public_ip *ip);
 
+void ctdb_emergency_shutdown(struct ctdb_context *ctdb);
+
 #endif
diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index d0cf351..915c271 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -5,7 +5,7 @@ Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
 Name: ctdb
 Version: 1.0.112
-Release: 41
+Release: 42
 Epoch: 0
 License: GNU GPL version 3
 Group: System Environment/Daemons
@@ -125,6 +125,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_docdir}/ctdb/tests/bin/ctdb_transaction
 
 %changelog
+* Mon Mar 7 2011 : Version 1.0.112-42
+ - ctdb_fatal() drop all public ips or else we will get a duplicate ip ont he thetwork. CS S1022203
+ - Vacuuming, fix a bug where we would get unvacuumable records when some nodes are permanently disconnected. This leak of unvacuumable records eventually leads to ctdb shutting down. CQ S1022203
 * Fri Mar 4 2011 : Version 1.0.112-41
  - Try to restart the recovery dameon if it has hung
 * Tue Mar 1 2011 : Version 1.0.112-40
diff --git a/server/ctdb_daemon.c b/server/ctdb_daemon.c
index 4c35b1c..8e5fcbf 100644
--- a/server/ctdb_daemon.c
+++ b/server/ctdb_daemon.c
@@ -63,6 +63,11 @@ static void ctdb_start_transport(struct ctdb_context *ctdb)
 		exit(11);
 	}
 
+	/* set up a function so we try to clean up during emergency shutdown such as ctdb_fatal()
+	   at the very least we should drop all ips at this stage
+	*/
+	ctdb->emergency_shutdown = ctdb_emergency_shutdown;
+
 	/* Make sure we log something when the daemon terminates */
 	atexit(print_exit_message);
 
diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index 4435ab3..c3c514d 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -1262,3 +1262,14 @@ int32_t ctdb_control_continue_node(struct ctdb_context *ctdb)
 
 	return 0;
 }
+
+void ctdb_emergency_shutdown(struct ctdb_context *ctdb)
+{
+	DEBUG(DEBUG_ERR,("CTDB_FATAL create child process to release all held ips\n"));
+	if (fork() == 0) {
+		DEBUG(DEBUG_ERR,("CTDB_FATAL drop all ip\n"));
+		ctdb_release_all_ips(ctdb);
+		DEBUG(DEBUG_ERR,("CTDB_FATAL all ips dropped\n"));
+		_exit(0);
+	}
+}


-- 
CTDB repository


More information about the samba-cvs mailing list