[SCM] CTDB repository - branch master updated - ctdb-1.0.113-99-g2263cd7

Ronnie Sahlberg sahlberg at samba.org
Mon Feb 15 17:03:36 MST 2010


The branch, master has been updated
       via  2263cd74d511247debadd0f6602bc6396b46ac5e (commit)
       via  9ed2f8b2fcb7e3f0d795eef22cfa317066490709 (commit)
       via  f8994790e65baebb81bbfad646cdda6234b6d29a (commit)
       via  6ce4b21b00cce1530aff022584bf695c257a5d55 (commit)
       via  a3473e7a445b14520a49585c460429dfbfe1fce0 (commit)
       via  db87849bf3380914a63a626412bec209dbea7d20 (commit)
       via  cfc1a4f878b61c85063af649d2339431e799647d (commit)
       via  b0bf3794753c5bb898295b5109707953cc3dcec5 (commit)
       via  88aacab30a36d66fe03d120bbf655edfe791ec32 (commit)
      from  06ae8630dfe297e0d7ebcdbb43969170f3d06e20 (commit)

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


- Log -----------------------------------------------------------------
commit 2263cd74d511247debadd0f6602bc6396b46ac5e
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Feb 12 13:19:57 2010 +1100

    try to restart rpc-rquotad if it is not running
    
    bz60317

commit 9ed2f8b2fcb7e3f0d795eef22cfa317066490709
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Fri Feb 12 17:02:56 2010 +1030

    Leave sequence number alone when merely migrating records.
    
    (Based on earlier version from Ronnie which modified tdb; this one
    is standalone).
    
    When storing records in a tdb that has "automatic seqnum updates"
    also check if the actual data for the record has changed or not.
    
    If it has not changed at all, except for possibly the header,
    this is likely just a dmaster migration operation in which case
    we want to write the record to the tdb but we do not want the tdb
    sequence number to be increased.
    
    This resolves the problem of notify.tdb being thrashed under load:
    the heuristic in smbd to only reread this when the sequence number
    increases (rarely) breaks down.
    
    Before, running nbench --num-progs=512 across 4 nodes, we saw numbers like:
     512      1496  118.33 MB/sec  execute 60 sec  latency 0.00 msec
    And turning on latency tracking, this was typical in the logs:
     ctdbd: High latency 9380914.000000s for operation lockwait on database notify.tdb
    
    After this commit:
      512      2451  143.85 MB/sec  execute 60 sec  latency 0.00 msec
    And no more latency messages...
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit f8994790e65baebb81bbfad646cdda6234b6d29a
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Feb 11 12:00:43 2010 +1100

    Reduce loglevel for two eventscript related debug messages

