[SCM] CTDB repository - branch master updated - ctdb-2.3-88-g618ea36

Amitay Isaacs amitay at samba.org
Thu Aug 22 01:08:19 MDT 2013


The branch, master has been updated
       via  618ea3660e36e7bd92b686e1ca8728cf63c3c068 (commit)
       via  3ffca990a18cbd31c8bd3ae01c6671d60da58f58 (commit)
       via  f0d69a9079b7aecc68f1d2d8510702046b618b19 (commit)
       via  406e1cb1fdd17ddd239774d0228e3657b73ae68f (commit)
       via  81833052d7ee8f76b1e98376a0273448640cfa8e (commit)
       via  4b914d7e217202f3d11a8e95f9f74bc17869475b (commit)
       via  b1d8732b5da18ae80aea1df0e66b0b5cdcd919bc (commit)
       via  7b3f7eea2465efb099a2faf3e42174bc97b13a16 (commit)
       via  123a4677528cb46bee1c6dad8a5162eba9880bc1 (commit)
       via  da22d5e60dc023009854025cc9e6bc4b0a84c60e (commit)
       via  db57261d7dc264e161659a8c547f44fbd9e88eeb (commit)
       via  3ef93a1a3e60cdf5d8954e7a16a988ea6126916b (commit)
       via  256b157232c60bc432c94e54b1fae9699f737557 (commit)
       via  4ed2efb838d2ac97746666f614ebef5fdf3cdd5e (commit)
       via  7677fb263f06a97398e2c546e32273fb96edca69 (commit)
       via  92939c1178d04116d842708bc2d6a9c2950e36cc (commit)
       via  d8b094e804efc53fae9f44c6ef961b7b5797d290 (commit)
       via  ac417b0003f0116f116834ad2ac51482d25cfa0d (commit)
       via  48f40985f4592c28402303ccbb458756f4914f75 (commit)
       via  df83ae7a047dab4803e0d94b1c11df48ae17ca96 (commit)
      from  5cdad2b8ebd71a5e458c301d00eac00a211feeb3 (commit)

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


- Log -----------------------------------------------------------------
commit 618ea3660e36e7bd92b686e1ca8728cf63c3c068
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Aug 22 14:04:59 2013 +1000

    tests/simple: Minimise the chance of a monitor event being cancelled
    
    A monitor event following a "ctdb delip" might reconfigure services.
    If the monitor event is cancelled then a service might be stopped but
    not yet restarted and this could result in the subsequent monitor
    events failing.
    
    This obviously needs to be fixed in CTDB itself.  This will happen by
    making "ctdb reloadips" the supported way of reconfiguring IPs.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 3ffca990a18cbd31c8bd3ae01c6671d60da58f58
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Aug 21 17:24:03 2013 +1000

    packaging: Remove pushd/popd from maketarball.sh, don't need bash
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit f0d69a9079b7aecc68f1d2d8510702046b618b19
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Aug 21 16:48:21 2013 +1000

    tools/ctdb_diagnostics: Add output of "ctdb getdbmap"
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 406e1cb1fdd17ddd239774d0228e3657b73ae68f
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Aug 21 16:38:17 2013 +1000

    tools/ctdb_diagnostics: Safer temporary file creation
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 81833052d7ee8f76b1e98376a0273448640cfa8e
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Aug 21 14:34:49 2013 +1000

    eventscripts: Avoid using a temporary file in 62.cnfs
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 4b914d7e217202f3d11a8e95f9f74bc17869475b
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Aug 21 14:27:39 2013 +1000

    scripts: Remove gdb_backtrace
    
    This uses potentially insecure temporary files and is not referenced
    anywhere else.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit b1d8732b5da18ae80aea1df0e66b0b5cdcd919bc
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 19 14:40:52 2013 +1000

    tools/ctdb: Make most non-auto-all commands abort if run with -n all
    
    Or if run with -n A,B,...
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 7b3f7eea2465efb099a2faf3e42174bc97b13a16
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Aug 15 05:02:37 2013 +1000

    tools/ctdb: Remove more non-essential fetching of PNN from daemon
    
    The useful cases are either CTDB_CURRENT_NODE, in which case
    ctdb_get_pnn() does the job, or a PNN, which is... ummm... a PNN!  :-)
    
    This works because parse_nodestring() validates PNNs.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 123a4677528cb46bee1c6dad8a5162eba9880bc1
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Aug 19 13:54:49 2013 +1000

    tools/ctdb: Improve auto-all settings for some commands
    
    * ipreallocate is cluster-wide so should not be auto-all
    
    * enablescript, disablescript, getreclock, setreclock, natgwlist can
      all be auto-all without issues
    
    * xpnn, ipiface a local-only so don't work with -n, so might as well
      not be auto-all
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit da22d5e60dc023009854025cc9e6bc4b0a84c60e
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 16 20:27:25 2013 +1000

    recoverd: Remove an unused temporary talloc context
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit db57261d7dc264e161659a8c547f44fbd9e88eeb
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Aug 16 14:10:57 2013 +1000

    recoverd: Move struct ctdb_public_ip_list back into ctdb_takeover.c
    
    This is an internal structure.  It was moved into ctdb_private.h a
    long time ago to allow unit testing.  Unit test compilation was
    changed shortly afterwards to make this unnecessary.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 3ef93a1a3e60cdf5d8954e7a16a988ea6126916b
