[SCM] CTDB repository - branch master updated - ctdb-1.10-5-g8275d26

Ronnie Sahlberg sahlberg at samba.org
Wed Oct 27 20:48:10 MDT 2010


The branch, master has been updated
       via  8275d265d2ae19b765e30ecf18f6b6319b6e6453 (commit)
       via  cd84da6f247ee46bbab8318298d1cd3cfc87aba9 (commit)
       via  5792809b72e534161c5ca9ef5c9897abcb3b899c (commit)
       via  dc57df549854e329b453ef14cff5cd352632ef73 (commit)
       via  e0eda175ac979828b376e8a6779b4608af52eb32 (commit)
      from  401ad5bb3c4d2f34e34c4b61649c77391ac2f791 (commit)

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


- Log -----------------------------------------------------------------
commit 8275d265d2ae19b765e30ecf18f6b6319b6e6453
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Oct 28 13:38:34 2010 +1100

    during shutdown there is a window after we have stopped TCP and disconnected from all other nodes but before we have stopped all processing.
    
    During this window we may still hit asynchronous events that will fail because we can not send/receive packets from other nodes.
    
    These messages are logged as ... Transport is DOWN. To help indicate that they are benign messages related to the process of shutting down.
    
    These messages spam the syslog during normal shutdown, so this patch will drop the loglevel of these messages to DEBUG, so that they will not appear in or spam the syslog.

commit cd84da6f247ee46bbab8318298d1cd3cfc87aba9
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Oct 28 13:36:24 2010 +1100

    When shuttind down, we always unconditionally try to remove the natgw address
    even if we are not currently the natgw master.
    This adds extra reliability in case we have stopped previously without removing it proper,
    but does add spam messages to syslog everytime we shutdowm.
    
    Remove these spam messages from pulluting the syslog upon normal shutdown

commit 5792809b72e534161c5ca9ef5c9897abcb3b899c
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Oct 28 13:34:33 2010 +1100

    Redirect the output from 00.ctdb pfetch to stdout.
    Normally, the config.tdb database would not exist, so we do not need
    to spam syslog with a "config.tdb does not exist" message every time we start ctdb

commit dc57df549854e329b453ef14cff5cd352632ef73
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Oct 28 13:32:29 2010 +1100

    Drop the loglevel of the "reqid wrap" developer debug message to DEBUG
    so that we dont spam the logs with this normal benign message.

commit e0eda175ac979828b376e8a6779b4608af52eb32
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Oct 25 11:31:12 2010 +1100

    Add support to create TDB databases using the new jenkins hash.
    
    SRVID for the control to attach to a database is used to pass
    tdb flags from samba to ctdb when samba attached to a database.
    This has been used earlier for TDB_NOSYNC flag.
    
    Add TDB_INCOMPATIBLE_HASH as a supported tdb flag to store in the
    SRVID field when attaching to a database.
    
    This allows samba to control if ctdb should create databases using the
    new jenkins hash, or using the old hash.
    This only affects new databases when they are initially created.
    Existing databases remain using the old hash when attached to.

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

Summary of changes:
 common/ctdb_util.c        |    2 +-
 config/events.d/00.ctdb   |    2 +-
 config/events.d/11.natgw  |    2 +-
 server/ctdb_call.c        |    8 ++++----
 server/ctdb_control.c     |    2 +-
 server/ctdb_daemon.c      |    4 ++--
 server/ctdb_ltdb_server.c |   14 +++++++++-----
 7 files changed, 19 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_util.c b/common/ctdb_util.c
