[SCM] CTDB repository - branch master updated - ctdb-1.0.98-5-gf76d6fe

Ronnie Sahlberg sahlberg at samba.org
Tue Oct 20 22:17:37 MDT 2009


The branch, master has been updated
       via  f76d6fed8f9630450263b9fa4b5fdf3493fb1e11 (commit)
       via  ead97cabeb1e0b73bff9d45f8aec8b226769ee9f (commit)
       via  0a4d409baabf242a87c06293789d589c896b104c (commit)
       via  1a09b02767f3928d3c5db0e0afc59bb938e4a445 (commit)
       via  3997d7e5471810e9a2f145ce2e795073dfc5eded (commit)
      from  02862c086d045497f49f3c060700419815d607e7 (commit)

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


- Log -----------------------------------------------------------------
commit f76d6fed8f9630450263b9fa4b5fdf3493fb1e11
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Oct 21 15:20:55 2009 +1100

        When clients have blocked, perhaps because the node is banned or stopped and the client is blocked trying to tdb_fetch() a record, make sure we dont queue up too many REQ_MESSAGES.
    
        Add a new tunable to control the maximum queue size we allow to a blocked client before we start discarding REQ_MESSAGES instead of queueing them for delivery.
    
        This avoids having queued up very very large number of MESSAGES that samba semds
         between eachother to nodes that are blocked/banned/stopped for extended periods
        .

commit ead97cabeb1e0b73bff9d45f8aec8b226769ee9f
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Oct 21 13:54:02 2009 +1100

    dont restart ctdb when installing the rpm

commit 0a4d409baabf242a87c06293789d589c896b104c
Author: Michael Adam <obnox at samba.org>
Date:   Tue Oct 20 16:57:23 2009 +0200

    In ctdb_ltdb_store(), add a missing transaction_cancel when local store failed.
    
    Spotted by Volker.
    
    Michael

commit 1a09b02767f3928d3c5db0e0afc59bb938e4a445
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Oct 21 11:51:30 2009 +1100

    mprove the log message when we skip the ip allocation check from the recovery daemon.
    
    we also skip this check if we are already in the process of performing an ip reallocation and not only when we are performing a full recovery.

commit 3997d7e5471810e9a2f145ce2e795073dfc5eded
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed Oct 21 11:34:17 2009 +1100

    treat interfaces with the name ethX* as bond devices

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

Summary of changes:
 common/ctdb_io.c             |   10 ++++++++++
 config/events.d/10.interface |    2 +-
 include/ctdb_private.h       |    2 ++
 packaging/RPM/ctdb.spec      |    5 -----
 server/ctdb_daemon.c         |    6 ++++++
 server/ctdb_persistent.c     |    2 +-
 server/ctdb_recoverd.c       |    2 +-
 server/ctdb_tunables.c       |    3 ++-
 8 files changed, 23 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_io.c b/common/ctdb_io.c