Author: Martin Schwenke <martin at meltin.net>
Date:   Thu Aug 15 17:04:01 2013 +1000

    recoverd: Log more information when interfaces change
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 256b157232c60bc432c94e54b1fae9699f737557
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Jul 11 16:00:30 2013 +1000

    traverse: Log when database traverse is started
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 4ed2efb838d2ac97746666f614ebef5fdf3cdd5e
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Thu Aug 22 15:12:17 2013 +1000

    ctdbd: Finish eventscript callback processing before debugging hung script
    
    This ensures that the result of eventscripts is updated and callback is
    processed before debugging hung script.  So "ctdb scriptstatus" output
    will be useful from debug hung script.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Pair-Programmed-With: Martin Schwenke <martin at meltin.net>

commit 7677fb263f06a97398e2c546e32273fb96edca69
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Jul 23 16:00:15 2013 +1000

    ctdbd: Make sure call data is freed if doing an early return
    
    This should avoid memory bloat when a request bounces between nodes.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 92939c1178d04116d842708bc2d6a9c2950e36cc
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Aug 21 14:42:06 2013 +1000

    common/io: Limit the queue buffer size for fair scheduling via tevent
    
    If we process all the data available in a socket buffer, CTDB can stay busy
    processing lots of packets via immediate event mechanism in tevent.  After
    processing an immediate event, tevent returns without epoll_wait.  So as long
    as there are immediate events, tevent will never poll other FDs.  CTDB will
    report this as "Event handling took xx seconds" warning.  This is misleading
    since CTDB is very busy processing packets, but never gets to the point of
    polling FDs.
    
    The improvement in socket handling made it worse when handling traverse
    control.  There were lots of packets filled in the socket buffer quickly and
    CTDB stayed busy processing those packets and not polling other FDs and timer
    events.  This can lead to controls timing out and in worse case other nodes
    marking busy node as disconnected.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit d8b094e804efc53fae9f44c6ef961b7b5797d290
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Aug 20 14:20:09 2013 +1000

    Revert "common/io: Keep queue buffer size multiple of 4K"
    
    This reverts commit 5e9b1a7e24d058ff88aaa0563db36a804e866fa9.
    
    This is not the best approach.  Allowing queue buffer size to grow
    indefinitely causes large number of CTDB packets to be queued up very
    quickly which when processed via immediate events will block CTDB from
    processing events from other FDs.  If there are immediate events queued
    up, tevent will never process any of the FDs till all immediate events
    are processed.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit ac417b0003f0116f116834ad2ac51482d25cfa0d
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Aug 19 15:04:46 2013 +1000

    Revert "LACOUNT:  Add back lacount mechanism to defer migrating a fetched/read copy until after default of 20 consecutive requests from the same node"
    
    This reverts commit 035c0d981bde8c0eee8b3f24ba8e2dc817e5b504.
    
    This is a premature optimization.  Record can bounce between nodes
    very quickly if it is a contended record.  There is no need to hold a
    record on a node unnecessarily.  In case record contention becomes bad,
    enabling sticky records on a database is a better idea.
    
    Conflicts:
    	include/ctdb_private.h
    	server/ctdb_tunables.c
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 48f40985f4592c28402303ccbb458756f4914f75
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Jul 15 15:39:47 2013 +1000

    ctdbd: Print a log message when a key becomes hot
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit df83ae7a047dab4803e0d94b1c11df48ae17ca96
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Aug 9 17:22:55 2013 +1000

    ctdbd: For volatile databases, write an empty record with rsn=0 only on dmaster
    
    Empty record with rsn=0 should not be written on any other node other than
    dmaster.  This is however not true for persistent databases.  So currently
    apply the check only for volatile databases.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

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