index 4acfa3f..3e01173 100644
--- a/common/ctdb_util.c
+++ b/common/ctdb_util.c
@@ -127,7 +127,7 @@ uint32_t ctdb_reqid_new(struct ctdb_context *ctdb, void *state)
 {
 	int id = idr_get_new_above(ctdb->idr, state, ctdb->lastid+1, INT_MAX);
 	if (id < 0) {
-		DEBUG(DEBUG_NOTICE, ("Reqid wrap!\n"));
+		DEBUG(DEBUG_DEBUG, ("Reqid wrap!\n"));
 		id = idr_get_new(ctdb->idr, state, INT_MAX);
 	}
 	ctdb->lastid = id;
diff --git a/config/events.d/00.ctdb b/config/events.d/00.ctdb
index 1389ae4..61f2031 100755
--- a/config/events.d/00.ctdb
+++ b/config/events.d/00.ctdb
@@ -16,7 +16,7 @@ update_config_from_tdb() {
 	# Pull optional ctdb configuration data out of config.tdb
 	PUBLICADDRESSESKEY='public-addresses:node#'`ctdb -t 1 xpnn|sed -e "s/.*://"`
 	rm -f $CTDB_VARDIR/state/public_addresses
-	ctdb pfetch config.tdb $PUBLICADDRESSESKEY $CTDB_VARDIR/state/public_addresses
+	ctdb pfetch config.tdb $PUBLICADDRESSESKEY $CTDB_VARDIR/state/public_addresses 2>/dev/null
 	[ "$?" = "0" ] && [ `stat --format="%s" /etc/ctdb/state/public_addresses` != "0" ] && [ ! -z "$CTDB_PUBLIC_ADDRESSES" ] && {
 		diff $CTDB_VARDIR/state/public_addresses $CTDB_PUBLIC_ADDRESSES >/dev/null 2>/dev/null
 		[ $? = "0" ] || {
diff --git a/config/events.d/11.natgw b/config/events.d/11.natgw
index 34aee19..512f8de 100755
--- a/config/events.d/11.natgw
+++ b/config/events.d/11.natgw
@@ -22,7 +22,7 @@ delete_all() {
 	local _maskbits=`echo $CTDB_NATGW_PUBLIC_IP | cut -d '/' -f2`
 
 	[ -z "$CTDB_NATGW_PUBLIC_IFACE" ] || {
-	    delete_ip_from_iface $CTDB_NATGW_PUBLIC_IFACE $_ip $_maskbits
+	    delete_ip_from_iface $CTDB_NATGW_PUBLIC_IFACE $_ip $_maskbits 2>/dev/null
 	}
 	delete_ip_from_iface lo $_ip 32
 
diff --git a/server/ctdb_call.c b/server/ctdb_call.c
index 0bb7902..c5f7e7d 100644
--- a/server/ctdb_call.c
+++ b/server/ctdb_call.c
@@ -70,7 +70,7 @@ static void ctdb_send_error(struct ctdb_context *ctdb,
 	int msglen, len;
 
 	if (ctdb->methods == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Failed to send error. Transport is DOWN\n"));
+		DEBUG(DEBUG_INFO,(__location__ " Failed to send error. Transport is DOWN\n"));
 		return;
 	}
 
@@ -413,7 +413,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
 	struct ctdb_db_context *ctdb_db;
 
 	if (ctdb->methods == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Failed ctdb_request_call. Transport is DOWN\n"));
+		DEBUG(DEBUG_INFO,(__location__ " Failed ctdb_request_call. Transport is DOWN\n"));
 		return;
 	}
 
@@ -730,7 +730,7 @@ struct ctdb_call_state *ctdb_daemon_call_send_remote(struct ctdb_db_context *ctd
 	struct ctdb_context *ctdb = ctdb_db->ctdb;
 
 	if (ctdb->methods == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Failed send packet. Transport is down\n"));
+		DEBUG(DEBUG_INFO,(__location__ " Failed send packet. Transport is down\n"));
 		return NULL;
 	}
 
@@ -814,7 +814,7 @@ void ctdb_send_keepalive(struct ctdb_context *ctdb, uint32_t destnode)
 	struct ctdb_req_keepalive *r;
 	
 	if (ctdb->methods == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Failed to send keepalive. Transport is DOWN\n"));
+		DEBUG(DEBUG_INFO,(__location__ " Failed to send keepalive. Transport is DOWN\n"));
 		return;
 	}
 
diff --git a/server/ctdb_control.c b/server/ctdb_control.c
index 3356ba1..90900c9 100644
--- a/server/ctdb_control.c
+++ b/server/ctdb_control.c
@@ -750,7 +750,7 @@ int ctdb_daemon_send_control(struct ctdb_context *ctdb, uint32_t destnode,
 	size_t len;
 
 	if (ctdb->methods == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Failed to send control. Transport is DOWN\n"));
+		DEBUG(DEBUG_INFO,(__location__ " Failed to send control. Transport is DOWN\n"));
 		return -1;
 	}
 
diff --git a/server/ctdb_daemon.c b/server/ctdb_daemon.c
index 12ad954..5eca727 100644
--- a/server/ctdb_daemon.c
+++ b/server/ctdb_daemon.c
@@ -874,7 +874,7 @@ struct ctdb_req_header *_ctdb_transport_allocate(struct ctdb_context *ctdb,
 	size = (length+(CTDB_DS_ALIGNMENT-1)) & ~(CTDB_DS_ALIGNMENT-1);
 
 	if (ctdb->methods == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Unable to allocate transport packet for operation %u of length %u. Transport is DOWN.\n",
+		DEBUG(DEBUG_INFO,(__location__ " Unable to allocate transport packet for operation %u of length %u. Transport is DOWN.\n",
 			 operation, (unsigned)length));
 		return NULL;
 	}
@@ -1099,7 +1099,7 @@ int ctdb_daemon_send_message(struct ctdb_context *ctdb, uint32_t pnn,
 	int len;
 
 	if (ctdb->methods == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Failed to send message. Transport is DOWN\n"));
+		DEBUG(DEBUG_INFO,(__location__ " Failed to send message. Transport is DOWN\n"));
 		return -1;
 	}
 
diff --git a/server/ctdb_ltdb_server.c b/server/ctdb_ltdb_server.c
index b1a032f..ba2a9cb 100644
--- a/server/ctdb_ltdb_server.c
+++ b/server/ctdb_ltdb_server.c
@@ -513,7 +513,8 @@ int32_t ctdb_control_db_get_health(struct ctdb_context *ctdb,
   return 0 on success, -1 on failure
  */
 static int ctdb_local_attach(struct ctdb_context *ctdb, const char *db_name,
-			     bool persistent, const char *unhealthy_reason)
+			     bool persistent, const char *unhealthy_reason,
+			     bool jenkinshash)
 {
 	struct ctdb_db_context *ctdb_db, *tmp_db;
 	int ret;
@@ -596,6 +597,9 @@ static int ctdb_local_attach(struct ctdb_context *ctdb, const char *db_name,
 		tdb_flags |= TDB_NOMMAP;
 	}
 	tdb_flags |= TDB_DISALLOW_NESTING;
+	if (jenkinshash) {
+		tdb_flags |= TDB_INCOMPATIBLE_HASH;
+	}
 
 again:
 	ctdb_db->ltdb = tdb_wrap_open(ctdb, ctdb_db->db_path, 
@@ -756,7 +760,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
 	   only allow a subset of those on the database in ctdb. Note
 	   that tdb_flags is passed in via the (otherwise unused)
 	   srvid to the attach control */
-	tdb_flags &= TDB_NOSYNC;
+	tdb_flags &= (TDB_NOSYNC|TDB_INCOMPATIBLE_HASH);
 
 	/* If the node is inactive it is not part of the cluster
 	   and we should not allow clients to attach to any
@@ -777,7 +781,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
 		return 0;
 	}
 
-	if (ctdb_local_attach(ctdb, db_name, persistent, NULL) != 0) {
+	if (ctdb_local_attach(ctdb, db_name, persistent, NULL, (tdb_flags&TDB_INCOMPATIBLE_HASH)?true:false) != 0) {
 		return -1;
 	}
 
@@ -797,7 +801,7 @@ int32_t ctdb_control_db_attach(struct ctdb_context *ctdb, TDB_DATA indata,
 	ctdb_lockdown_memory(ctdb);
 
 	/* tell all the other nodes about this database */
-	ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_ALL, 0,
+	ctdb_daemon_send_control(ctdb, CTDB_BROADCAST_ALL, tdb_flags,
 				 persistent?CTDB_CONTROL_DB_ATTACH_PERSISTENT:
 						CTDB_CONTROL_DB_ATTACH,
 				 0, CTDB_CTRL_FLAG_NOREPLY,
@@ -853,7 +857,7 @@ static int ctdb_attach_persistent(struct ctdb_context *ctdb,
 		}
 		p[4] = 0;
 
-		if (ctdb_local_attach(ctdb, s, true, unhealthy_reason) != 0) {
+		if (ctdb_local_attach(ctdb, s, true, unhealthy_reason, 0) != 0) {
 			DEBUG(DEBUG_ERR,("Failed to attach to persistent database '%s'\n", de->d_name));
 			closedir(d);
 			talloc_free(s);


-- 
CTDB repository


More information about the samba-cvs mailing list