index 3377aa1..ea7c17d 100644
--- a/common/ctdb_io.c
+++ b/common/ctdb_io.c
@@ -55,6 +55,16 @@ struct ctdb_queue {
 
 
 
+int ctdb_queue_length(struct ctdb_queue *queue)
+{
+	int i;
+	struct ctdb_queue_pkt *pkt;
+
+	for(i=0, pkt=queue->out_queue;pkt;i++,pkt=pkt->next);
+
+	return i;
+}
+
 /*
   called when an incoming connection is readable
 */
diff --git a/config/events.d/10.interface b/config/events.d/10.interface
index 0871750..61f7148 100755
--- a/config/events.d/10.interface
+++ b/config/events.d/10.interface
@@ -145,7 +145,7 @@ case $cmd in
 
 	for IFACE in $INTERFACES ; do
 	    case $IFACE in 
-	    bond*)
+	    ethX*|bond*)
 		IFACE=`echo $IFACE |sed -e 's/\....$//'`
 		grep -q '^MII Status: up' /proc/net/bonding/$IFACE || {
 			echo "ERROR: public network interface $IFACE is down"
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 35430fc..2f4937e 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -123,6 +123,7 @@ struct ctdb_tunable {
 	uint32_t vacuum_limit;
 	uint32_t vacuum_min_interval;
 	uint32_t vacuum_max_interval;
+	uint32_t max_queue_depth_drop_msg;
 };
 
 /*
@@ -936,6 +937,7 @@ struct ctdb_req_header *_ctdb_transport_allocate(struct ctdb_context *ctdb,
 #define ctdb_transport_allocate(ctdb, mem_ctx, operation, length, type) \
 	(type *)_ctdb_transport_allocate(ctdb, mem_ctx, operation, length, sizeof(type), #type)
 
+int ctdb_queue_length(struct ctdb_queue *queue);
 
 /*
   lock a record in the ltdb, given a key
diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index 85864eb..536e7cf 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -83,11 +83,6 @@ if [ $1 = 0 ] ; then
 fi
 exit 0
 
-%postun
-if [ "$1" -ge "1" ]; then
-	%{initdir}/ctdb restart >/dev/null 2>&1 || true
-fi	
-
 
 #######################################################################
 ## Files section                                                     ##
diff --git a/server/ctdb_daemon.c b/server/ctdb_daemon.c
index cc496f5..f7ca28f 100644
--- a/server/ctdb_daemon.c
+++ b/server/ctdb_daemon.c
@@ -93,6 +93,12 @@ static void block_signal(int signum)
 static int daemon_queue_send(struct ctdb_client *client, struct ctdb_req_header *hdr)
 {
 	client->ctdb->statistics.client_packets_sent++;
+	if (hdr->operation == CTDB_REQ_MESSAGE) {
+		if (ctdb_queue_length(client->queue) > client->ctdb->tunable.max_queue_depth_drop_msg) {
+			DEBUG(DEBUG_ERR,("Drop CTDB_REQ_MESSAGE to client. Queue full.\n"));
+			return 0;
+		}
+	}
 	return ctdb_queue_send(client->queue, (uint8_t *)hdr, hdr->length);
 }
 
diff --git a/server/ctdb_persistent.c b/server/ctdb_persistent.c
index 77538d9..cb77bf0 100644
--- a/server/ctdb_persistent.c
+++ b/server/ctdb_persistent.c
@@ -291,7 +291,7 @@ static int ctdb_persistent_store(struct ctdb_persistent_write_state *state)
 		if (ret != 0) {
 			DEBUG(DEBUG_CRIT,("Failed to store record for db_id 0x%08x in ctdb_persistent_store\n", 
 					  state->ctdb_db->db_id));
-			return -1;
+			goto failed;
 		}
 	}
 
diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index 83fc808..e301baa 100644
--- a/server/ctdb_recoverd.c
+++ b/server/ctdb_recoverd.c
@@ -2294,7 +2294,7 @@ static int verify_ip_allocation(struct ctdb_context *ctdb, uint32_t pnn)
 	/* skip the check if we have started but not finished recovery */
 	if (timeval_compare(&uptime1->last_recovery_finished,
 			    &uptime1->last_recovery_started) != 1) {
-		DEBUG(DEBUG_NOTICE, (__location__ " in the middle of recovery. skipping public ip address check\n"));
+		DEBUG(DEBUG_NOTICE, (__location__ " in the middle of recovery or ip reallocation. skipping public ip address check\n"));
 		talloc_free(mem_ctx);
 
 		return 0;
diff --git a/server/ctdb_tunables.c b/server/ctdb_tunables.c
index 90918c8..c461bca 100644
--- a/server/ctdb_tunables.c
+++ b/server/ctdb_tunables.c
@@ -62,7 +62,8 @@ static const struct {
 	{ "RepackLimit",      10000,  offsetof(struct ctdb_tunable, repack_limit) },
 	{ "VacuumLimit",       5000,  offsetof(struct ctdb_tunable, vacuum_limit) },
 	{ "VacuumMinInterval",   60,  offsetof(struct ctdb_tunable, vacuum_min_interval) },
-	{ "VacuumMaxInterval",  600,  offsetof(struct ctdb_tunable, vacuum_max_interval) }
+	{ "VacuumMaxInterval",  600,  offsetof(struct ctdb_tunable, vacuum_max_interval) },
+	{ "MaxQueueDropMsg",  1000,  offsetof(struct ctdb_tunable, max_queue_depth_drop_msg) }
 };
 
 /*


-- 
CTDB repository


More information about the samba-cvs mailing list