Summary of changes:
 client/ctdb_client.c                   |   14 +---
 common/ctdb_io.c                       |   51 ++++++++-------
 common/ctdb_ltdb.c                     |    5 +-
 config/events.d/62.cnfs                |    5 +-
 config/gdb_backtrace                   |   87 -------------------------
 include/ctdb_private.h                 |    9 +--
 include/ctdb_protocol.h                |    3 +-
 packaging/maketarball.sh               |   79 ++++++++++-------------
 server/ctdb_call.c                     |   34 ++++++----
 server/ctdb_recoverd.c                 |   20 ++++--
 server/ctdb_takeover.c                 |    6 ++
 server/ctdb_traverse.c                 |    2 +
 server/ctdb_tunables.c                 |    1 -
 server/eventscript.c                   |   73 ++++++++++++++--------
 tests/simple/60_recoverd_missing_ip.sh |    4 +
 tools/ctdb.c                           |  110 ++++++++++++++++++++-----------
 tools/ctdb_diagnostics                 |   14 +++-
 17 files changed, 246 insertions(+), 271 deletions(-)
 delete mode 100755 config/gdb_backtrace


Changeset truncated at 500 lines:

diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index 764404e..8bab9bb 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -70,7 +70,7 @@ struct ctdb_req_header *_ctdbd_allocate_pkt(struct ctdb_context *ctdb,
 */
 int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call,
 		    struct ctdb_ltdb_header *header, TALLOC_CTX *mem_ctx,
-		    TDB_DATA *data, bool updatetdb, uint32_t caller)
+		    TDB_DATA *data, bool updatetdb)
 {
 	struct ctdb_call_info *c;
 	struct ctdb_registered_call *fn;
@@ -105,15 +105,7 @@ int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call,
 	}
 
 	/* we need to force the record to be written out if this was a remote access */
