[SCM] CTDB repository - branch master updated - ctdb-1.0.62-6-g59a8796

Ronnie Sahlberg sahlberg at samba.org
Sun Oct 19 23:23:36 GMT 2008


The branch, master has been updated
       via  59a879626a6a55fb6a43cadf5338c1aa6afe96d1 (commit)
       via  e25ea88ea4f270ba65ed5fdacd693f1248f343c0 (commit)
       via  4b0f32047e8bece0a052bdbe2209afe91b7e8ce3 (commit)
       via  82fd2b6b5cd8e988c38fa6b74121a048757bdeef (commit)
      from  06097b88709ced09d1f9f869eed9a54e6d2fedbf (commit)

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


- Log -----------------------------------------------------------------
commit 59a879626a6a55fb6a43cadf5338c1aa6afe96d1
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Oct 20 09:47:54 2008 +1100

    new version 1.0.63

commit e25ea88ea4f270ba65ed5fdacd693f1248f343c0
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Oct 20 09:45:15 2008 +1100

    dont log "running periodic cleanup" ...

commit 4b0f32047e8bece0a052bdbe2209afe91b7e8ce3
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Oct 17 21:38:42 2008 +1100

    null out the pointer before we reload the nodes file

commit 82fd2b6b5cd8e988c38fa6b74121a048757bdeef
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Oct 17 21:18:06 2008 +1100

    when we reload the nodes file,   we may need to reload the nodes file
    inside the recovery daemon as well.

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

Summary of changes:
 config/events.d/50.samba |    2 +-
 packaging/RPM/ctdb.spec  |    7 ++++++-
 server/ctdb_recoverd.c   |   26 ++++++++++++++++++++++++--
 3 files changed, 31 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/50.samba b/config/events.d/50.samba
index 498aa17..9ec5f1c 100755
--- a/config/events.d/50.samba
+++ b/config/events.d/50.samba
@@ -108,7 +108,7 @@ check_ctdb_manages_winbind() {
 periodic_cleanup() {
     # running smbstatus scrubs any dead entries from the connections
     # and sessionid database
-    echo "Running periodic cleanup of samba databases"
+    # echo "Running periodic cleanup of samba databases"
     smbstatus -n > /dev/null 2>&1 &
 }
 
diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index 0bc381f..a052910 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -5,7 +5,7 @@ Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
 Name: ctdb
 Version: 1.0
-Release: 62
+Release: 63
 Epoch: 0
 License: GNU GPL version 3
 Group: System Environment/Daemons
@@ -120,6 +120,11 @@ fi
 %{_includedir}/ctdb_private.h
 
 %changelog
+* Mon Oct 20 2008 : Version 1.0.63
+ - Remove logging of "periodic cleanup ..." in 50.samba
+ - When we reload a nodes file, we must detect this and reload the file also
+   in the recovery daemon before we try to dereference somethoung beyond the end
+   of the nodes array.
 * Thu Oct 16 2008 : Version 1.0.62
  - Allow multiple eventscritps using the same prefix number.
    It is undefined which order scripts with the same prefix will execute in.
diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index b17f989..350897a 100644
--- a/server/ctdb_recoverd.c
+++ b/server/ctdb_recoverd.c
@@ -291,7 +291,9 @@ static void async_getcap_callback(struct ctdb_context *ctdb, uint32_t node_pnn,
 		DEBUG(DEBUG_ERR, (__location__ " Invalid lenght/pointer for getcap callback : %u %p\n",  (unsigned)outdata.dsize, outdata.dptr));
 		return;
 	}
-	ctdb->nodes[node_pnn]->capabilities = *((uint32_t *)outdata.dptr);
+	if (node_pnn < ctdb->num_nodes) {
+		ctdb->nodes[node_pnn]->capabilities = *((uint32_t *)outdata.dptr);
+	}
 }
 
 /*
@@ -1310,7 +1312,16 @@ static int recover_database(struct ctdb_recoverd *rec,
 	return 0;
 }
 
-		
+/*
+  reload the nodes file 
+*/
+static void reload_nodes_file(struct ctdb_context *ctdb)
+{
+	ctdb->nodes = NULL;
+	ctdb_load_nodes_file(ctdb);
+}
+
+	
 /*
   we are the recmaster, and recovery is needed - start a recovery run
  */
@@ -1328,6 +1339,12 @@ static int do_recovery(struct ctdb_recoverd *rec,
 
 	DEBUG(DEBUG_NOTICE, (__location__ " Starting do_recovery\n"));
 
+	if (ctdb->num_nodes != nodemap->num) {
+		DEBUG(DEBUG_ERR, (__location__ " ctdb->num_nodes (%d) != nodemap->num (%d) reloading nodes file\n", ctdb->num_nodes, nodemap->num));
+		reload_nodes_file(ctdb);
+		return -1;
+	}
+
 	/* if recovery fails, force it again */
 	rec->need_recovery = true;
 
@@ -2527,6 +2544,11 @@ again:
 	/* update the list of public ips that a node can handle for
 	   all connected nodes
 	*/
+	if (ctdb->num_nodes != nodemap->num) {
+		DEBUG(DEBUG_ERR, (__location__ " ctdb->num_nodes (%d) != nodemap->num (%d) reloading nodes file\n", ctdb->num_nodes, nodemap->num));
+		reload_nodes_file(ctdb);
+		goto again;
+	}
 	for (j=0; j<nodemap->num; j++) {
 		if (nodemap->nodes[j].flags & NODE_FLAGS_INACTIVE) {
 			continue;


-- 
CTDB repository


More information about the samba-cvs mailing list