commit 6ce4b21b00cce1530aff022584bf695c257a5d55
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Feb 11 11:54:46 2010 +1100

    Reducing the log level for a debug message
    
                  DEBUG(DEBUG_DEBUG,("pnn %u starting migration of %08x t\

commit a3473e7a445b14520a49585c460429dfbfe1fce0
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Feb 11 11:49:48 2010 +1100

    Reduce the log level for two debug messages
    
           DEBUG(DEBUG_DEBUG,("pnn %u dmaster response %08x\n", ctdb->pnn, ctdb_has
           DEBUG(DEBUG_DEBUG,("pnn %u dmaster request on %08x for %u from %u\n",

commit db87849bf3380914a63a626412bec209dbea7d20
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Feb 11 11:32:22 2010 +1100

    Add a variable CTDB_CHECK_SWAP_IS_NOT_USED="yes"
    to control whether or not to check if we are swapping, and produce
    useful output into the logfile if we are.
    
    For production systems with dedicated nas-heads we should never swap.
    But for developer/test systems we often use smaller nondedicated systems where
    we can no longer guarantee that we will not be using swap.

commit cfc1a4f878b61c85063af649d2339431e799647d
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Feb 11 11:19:08 2010 +1100

    lower the loglevel for a debug message for redundant releases of public ips

commit b0bf3794753c5bb898295b5109707953cc3dcec5
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Feb 11 11:09:39 2010 +1100

    Add a new variable : CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK
    when set to "yes" this will skip checking if knfsd has hung or not.
    
    bz59626

commit 88aacab30a36d66fe03d120bbf655edfe791ec32
Author: Andrew Tridgell <tridge at samba.org>
Date:   Fri Feb 5 17:11:29 2010 +1100

    fixed printing of high latency

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

Summary of changes:
 common/ctdb_ltdb.c      |   19 +++++++++++++++++++
 common/ctdb_util.c      |    2 +-
 config/events.d/00.ctdb |   12 +++++++-----
 config/events.d/60.nfs  |   14 +++++++++++++-
 server/ctdb_call.c      |    6 +++---
 server/ctdb_takeover.c  |    2 +-
 server/eventscript.c    |    4 ++--
 7 files changed, 46 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_ltdb.c b/common/ctdb_ltdb.c
index 12fcf52..b2fd189 100644
--- a/common/ctdb_ltdb.c
+++ b/common/ctdb_ltdb.c
@@ -128,6 +128,7 @@ int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key,
 	struct ctdb_context *ctdb = ctdb_db->ctdb;
 	TDB_DATA rec;
 	int ret;
+	bool seqnum_suppressed = false;
 
 	if (ctdb->flags & CTDB_FLAG_TORTURE) {
 		struct ctdb_ltdb_header *h2;
@@ -147,10 +148,28 @@ int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key,
 	memcpy(rec.dptr, header, sizeof(*header));
 	memcpy(rec.dptr + sizeof(*header), data.dptr, data.dsize);
 
+	/* Databases with seqnum updates enabled only get their seqnum
+	   changes when/if we modify the data */
+	if (ctdb_db->seqnum_update != NULL) {
+		TDB_DATA old;
+		old = tdb_fetch(ctdb_db->ltdb->tdb, key);
+
+		if ( (old.dsize == rec.dsize)
+		&& !memcmp(old.dptr+sizeof(struct ctdb_ltdb_header),
+			  rec.dptr+sizeof(struct ctdb_ltdb_header),
+			  rec.dsize-sizeof(struct ctdb_ltdb_header)) ) {
+			tdb_remove_flags(ctdb_db->ltdb->tdb, TDB_SEQNUM);
+			seqnum_suppressed = true;
+		}
+		if (old.dptr) free(old.dptr);
+	}
 	ret = tdb_store(ctdb_db->ltdb->tdb, key, rec, TDB_REPLACE);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR, (__location__ " Failed to store dynamic data\n"));
 	}
+	if (seqnum_suppressed) {
+		tdb_add_flags(ctdb_db->ltdb->tdb, TDB_SEQNUM);
+	}
 
 	talloc_free(rec.dptr);
 
diff --git a/common/ctdb_util.c b/common/ctdb_util.c
index 5b31418..7fa5743 100644
--- a/common/ctdb_util.c
+++ b/common/ctdb_util.c
@@ -136,7 +136,7 @@ void ctdb_latency(struct ctdb_db_context *ctdb_db, const char *name, double *lat
 
 	if (ctdb_db->ctdb->tunable.log_latency_ms !=0) {
 		if (l*1000 > ctdb_db->ctdb->tunable.log_latency_ms) {
-			DEBUG(DEBUG_WARNING, ("High latency %fs for operation %s on database %s\n", l*1000000, name, ctdb_db->db_name));
+			DEBUG(DEBUG_WARNING, ("High latency %.6fs for operation %s on database %s\n", l, name, ctdb_db->db_name));
 		}
 	}
 }
diff --git a/config/events.d/00.ctdb b/config/events.d/00.ctdb
index ed8f9f2..03310b7 100755
--- a/config/events.d/00.ctdb
+++ b/config/events.d/00.ctdb
@@ -30,11 +30,13 @@ case "$1" in
 
     monitor)
 	# We should never enter swap, so SwapTotal == SwapFree.
-	if [ -n "`grep '^Swap\(Total\|Free\)' /proc/meminfo | uniq -s 10 -u`" ]; then
-	    echo We are swapping:
-	    cat /proc/meminfo
-	    ps auxfww
-	fi
+	[ "$CTDB_CHECK_SWAP_IS_NOT_USED" = "yes" ] && {
+	    if [ -n "`grep '^Swap\(Total\|Free\)' /proc/meminfo | uniq -s 10 -u`" ]; then
+		echo We are swapping:
+		cat /proc/meminfo
+		ps auxfww
+	    fi
+	}
 
 	# monitor that we are not running out of memory
 	[ -z "$CTDB_MONITOR_FREE_MEMORY" ] || {
diff --git a/config/events.d/60.nfs b/config/events.d/60.nfs
index 4d5494a..2115d46 100755
--- a/config/events.d/60.nfs
+++ b/config/events.d/60.nfs
@@ -77,7 +77,9 @@ case "$1" in
 
 
 	# check that NFS responds to rpc requests
-	ctdb_check_rpc "NFS" 100003 3
+	[ "$CTDB_NFS_SKIP_KNFSD_ALIVE_CHECK" = "yes" ] || {
+	    ctdb_check_rpc "NFS" 100003 3
+	}
 
 	# and that its directories are available
 	[ "$CTDB_NFS_SKIP_SHARE_CHECK" = "yes" ] || {
@@ -101,6 +103,16 @@ case "$1" in
 		rpc.mountd $RPCMOUNTDOPTS &
 		exit 1
 	}
+	# rquotad needs special handling since it is sometimes not started
+	# correctly on RHEL5
+	# this is not a critical service so we dont flag the node as unhealthy
+	rpcinfo -u localhost 100011 1 > /dev/null || {
+		echo "ERROR: RQUOTAD is not running. Trying to restart it."
+		RPCRQUOTADOPTS=""
+		[ -n "$RQUOTAD_PORT" ] && RPCRQUOTADOPTS="$RPCRQUOTADOPTS -p $RQUOTAD_PORT"
+		killall -q -9 rpc.rquotad
+		rpc.rquotad $RPCRQUOTADOPTS &
+	}
        	;;
 
     *)
diff --git a/server/ctdb_call.c b/server/ctdb_call.c
index 82c1304..6ad9305 100644
--- a/server/ctdb_call.c
+++ b/server/ctdb_call.c
@@ -246,7 +246,7 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db,
 	struct ctdb_context *ctdb = ctdb_db->ctdb;
 	struct ctdb_ltdb_header header;
 
-	DEBUG(DEBUG_INFO,("pnn %u dmaster response %08x\n", ctdb->pnn, ctdb_hash(&key)));
+	DEBUG(DEBUG_DEBUG,("pnn %u dmaster response %08x\n", ctdb->pnn, ctdb_hash(&key)));
 
 	ZERO_STRUCT(header);
 	header.rsn = rsn + 1;
@@ -332,7 +332,7 @@ void ctdb_request_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
 		ctdb_fatal(ctdb, "ctdb_req_dmaster to non-lmaster");
 	}
 
-	DEBUG(DEBUG_INFO,("pnn %u dmaster request on %08x for %u from %u\n", 
+	DEBUG(DEBUG_DEBUG,("pnn %u dmaster request on %08x for %u from %u\n", 
 		 ctdb->pnn, ctdb_hash(&key), c->dmaster, c->hdr.srcnode));
 
 	/* its a protocol error if the sending node is not the current dmaster */
@@ -446,7 +446,7 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
 			      " of key %s while transaction is active\n",
 			      (char *)call->key.dptr));
 		} else {
-			DEBUG(DEBUG_INFO,("pnn %u starting migration of %08x to %u\n",
+			DEBUG(DEBUG_DEBUG,("pnn %u starting migration of %08x to %u\n",
 				 ctdb->pnn, ctdb_hash(&(call->key)), c->hdr.srcnode));
 			ctdb_call_send_dmaster(ctdb_db, c, &header, &(call->key), &data);
 			talloc_free(data.dptr);
diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c
index cc74739..166ca5a 100644
--- a/server/ctdb_takeover.c
+++ b/server/ctdb_takeover.c
@@ -772,7 +772,7 @@ int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
 	vnn->takeover_ctx = NULL;
 
 	if (!ctdb_sys_have_ip(&pip->addr)) {
-		DEBUG(DEBUG_INFO,("Redundant release of IP %s/%u on interface %s (ip not held)\n",
+		DEBUG(DEBUG_DEBUG,("Redundant release of IP %s/%u on interface %s (ip not held)\n", 
 			ctdb_addr_to_str(&pip->addr),
 			vnn->public_netmask_bits, 
 			ctdb_vnn_iface_string(vnn)));
diff --git a/server/eventscript.c b/server/eventscript.c
index 36d8717..e12491c 100644
--- a/server/eventscript.c
+++ b/server/eventscript.c
@@ -145,7 +145,7 @@ static bool check_executable(const char *dir, const char *name)
 	}
 
 	if (!(st.st_mode & S_IXUSR)) {
-		DEBUG(DEBUG_INFO,("Event script %s is not executable. Ignoring this event script\n", full));
+		DEBUG(DEBUG_DEBUG,("Event script %s is not executable. Ignoring this event script\n", full));
 		errno = ENOEXEC;
 		talloc_free(full);
 		return false;
@@ -365,7 +365,7 @@ static int child_run_script(struct ctdb_context *ctdb,
 	CTDB_NO_MEMORY(ctdb, cmdstr);
 	child_state.script_running = cmdstr;
 
-	DEBUG(DEBUG_INFO,("Executing event script %s\n",cmdstr));
+	DEBUG(DEBUG_DEBUG,("Executing event script %s\n",cmdstr));
 
 	if (current->status) {
 		ret = current->status;


-- 
CTDB repository


More information about the samba-cvs mailing list