-	if (header->laccessor != caller) {
-		header->lacount = 0;
-	}
-	header->laccessor = caller;
-	header->lacount++;
-
-	/* we need to force the record to be written out if this was a remote access,
-	   so that the lacount is updated */
-	if (c->new_data == NULL && header->laccessor != ctdb->pnn) {
+	if (c->new_data == NULL) {
 		c->new_data = &c->record_data;
 	}
 
@@ -368,7 +360,7 @@ static struct ctdb_client_call_state *ctdb_client_call_local_send(struct ctdb_db
 	*(state->call) = *call;
 	state->ctdb_db = ctdb_db;
 
-	ret = ctdb_call_local(ctdb_db, state->call, header, state, data, true, ctdb->pnn);
+	ret = ctdb_call_local(ctdb_db, state->call, header, state, data, true);
 	if (ret != 0) {
 		DEBUG(DEBUG_DEBUG,("ctdb_call_local() failed, ignoring return code %d\n", ret));
 	}
diff --git a/common/ctdb_io.c b/common/ctdb_io.c
index 1db6f2b..351006d 100644
--- a/common/ctdb_io.c
+++ b/common/ctdb_io.c
@@ -29,14 +29,14 @@
 #include "../include/ctdb_client.h"
 #include <stdarg.h>
 
-#define QUEUE_BUFFER_SIZE	(4*1024)
-#define QUEUE_BUFFER_OVERSIZE	(64*1024)
+#define QUEUE_BUFFER_SIZE	(16*1024)
 
 /* structures for packet queueing - see common/ctdb_io.c */
 struct ctdb_buffer {
 	uint8_t *data;
 	uint32_t length;
 	uint32_t size;
+	uint32_t extend;
 };
 
 struct ctdb_queue_pkt {
@@ -101,7 +101,9 @@ static void queue_process(struct ctdb_queue *queue)
 	}
 
 	if (queue->buffer.length < pkt_size) {
-		DEBUG(DEBUG_DEBUG, ("Partial packet data read\n"));
+		if (pkt_size > QUEUE_BUFFER_SIZE) {
+			queue->buffer.extend = pkt_size;
+		}
 		return;
 	}
 
@@ -126,8 +128,7 @@ static void queue_process(struct ctdb_queue *queue)
 		tevent_schedule_immediate(queue->im, queue->ctdb->ev,
 					  queue_process_event, queue);
 	} else {
-		/* Throw away large buffer when done processing requests */
-		if (queue->buffer.size > QUEUE_BUFFER_OVERSIZE) {
+		if (queue->buffer.size > QUEUE_BUFFER_SIZE) {
 			TALLOC_FREE(queue->buffer.data);
 			queue->buffer.size = 0;
 		}
@@ -152,6 +153,7 @@ static void queue_io_read(struct ctdb_queue *queue)
 	int num_ready = 0;
 	ssize_t nread;
 	uint8_t *data;
+	int navail;
 
 	/* check how much data is available on the socket for immediately
 	   guaranteed nonblocking access.
@@ -168,37 +170,38 @@ static void queue_io_read(struct ctdb_queue *queue)
 	}
 
 	if (queue->buffer.data == NULL) {
-		int n;
-
 		/* starting fresh, allocate buf to read data */
-		n = QUEUE_BUFFER_SIZE * (num_ready/QUEUE_BUFFER_SIZE + 1);
-		queue->buffer.data = talloc_size(queue, n);
+		queue->buffer.data = talloc_size(queue, QUEUE_BUFFER_SIZE);
 		if (queue->buffer.data == NULL) {
-			DEBUG(DEBUG_ERR, ("read error alloc failed for %u\n", n));
+			DEBUG(DEBUG_ERR, ("read error alloc failed for %u\n", num_ready));
 			goto failed;
 		}
-		queue->buffer.size = n;
-	} else if (queue->buffer.length + num_ready > queue->buffer.size) {
-		int increment, n;
-
+		queue->buffer.size = QUEUE_BUFFER_SIZE;
+	} else if (queue->buffer.extend > 0) {
 		/* extending buffer */
-		increment = (queue->buffer.length + num_ready) - queue->buffer.size;
-		n = queue->buffer.size + QUEUE_BUFFER_SIZE * (increment/QUEUE_BUFFER_SIZE + 1);
-		data = talloc_realloc_size(queue, queue->buffer.data, n);
+		data = talloc_realloc_size(queue, queue->buffer.data, queue->buffer.extend);
 		if (data == NULL) {
-			DEBUG(DEBUG_ERR, ("read error realloc failed for %u\n", n));
+			DEBUG(DEBUG_ERR, ("read error realloc failed for %u\n", queue->buffer.extend));
 			goto failed;
 		}
 		queue->buffer.data = data;
-		queue->buffer.size = n;
+		queue->buffer.size = queue->buffer.extend;
+		queue->buffer.extend = 0;
 	}
 
-	nread = read(queue->fd, queue->buffer.data + queue->buffer.length, num_ready);
-	if (nread <= 0) {
-		DEBUG(DEBUG_ERR, ("read error nread=%d\n", (int)nread));
-		goto failed;
+	navail = queue->buffer.size - queue->buffer.length;
+	if (num_ready > navail) {
+		num_ready = navail;
+	}
+
+	if (num_ready > 0) {
+		nread = read(queue->fd, queue->buffer.data + queue->buffer.length, num_ready);
+		if (nread <= 0) {
+			DEBUG(DEBUG_ERR, ("read error nread=%d\n", (int)nread));
+			goto failed;
+		}
+		queue->buffer.length += nread;
 	}
-	queue->buffer.length += nread;
 
 	queue_process(queue);
 	return;
diff --git a/common/ctdb_ltdb.c b/common/ctdb_ltdb.c
index 0bfc377..4681f30 100644
--- a/common/ctdb_ltdb.c
+++ b/common/ctdb_ltdb.c
@@ -66,7 +66,6 @@ static void ltdb_initial_header(struct ctdb_db_context *ctdb_db,
 	/* initial dmaster is the lmaster */
 	header->dmaster = ctdb_lmaster(ctdb_db->ctdb, &key);
 	header->flags = CTDB_REC_FLAG_AUTOMATIC;
-	header->laccessor = header->dmaster;
 }
 
 
@@ -98,7 +97,9 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
 		if (data) {
 			*data = d2;
 		}
-		ctdb_ltdb_store(ctdb_db, key, header, d2);
+		if (ctdb_db->persistent || header->dmaster == ctdb_db->ctdb->pnn) {
+			ctdb_ltdb_store(ctdb_db, key, header, d2);
+		}
 		return 0;
 	}
 
diff --git a/config/events.d/62.cnfs b/config/events.d/62.cnfs
index 302b497..da02acc 100755
--- a/config/events.d/62.cnfs
+++ b/config/events.d/62.cnfs
@@ -45,10 +45,7 @@ case "$1" in
         # Mark the node as UNHEALTHY which means all public addresses
         # will be migrated off the node.
         shift
-        TMPFILE=/tmp/ctdb.cnfs.$$
-        echo "$*" > $TMPFILE
-        ctdb_setstatus unhealthy $TMPFILE
-        rm $TMPFILE
+        echo "$*" | ctdb_setstatus unhealthy -
 
         # force a monitor event so we pick up immediately that this script
         # will now fail and make the node unhealthy.
diff --git a/config/gdb_backtrace b/config/gdb_backtrace
deleted file mode 100755
index 826381e..0000000
--- a/config/gdb_backtrace
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/sh
-
-BASENAME=`basename $0`
-
-if [ -n "$VALGRIND" -o -n "$SMBD_VALGRIND" ]; then
-	echo "${BASENAME}: Not running debugger under valgrind"
-	exit 1
-fi
-
-# we want everything on stderr, so the program is not disturbed
-exec 1>&2
-
-BASENAME=`basename $0`
-UNAME=`uname`
-
-PID=$1
-BINARY=$2
-
-test x"${PID}" = x"" && {
-	echo "Usage: ${BASENAME} <pid> [<binary>]"
-	exit 1
-}
-
-DB_LIST="gdb"
-case "${UNAME}" in
-	#
-	# on Tru64 we need to try ladebug first
-	# because gdb crashes itself...
-	#
-	OSF1)
-		DB_LIST="ladebug ${DB_LIST}"
-	;;
-esac
-
-for DB in ${DB_LIST}; do
-	DB_BIN=`which ${DB} 2>/dev/null | grep '^/'`
-	test x"${DB_BIN}" != x"" && {
-		break
-	}
-done
-
-test x"${DB_BIN}" = x"" && {
-	echo "${BASENAME}: ERROR: No debugger found."
-	exit 1
-}
-
-#
-# we first try to use /proc/${PID}/exe
-# then fallback to the binary from the commandline
-# then we search for the commandline argument with
-# 'which'
-#
-test -f "/proc/${PID}/exe" && BINARY="/proc/${PID}/exe"
-test x"${BINARY}" = x"" && BINARY="/proc/${PID}/exe"
-test -f "${BINARY}" || BINARY=`which ${BINARY}`
-
-test -f "${BINARY}" || {
-	echo "${BASENAME}: ERROR: Cannot find binary '${BINARY}'."
-	exit 1
-}
-
-echo "${BASENAME}: Trying to use ${DB_BIN} on ${BINARY} on PID ${PID}"
-
-BATCHFILE_PRE=/tmp/gdb_backtrace_pre.$$
-BATCHFILE_MAIN=/tmp/gdb_backtrace_main.$$
-case "${DB}" in
-	ladebug)
-cat << EOF  > ${BATCHFILE_PRE}
-set \$stoponattach
-EOF
-
-cat << EOF  > ${BATCHFILE_MAIN}
-where
-quit
-EOF
-	${DB_BIN} -c "${BATCHFILE_MAIN}" -i "${BATCHFILE_PRE}" -pid "${PID}" "${BINARY}"
-	;;
-	gdb)
-cat << EOF  > ${BATCHFILE_MAIN}
-set height 1000
-bt full
-quit
-EOF
-	${DB_BIN} -x "${BATCHFILE_MAIN}" "${BINARY}" "${PID}"
-	;;
-esac
-/bin/rm -f ${BATCHFILE_PRE} ${BATCHFILE_MAIN}
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index 9c78440..987502e 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -126,7 +126,6 @@ struct ctdb_tunable {
 	uint32_t recover_pdb_by_seqnum;
 	uint32_t deferred_rebalance_on_node_add;
 	uint32_t fetch_collapse;
-	uint32_t max_lacount;
 	uint32_t hopcount_make_sticky;
 	uint32_t sticky_duration;
 	uint32_t sticky_pindown;
@@ -872,7 +871,7 @@ struct ctdb_call_state *ctdb_daemon_call_send_remote(struct ctdb_db_context *ctd
 
 int ctdb_call_local(struct ctdb_db_context *ctdb_db, struct ctdb_call *call,
 		    struct ctdb_ltdb_header *header, TALLOC_CTX *mem_ctx,
-		    TDB_DATA *data, bool updatetdb, uint32_t caller);
+		    TDB_DATA *data, bool updatetdb);
 
 #define ctdb_reqid_find(ctdb, reqid, type)	(type *)_ctdb_reqid_find(ctdb, reqid, #type, __location__)
 
@@ -1535,12 +1534,6 @@ void ctdb_local_remove_from_delete_queue(struct ctdb_db_context *ctdb_db,
 
 struct ctdb_ltdb_header *ctdb_header_from_record_handle(struct ctdb_record_handle *h);
 
-/* For unit testing ctdb_transaction.c. */
-struct ctdb_public_ip_list {
-	struct ctdb_public_ip_list *next;
-	uint32_t pnn;
-	ctdb_sock_addr addr;
-};
 int ctdb_trackingdb_add_pnn(struct ctdb_context *ctdb, TDB_DATA *data, uint32_t pnn);
 
 typedef void (*ctdb_trackingdb_cb)(struct ctdb_context *ctdb, uint32_t pnn, void *private_data);
diff --git a/include/ctdb_protocol.h b/include/ctdb_protocol.h
index f72381f..7b8298b 100644
--- a/include/ctdb_protocol.h
+++ b/include/ctdb_protocol.h
@@ -524,8 +524,7 @@ enum ctdb_trans2_commit_error {
 struct ctdb_ltdb_header {
 	uint64_t rsn;
 	uint32_t dmaster;
-	uint16_t laccessor;
-	uint16_t lacount;
+	uint32_t reserved1;
 #define CTDB_REC_FLAG_DEFAULT			0x00000000
 #define CTDB_REC_FLAG_MIGRATED_WITH_DATA	0x00010000
 #define CTDB_REC_FLAG_VACUUM_MIGRATED		0x00020000
diff --git a/packaging/maketarball.sh b/packaging/maketarball.sh
index c99bb70..c27e2ec 100755
--- a/packaging/maketarball.sh
+++ b/packaging/maketarball.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # maketarball.sh - create a tarball from the git branch HEAD
 #
@@ -24,18 +24,21 @@
 # Optional argument is the directory to which tarball is copied.
 #
 
-DIRNAME=$(dirname $0)
-TOPDIR=${DIRNAME}/..
+TARGETDIR="${1:-${PWD}}"  # Default target directory is .
 
-TARGETDIR="$1"
-if [ -z "${TARGETDIR}" ]; then
-    TARGETDIR="."
-fi
+DIRNAME=$(dirname "$0")
+cd -P "${DIRNAME}/.."
+TOPDIR="$PWD"
+
+tmpd=$(mktemp -d) || {
+    echo "Failed to create temporary directory"
+    exit 1
+}
 
 TAR_PREFIX_TMP="ctdb-tmp"
-SPECFILE=/tmp/${TAR_PREFIX_TMP}/packaging/RPM/ctdb.spec
-SPECFILE_IN=${SPECFILE}.in
-VERSION_H=/tmp/${TAR_PREFIX_TMP}/include/ctdb_version.h
+SPECFILE="${tmpd}/${TAR_PREFIX_TMP}/packaging/RPM/ctdb.spec"
+SPECFILE_IN="${SPECFILE}.in"
+VERSION_H="${tmpd}/${TAR_PREFIX_TMP}/include/ctdb_version.h"
 
 if echo | gzip -c --rsyncable - > /dev/null 2>&1 ; then
 	GZIP="gzip -9 --rsyncable"
@@ -43,17 +46,14 @@ else
 	GZIP="gzip -9"
 fi
 
-pushd ${TOPDIR}
 echo "Creating tarball ... "
-git archive --prefix=${TAR_PREFIX_TMP}/ HEAD | ( cd /tmp ; tar xf - )
-RC=$?
-popd
-if [ $RC -ne 0 ]; then
+git archive --prefix="${TAR_PREFIX_TMP}/" HEAD | ( cd "$tmpd" ; tar xf - )
+if [ $? -ne 0 ]; then
 	echo "Error calling git archive."
 	exit 1
 fi
 
-set -- $(${TOPDIR}/packaging/mkversion.sh ${VERSION_H})
+set -- $("${TOPDIR}/packaging/mkversion.sh" "$VERSION_H")
 VERSION=$1
 RELEASE=$2
 if [ -z "$VERSION" -o -z "$RELEASE" ]; then
@@ -68,55 +68,44 @@ sed -e "s/@VERSION@/${VERSION}/g" \
 TAR_PREFIX="ctdb-${VERSION}"
 TAR_BASE="ctdb-${VERSION}"
 
-pushd /tmp/${TAR_PREFIX_TMP}
-./autogen.sh
-RC=$?
-if [ $RC -ne 0 ]; then
+cd "${tmpd}/${TAR_PREFIX_TMP}"
+./autogen.sh || {
 	echo "Error calling autogen.sh."
 	exit 1
-fi
+}
 
-make -C doc
-RC=$?
-if [ $RC -ne 0 ]; then
+make -C doc || {
     echo "Error building docs."
     exit 1
-fi
-popd
+}
 
-if test "x${DEBIAN_MODE}" = "xyes" ; then
+if [ "$DEBIAN_MODE" = "yes" ] ; then
 	TAR_PREFIX="ctdb-${VERSION}.orig"
 	TAR_BASE="ctdb_${VERSION}.orig"
-	rm -rf /tmp/${TAR_PREFIX_TMP}/lib/popt
+	rm -rf "${tmpd}/${TAR_PREFIX_TMP}/lib/popt"
 fi
 
-TAR_BALL=${TAR_BASE}.tar
-TAR_GZ_BALL=${TAR_BALL}.gz
+TAR_BALL="${TAR_BASE}.tar"
+TAR_GZ_BALL="${TAR_BALL}.gz"
 
-mv /tmp/${TAR_PREFIX_TMP} /tmp/${TAR_PREFIX}
+mv "${tmpd}/${TAR_PREFIX_TMP}" "${tmpd}/${TAR_PREFIX}"
 
-pushd /tmp
-tar cf ${TAR_BALL} ${TAR_PREFIX}
-RC=$?
-if [ $RC -ne 0 ]; then
-	popd
+cd "$tmpd"
+tar cf "$TAR_BALL" "$TAR_PREFIX" || {
         echo "Creation of tarball failed."
         exit 1
-fi
+}
 
-${GZIP} ${TAR_BALL}
-RC=$?
-if [ $RC -ne 0 ]; then
-	popd
+$GZIP "$TAR_BALL" || {
         echo "Zipping tarball failed."
         exit 1
-fi
+}
 
-rm -rf ${TAR_PREFIX}
+rm -rf "$TAR_PREFIX"
 
-popd
+mv "${tmpd}/${TAR_GZ_BALL}" "${TARGETDIR}/"
 
-mv /tmp/${TAR_GZ_BALL} ${TARGETDIR}/
+rmdir "$tmpd"
 
 echo "Done."
 exit 0
diff --git a/server/ctdb_call.c b/server/ctdb_call.c
index a6fd85e..e35f044 100644
--- a/server/ctdb_call.c
+++ b/server/ctdb_call.c
@@ -399,7 +399,7 @@ static void ctdb_become_dmaster(struct ctdb_db_context *ctdb_db,
 		return;
 	}
 
-	ctdb_call_local(ctdb_db, state->call, &header, state, &data, true, ctdb->pnn);
+	ctdb_call_local(ctdb_db, state->call, &header, state, &data, true);
 
 	ret = ctdb_ltdb_unlock(ctdb_db, state->call->key);
 	if (ret != 0) {
@@ -696,6 +696,8 @@ ctdb_update_db_stat_hot_keys(struct ctdb_db_context *ctdb_db, TDB_DATA key, int
 	ctdb_db->statistics.hot_keys[id].key.dsize = key.dsize;
 	ctdb_db->statistics.hot_keys[id].key.dptr  = talloc_memdup(ctdb_db, key.dptr, key.dsize);
 	ctdb_db->statistics.hot_keys[id].count = hopcount;
+	DEBUG(DEBUG_NOTICE,("Updated hot key database=%s key=0x%08x id=%d hop_count=%d\n",
+			    ctdb_db->db_name, ctdb_hash(&key), id, hopcount));
 
 sort_keys:
 	for (i = 1; i < MAX_HOT_KEYS; i++) {
@@ -759,7 +761,9 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
 	*/
 	if (ctdb_db->sticky) {
 		if (ctdb_defer_pinned_down_request(ctdb, ctdb_db, call->key, hdr) == 0) {
-		  DEBUG(DEBUG_WARNING,("Defer request for pinned down record in %s\n", ctdb_db->db_name));
+			DEBUG(DEBUG_WARNING,
+			      ("Defer request for pinned down record in %s\n", ctdb_db->db_name));
+			talloc_free(call);
 			return;
 		}
 	}
@@ -773,10 +777,12 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
 					   ctdb_call_input_pkt, ctdb, false);
 	if (ret == -1) {
 		ctdb_send_error(ctdb, hdr, ret, "ltdb fetch failed in ctdb_request_call");


-- 
CTDB repository


More information about the samba-cvs mailing list