[SCM] CTDB repository - branch master updated - ctdb-1.13-61-g83aea64

Ronnie Sahlberg sahlberg at samba.org
Mon Apr 2 22:26:06 MDT 2012


The branch, master has been updated
       via  83aea6488002aa75dd25752fa0d164afb8b4f300 (commit)
       via  a2ba2c4ec153c8844cf7f5b0de03b2269ec892f3 (commit)
       via  98ac99c4a79fe2ee024890bb27c3ca68dc02d434 (commit)
       via  10ab88a5c822ac403a70a9cd1a6c81020eb91d08 (commit)
       via  2ade83de4e1f318c91489ec9a7f90d1b26f77e1b (commit)
       via  94f1e02406c353c3a0235685acdd107ee5a7f285 (commit)
       via  0cbe7a4f92795203f022252a50a240b8bd4238c3 (commit)
       via  36e690faab3d76919780c8550fe6d49fb6bbfba5 (commit)
       via  45773dab630ee44b39df0dd4b50f43fb1e7bb0ba (commit)
       via  a9e9444a7a78f5ef0e929a8dbd8ca0c68b40acd4 (commit)
      from  00cd75595685dae829758abf1a4cb644af7ed50e (commit)

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


- Log -----------------------------------------------------------------
commit 83aea6488002aa75dd25752fa0d164afb8b4f300
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Apr 3 13:43:21 2012 +1000

    CTDB: add back the "rebalanceip" command

commit a2ba2c4ec153c8844cf7f5b0de03b2269ec892f3
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Fri Mar 30 12:06:05 2012 +1100

    build: Substitute POPT macros once and reuse variables
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 98ac99c4a79fe2ee024890bb27c3ca68dc02d434
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Mar 27 10:53:25 2012 +1100

    recovery: Add prototypes for tdb internal functions
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 10ab88a5c822ac403a70a9cd1a6c81020eb91d08
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Mar 21 14:45:56 2012 +1100

    build: Use system tdb library if available
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 2ade83de4e1f318c91489ec9a7f90d1b26f77e1b
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Mar 21 15:56:45 2012 +1100

    build: Use system tevent library if available
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 94f1e02406c353c3a0235685acdd107ee5a7f285
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Mar 21 13:18:10 2012 +1100

    build: Use system talloc library if available
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 0cbe7a4f92795203f022252a50a240b8bd4238c3
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Mar 21 16:08:57 2012 +1100

    build: Display correct LIB_FLAGS while building
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 36e690faab3d76919780c8550fe6d49fb6bbfba5
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Mar 20 09:22:54 2012 +1100

    build: Remove re-definition of same variable
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 45773dab630ee44b39df0dd4b50f43fb1e7bb0ba
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Mon Feb 6 16:45:50 2012 +1100

    packaging: Setup directories for rpmbuild
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit a9e9444a7a78f5ef0e929a8dbd8ca0c68b40acd4
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Wed Jan 11 19:04:39 2012 +1100

    build: Add rules to create ctags/etags
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

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

Summary of changes:
 Makefile.in                 |   44 ++++++++++++++++++-------
 lib/talloc/libtalloc.m4     |   63 +++++++++++++++++++++++++-----------
 lib/tdb/libtdb.m4           |   66 +++++++++++++++++++++++++------------
 lib/tevent/libtevent.m4     |   66 ++++++++++++++++++++++++--------------
 packaging/RPM/makerpms.sh   |    8 ++++
 server/ctdb_recover.c       |    7 ++++
 server/ctdb_update_record.c |    8 ++--
 tools/ctdb.c                |   75 +++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 256 insertions(+), 81 deletions(-)


Changeset truncated at 500 lines:

diff --git a/Makefile.in b/Makefile.in
index 90d7b08..1794be5 100755
--- a/Makefile.in
+++ b/Makefile.in
@@ -29,6 +29,18 @@ POPT_LIBS = @POPT_LIBS@
 POPT_CFLAGS = @POPT_CFLAGS@
 POPT_OBJ = @POPT_OBJ@
 
+TALLOC_LIBS = @TALLOC_LIBS@
+TALLOC_CFLAGS = @TALLOC_CFLAGS@
+TALLOC_OBJ = @TALLOC_OBJ@
+
+TEVENT_LIBS = @TEVENT_LIBS@
+TEVENT_CFLAGS = @TEVENT_CFLAGS@
+TEVENT_OBJ = @TEVENT_OBJ@
+
+TDB_LIBS = @TDB_LIBS@
+TDB_CFLAGS = @TDB_CFLAGS@
+TDB_OBJ = @TDB_OBJ@
+
 SOCKET_WRAPPER_OBJ = @SOCKET_WRAPPER_OBJS@
 
 PMDA_LIBS = -lpcp -lpcp_pmda
@@ -36,7 +48,7 @@ PMDA_INSTALL = @CTDB_PMDA_INSTALL@
 PMDA_DEST_DIR = /var/lib/pcp/pmdas
 
 CFLAGS=@CPPFLAGS@ -g -I$(srcdir)/include -Iinclude -Ilib -Ilib/util -I$(srcdir) \
-       -I at tallocdir@ -I at tdbdir@/include -I at libreplacedir@ \
+       $(TALLOC_CFLAGS) $(TEVENT_CFLAGS) $(TDB_CFLAGS) -I at libreplacedir@ \
 	-DVARDIR=\"$(localstatedir)\" -DETCDIR=\"$(etcdir)\" \
 	-DLOGDIR=\"$(logdir)\" \
 	-DUSE_MMAP=1 -DTEVENT_DEPRECATED_QUIET=1 @CFLAGS@ -Wno-format-zero-length $(POPT_CFLAGS) \
@@ -46,7 +58,8 @@ LDSHFLAGS=-fPIC -shared
 #LDSHFLAGS=-fPIC -shared -Wl,-Bsymbolic -Wl,-z,relo -Wl,-Bsymbolic-funtions -Wl,--as-needed -Wl,-z,defs
 SHLD=${CC} ${CFLAGS} ${LDSHFLAGS} -o $@
 
-LIB_FLAGS=@LDFLAGS@ -Llib @LIBS@ $(POPT_LIBS) @INFINIBAND_LIBS@ @CTDB_PCAP_LDFLAGS@
+LIB_FLAGS=@LDFLAGS@ -Llib @LIBS@ $(POPT_LIBS) $(TALLOC_LIBS) $(TEVENT_LIBS) $(TDB_LIBS) \
+		  @INFINIBAND_LIBS@ @CTDB_PCAP_LDFLAGS@
 
 UTIL_OBJ = lib/util/idtree.o lib/util/db_wrap.o lib/util/strlist.o lib/util/util.o \
 	lib/util/util_time.o lib/util/util_file.o lib/util/fault.o lib/util/substitute.o \
@@ -64,8 +77,8 @@ CTDB_LIB_OBJ = libctdb/ctdb.o libctdb/io_elem.o libctdb/local_tdb.o \
 CTDB_TCP_OBJ = tcp/tcp_connect.o tcp/tcp_io.o tcp/tcp_init.o
 
 CTDB_CLIENT_OBJ = client/ctdb_client.o \
-	$(CTDB_COMMON_OBJ) $(POPT_OBJ) $(UTIL_OBJ) @TALLOC_OBJ@ @TDB_OBJ@ \
-	@LIBREPLACEOBJ@ $(EXTRA_OBJ) @TEVENT_OBJ@ $(SOCKET_WRAPPER_OBJ)
+	$(CTDB_COMMON_OBJ) $(POPT_OBJ) $(UTIL_OBJ) $(TALLOC_OBJ) $(TDB_OBJ) \
+	@LIBREPLACEOBJ@ $(EXTRA_OBJ) $(TEVENT_OBJ) $(SOCKET_WRAPPER_OBJ)
 
 CTDB_SERVER_OBJ = server/ctdbd.o server/ctdb_daemon.o server/ctdb_lockwait.o \
 	server/ctdb_recoverd.o server/ctdb_recover.o server/ctdb_freeze.o \
@@ -102,7 +115,7 @@ all: showflags dirs doc $(CTDB_SERVER_OBJ) $(CTDB_CLIENT_OBJ) $(CTDB_LIB_OBJ) $(
 showflags:
 	@echo 'ctdb will be compiled with flags:'
 	@echo '  CFLAGS = $(CFLAGS)'
-	@echo '  LIBS = $(LIBS)'
+	@echo '  LIBS = $(LIB_FLAGS)'
 
 showlayout::
 	@echo "ctdb will be installed into:"
@@ -150,9 +163,9 @@ bin/ctdb: $(CTDB_CLIENT_OBJ) tools/ctdb.o tools/ctdb_vacuum.o libctdb/libctdb.a
 	@echo Linking $@
 	@$(CC) $(CFLAGS) -o $@ tools/ctdb.o tools/ctdb_vacuum.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS) libctdb/libctdb.a
 
-bin/ltdbtool: tools/ltdbtool.o @TDB_OBJ@
+bin/ltdbtool: tools/ltdbtool.o $(TDB_OBJ)
 	@echo Linking $@
-	@$(CC) $(CFLAGS) -o $@ $+
+	@$(CC) $(CFLAGS) -o $@ $+ $(TDB_LIBS)
 
 bin/smnotify: utils/smnotify/gen_xdr.o utils/smnotify/gen_smnotify.o utils/smnotify/smnotify.o $(POPT_OBJ)
 	@echo Linking $@
@@ -198,11 +211,11 @@ tests/bin/ctdb_fetch_one: $(CTDB_CLIENT_OBJ) tests/src/ctdb_fetch_one.o
 
 tests/bin/ctdb_fetch_lock_once: libctdb/libctdb.a tests/src/ctdb_fetch_lock_once.o 
 	@echo Linking $@
-	@$(CC) $(CFLAGS) -o $@ tests/src/ctdb_fetch_lock_once.o @TDB_OBJ@ @POPT_OBJ@ libctdb/libctdb.a $(LIB_FLAGS)
+	@$(CC) $(CFLAGS) -o $@ tests/src/ctdb_fetch_lock_once.o $(TDB_OBJ) $(POPT_OBJ) libctdb/libctdb.a $(LIB_FLAGS)
 
 tests/bin/ctdb_fetch_readonly_once: libctdb/libctdb.a tests/src/ctdb_fetch_readonly_once.o
 	@echo Linking $@
-	@$(CC) $(CFLAGS) -o $@ tests/src/ctdb_fetch_readonly_once.o @TDB_OBJ@ @POPT_OBJ@ libctdb/libctdb.a $(LIB_FLAGS)
+	@$(CC) $(CFLAGS) -o $@ tests/src/ctdb_fetch_readonly_once.o $(TDB_OBJ) $(POPT_OBJ) libctdb/libctdb.a $(LIB_FLAGS)
 
 tests/bin/ctdb_fetch_readonly_loop: $(CTDB_CLIENT_OBJ) tests/src/ctdb_fetch_readonly_loop.o
 	@echo Linking $@
@@ -245,8 +258,8 @@ CTDBD_TEST_C = $(CTDB_SERVER_MOST_OBJ:.o=.c) tests/src/ctdbd_test.c
 
 CTDB_TEST_C = $(CTDB_CLIENT_OBJ:.o=.c) tools/ctdb.c tools/ctdb_vacuum.c  tests/src/ctdb_test.c
 
-CTDB_TEST_OBJ =  @TALLOC_OBJ@ @TDB_OBJ@ \
-	@CTDB_SYSTEM_OBJ@ @LIBREPLACEOBJ@ $(EXTRA_OBJ) @TEVENT_OBJ@ $(SOCKET_WRAPPER_OBJ)
+CTDB_TEST_OBJ =  $(TALLOC_OBJ) $(TDB_OBJ) \
+	@CTDB_SYSTEM_OBJ@ @LIBREPLACEOBJ@ $(EXTRA_OBJ) $(TEVENT_OBJ) $(SOCKET_WRAPPER_OBJ)
 
 tests/src/ctdb_takeover_tests.o: tests/src/ctdb_takeover_tests.c $(CTDBD_TEST_C)
 
@@ -258,13 +271,13 @@ tests/src/ctdb_tool_libctdb.o: tests/src/ctdb_tool_libctdb.c tests/src/libctdb_t
 
 tests/bin/ctdb_tool_libctdb: $(CTDB_TEST_OBJ) tests/src/ctdb_tool_libctdb.o
 	@echo Linking $@
-	@$(CC) $(CFLAGS) -o $@ tests/src/ctdb_tool_libctdb.o $(CTDB_TEST_OBJ) @POPT_OBJ@ $(LIB_FLAGS)
+	@$(CC) $(CFLAGS) -o $@ tests/src/ctdb_tool_libctdb.o $(CTDB_TEST_OBJ) $(POPT_OBJ) $(LIB_FLAGS)
 
 tests/src/ctdb_tool_stubby.o: tests/src/ctdb_tool_stubby.c tests/src/libctdb_test.c $(CTDB_TEST_C)
 
 tests/bin/ctdb_tool_stubby: $(CTDB_TEST_OBJ) tests/src/ctdb_tool_stubby.o
 	@echo Linking $@
-	@$(CC) $(CFLAGS) -o $@ tests/src/ctdb_tool_stubby.o $(CTDB_TEST_OBJ) @POPT_OBJ@ $(LIB_FLAGS)
+	@$(CC) $(CFLAGS) -o $@ tests/src/ctdb_tool_stubby.o $(CTDB_TEST_OBJ) $(POPT_OBJ) $(LIB_FLAGS)
 
 tests/bin/ibwrapper_test: $(CTDB_CLIENT_OBJ) ib/ibwrapper_test.o
 	@echo Linking $@
@@ -357,6 +370,11 @@ test: all
 valgrindtest: all
 	VALGRIND="valgrind -q --trace-children=yes" tests/run_tests.sh
 
+ctags:
+	find . -name "*.[ch]" | xargs ctags
+
+etags:
+	find . -name "*.[ch]" | xargs etags
 
 realdistclean: distclean
 	rm -f configure config.h.in ctdb.pc
diff --git a/lib/talloc/libtalloc.m4 b/lib/talloc/libtalloc.m4
index 4b22c8e..65227d8 100644
--- a/lib/talloc/libtalloc.m4
+++ b/lib/talloc/libtalloc.m4
@@ -1,25 +1,50 @@
-dnl find the talloc sources. This is meant to work both for 
-dnl talloc standalone builds, and builds of packages using talloc
-tallocdir=""
-tallocpaths=". lib/talloc talloc ../talloc ../lib/talloc"
-for d in $tallocpaths; do
-	if test -f "$srcdir/$d/talloc.c"; then
-		tallocdir="$d"
-		AC_SUBST(tallocdir)
-		break;
-	fi
-done
-if test x"$tallocdir" = "x"; then
-   AC_MSG_ERROR([cannot find talloc source in $tallocpaths])
-fi
-TALLOC_OBJ="talloc.o"
-AC_SUBST(TALLOC_OBJ)
+dnl Check to see if we should use the included talloc
 
-TALLOC_CFLAGS="-I$srcdir/$tallocdir"
-AC_SUBST(TALLOC_CFLAGS)
+INCLUDED_TALLOC=auto
+AC_ARG_WITH(included-talloc,
+    [AC_HELP_STRING([--with-included-talloc], [use bundled talloc library, not from system])],
+    [ INCLUDED_TALLOC=$withval ])
 
-TALLOC_LIBS=""
 AC_SUBST(TALLOC_LIBS)
+AC_SUBST(TALLOC_CFLAGS)
+
+if test x"$INCLUDED_TALLOC" != x"yes" ; then
+    AC_CHECK_HEADERS(talloc.h)
+    AC_CHECK_LIB(talloc, talloc_init, [ TALLOC_LIBS="-ltalloc" ])
+    if test x"$ac_cv_header_talloc_h" = x"no" -o x"$ac_cv_lib_talloc_talloc_init" = x"no" ; then
+        INCLUDED_TALLOC=yes
+        TALLOC_CFLAGS=""
+    else
+        INCLUDED_TALLOC=no
+    fi
+fi
+
+AC_MSG_CHECKING(whether to use included talloc)
+AC_MSG_RESULT($INCLUDED_TALLOC)
+if test x"$INCLUDED_TALLOC" != x"no" ; then
+    dnl find the talloc sources. This is meant to work both for 
+    dnl talloc standalone builds, and builds of packages using talloc
+    tallocdir=""
+    tallocpaths=". lib/talloc talloc ../talloc ../lib/talloc"
+    for d in $tallocpaths; do
+    	if test -f "$srcdir/$d/talloc.c"; then
+    		tallocdir="$d"
+    		AC_SUBST(tallocdir)
+    		break
+    	fi
+    done
+    if test x"$tallocdir" = "x"; then
+        AC_MSG_ERROR([cannot find talloc source in $tallocpaths])
+    fi
+    TALLOC_OBJ="talloc.o"
+    AC_SUBST(TALLOC_OBJ)
+
+    TALLOC_CFLAGS="-I$srcdir/$tallocdir"
+    AC_SUBST(TALLOC_CFLAGS)
+
+    TALLOC_LIBS=""
+    AC_SUBST(TALLOC_LIBS)
+fi
 
 AC_CHECK_SIZEOF(size_t,cross)
 AC_CHECK_SIZEOF(void *,cross)
diff --git a/lib/tdb/libtdb.m4 b/lib/tdb/libtdb.m4
index 3fe700f..dde4e0d 100644
--- a/lib/tdb/libtdb.m4
+++ b/lib/tdb/libtdb.m4
@@ -1,28 +1,52 @@
-dnl find the tdb sources. This is meant to work both for 
-dnl tdb standalone builds, and builds of packages using tdb
-tdbdir=""
-tdbpaths=". lib/tdb tdb ../tdb ../lib/tdb"
-for d in $tdbpaths; do
-	if test -f "$srcdir/$d/common/tdb.c"; then
-		tdbdir="$d"		
-		AC_SUBST(tdbdir)
-		break;
-	fi
-done
-if test x"$tdbdir" = "x"; then
-   AC_MSG_ERROR([cannot find tdb source in $tdbpaths])
-fi
-TDB_OBJ="common/tdb.o common/dump.o common/transaction.o common/error.o common/traverse.o"
-TDB_OBJ="$TDB_OBJ common/freelist.o common/freelistcheck.o common/io.o common/lock.o common/open.o common/check.o common/hash.o"
-AC_SUBST(TDB_OBJ)
-AC_SUBST(LIBREPLACEOBJ)
+dnl Check to see if we should use the included tdb
 
-TDB_LIBS=""
-AC_SUBST(TDB_LIBS)
+INCLUDED_TDB=auto
+AC_ARG_WITH(included-tdb,
+    [AC_HELP_STRING([--with-included-tdb], [use bundled tdb library, not from system])],
+    [ INCLUDED_TDB=$withval ])
 
-TDB_CFLAGS="-I$tdbdir/include"
+AC_SUBST(TDB_LIBS)
 AC_SUBST(TDB_CFLAGS)
 
+if test x"$INCLUDED_TDB" != x"yes" ; then
+    AC_CHECK_HEADERS(tdb.h)
+    AC_CHECK_LIB(tdb, tdb_transaction_write_lock_mark, [ TDB_LIBS="-ltdb" ])
+    if test x"$ac_cv_header_tdb_h" = x"no" -o x"$ac_cv_lib_tdb_tdb_transaction_write_lock_mark" = x"no" ; then
+        INCLUDED_TDB=yes
+        TDB_CFLAGS=""
+    else
+        INCLUDED_TDB=no
+    fi
+fi
+
+AC_MSG_CHECKING(whether to use included tdb)
+AC_MSG_RESULT($INCLUDED_TDB)
+if test x"$INCLUDED_TDB" != x"no" ; then
+    dnl find the tdb sources. This is meant to work both for 
+    dnl tdb standalone builds, and builds of packages using tdb
+    tdbdir=""
+    tdbpaths=". lib/tdb tdb ../tdb ../lib/tdb"
+    for d in $tdbpaths; do
+    	if test -f "$srcdir/$d/common/tdb.c"; then
+    		tdbdir="$d"		
+    		AC_SUBST(tdbdir)
+    		break;
+    	fi
+    done
+    if test x"$tdbdir" = "x"; then
+       AC_MSG_ERROR([cannot find tdb source in $tdbpaths])
+    fi
+    TDB_OBJ="common/tdb.o common/dump.o common/transaction.o common/error.o common/traverse.o"
+    TDB_OBJ="$TDB_OBJ common/freelist.o common/freelistcheck.o common/io.o common/lock.o common/open.o common/check.o common/hash.o"
+    AC_SUBST(TDB_OBJ)
+
+    TDB_LIBS=""
+    AC_SUBST(TDB_LIBS)
+
+    TDB_CFLAGS="-I$tdbdir/include"
+    AC_SUBST(TDB_CFLAGS)
+fi
+
 AC_CHECK_FUNCS(mmap pread pwrite getpagesize utime)
 AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h)
 
diff --git a/lib/tevent/libtevent.m4 b/lib/tevent/libtevent.m4
index 8bb969c..8a07eea 100644
--- a/lib/tevent/libtevent.m4
+++ b/lib/tevent/libtevent.m4
@@ -1,41 +1,59 @@
-dnl find the tevent sources. This is meant to work both for
-dnl standalone builds, and builds of packages using libtevent
+dnl Check to see if we should use the included tevent
 
-AC_SUBST(teventdir)
+INCLUDED_TEVENT=auto
+AC_ARG_WITH(included-tevent,
+    [AC_HELP_STRING([--with-included-tevent], [use bundled tevent library, not from system])],
+    [ INCLUDED_TEVENT=$withval ])
 
-if test x"$teventdir" = "x"; then
+AC_SUBST(TEVENT_LIBS)
+AC_SUBST(TEVENT_CFLAGS)
+
+if test x"$INCLUDED_TEVENT" != x"yes" ; then
+    AC_CHECK_HEADERS(tevent.h)
+    AC_CHECK_LIB(tevent, tevent_context_init, [ TEVENT_LIBS="-ltevent" ])
+    if test x"$ac_cv_header_tevent_h" = x"no" -o x"$ac_cv_lib_tevent_tevent_context_init" = x"no" ; then
+        INCLUDED_TEVENT=yes
+        TEVENT_CFLAGS=""
+    else
+        INCLUDED_TEVENT=no
+    fi
+fi
+
+AC_MSG_CHECKING(whether to use included tevent)
+AC_MSG_RESULT($INCLUDED_TEVENT)
+if test x"$INCLUDED_TEVENT" != x"no" ; then
+    dnl find the tevent sources. This is meant to work both for
+    dnl standalone builds, and builds of packages using libtevent
 	teventdir=""
 	teventpaths="$srcdir $srcdir/lib/tevent $srcdir/tevent $srcdir/../tevent"
 	for d in $teventpaths; do
 		if test -f "$d/tevent.c"; then
 			teventdir="$d"
-			break;
+            AC_SUBST(teventdir)
+			break
 		fi
 	done
 	if test x"$teventdir" = "x"; then
-	   AC_MSG_ERROR([cannot find libtevent source in $teventpaths])
+	   AC_MSG_ERROR([cannot find tevent source in $teventpaths])
 	fi
-fi
-
-TEVENT_OBJ=""
-TEVENT_CFLAGS=""
-TEVENT_LIBS=""
-AC_SUBST(TEVENT_OBJ)
-AC_SUBST(TEVENT_CFLAGS)
-AC_SUBST(TEVENT_LIBS)
+    TEVENT_OBJ="tevent.o tevent_debug.o tevent_util.o"
+    TEVENT_OBJ="$TEVENT_OBJ tevent_fd.o tevent_timed.o tevent_immediate.o tevent_signal.o"
+    TEVENT_OBJ="$TEVENT_OBJ tevent_req.o tevent_wakeup.o tevent_queue.o"
+    TEVENT_OBJ="$TEVENT_OBJ tevent_standard.o tevent_select.o"
+    AC_SUBST(TEVENT_OBJ)
 
-TEVENT_CFLAGS="-I$teventdir"
+    TEVENT_CFLAGS="-I$teventdir"
+    AC_SUBST(TEVENT_CFLAGS)
 
-TEVENT_OBJ="tevent.o tevent_debug.o tevent_util.o"
-TEVENT_OBJ="$TEVENT_OBJ tevent_fd.o tevent_timed.o tevent_immediate.o tevent_signal.o"
-TEVENT_OBJ="$TEVENT_OBJ tevent_req.o tevent_wakeup.o tevent_queue.o"
-TEVENT_OBJ="$TEVENT_OBJ tevent_standard.o tevent_select.o"
+    TEVENT_LIBS=""
+    AC_SUBST(TEVENT_LIBS)
 
-AC_CHECK_HEADERS(sys/epoll.h)
-AC_CHECK_FUNCS(epoll_create)
-if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x"yes"; then
-   TEVENT_OBJ="$TEVENT_OBJ tevent_epoll.o"
-   AC_DEFINE(HAVE_EPOLL, 1, [Whether epoll available])
+    AC_CHECK_HEADERS(sys/epoll.h)
+    AC_CHECK_FUNCS(epoll_create)
+    if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x"yes"; then
+        TEVENT_OBJ="$TEVENT_OBJ tevent_epoll.o"
+        AC_DEFINE(HAVE_EPOLL, 1, [Whether epoll available])
+    fi
 fi
 
 if test x"$VERSIONSCRIPT" != "x"; then
diff --git a/packaging/RPM/makerpms.sh b/packaging/RPM/makerpms.sh
index 370e7c8..e2f6051 100755
--- a/packaging/RPM/makerpms.sh
+++ b/packaging/RPM/makerpms.sh
@@ -44,6 +44,14 @@ SPECFILE="ctdb.spec"
 SPECFILE_IN="ctdb.spec.in"
 RPMBUILD="rpmbuild"
 
+mkdir -p `rpm --eval %_specdir`
+mkdir -p `rpm --eval %_sourcedir`
+mkdir -p `rpm --eval %_builddir`
+mkdir -p `rpm --eval %_srcrpmdir`
+mkdir -p `rpm --eval %_rpmdir`/noarch
+mkdir -p `rpm --eval %_rpmdir`/i386
+mkdir -p `rpm --eval %_rpmdir`/x86_64
+
 # We use tags and determine the version, as follows:
 # ctdb-0.9.1  (First release of 0.9).
 # ctdb-0.9.23 (23rd minor release of the 112 version)
diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index ac4163f..330daed 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -35,6 +35,10 @@ static int ctdb_lock_all_databases_mark(struct ctdb_context *ctdb, uint32_t prio
 {
 	struct ctdb_db_context *ctdb_db;
 
+	/* these are internal tdb functions */
+	int tdb_transaction_write_lock_mark(struct tdb_context *tdb);
+	int tdb_transaction_write_lock_unmark(struct tdb_context *tdb);
+
 	if ((priority < 1) || (priority > NUM_DB_PRIORITIES)) {
 		DEBUG(DEBUG_ERR,(__location__ " Illegal priority when trying to mark all databases Prio:%u\n", priority));
 		return -1;
@@ -90,6 +94,9 @@ static int ctdb_lock_all_databases_unmark(struct ctdb_context *ctdb, uint32_t pr
 {
 	struct ctdb_db_context *ctdb_db;
 
+	/* this is an internal tdb functions */
+	int tdb_transaction_write_lock_unmark(struct tdb_context *tdb);
+
 	if ((priority < 1) || (priority > NUM_DB_PRIORITIES)) {
 		DEBUG(DEBUG_ERR,(__location__ " Illegal priority when trying to mark all databases Prio:%u\n", priority));
 		return -1;
diff --git a/server/ctdb_update_record.c b/server/ctdb_update_record.c
index a4a6fc4..5845f1a 100644
--- a/server/ctdb_update_record.c
+++ b/server/ctdb_update_record.c
@@ -69,13 +69,13 @@ static int ctdb_persistent_store(struct ctdb_persistent_write_state *state)
 		   ctdb_ltdb_fetch will unconditionally create a record
 		 */
 		if (state->flags & UPDATE_FLAGS_REPLACE_ONLY) {
-			TDB_DATA rec;
-			rec = tdb_fetch(state->ctdb_db->ltdb->tdb, key);
-			if (rec.dsize == 0) {
+			TDB_DATA trec;
+			trec = tdb_fetch(state->ctdb_db->ltdb->tdb, key);
+			if (trec.dsize == 0) {
 				talloc_free(tmp_ctx);
 				continue;
 			}
-			free(rec.dptr);
+			free(trec.dptr);
 		}
 
 		/* fetch the old header and ensure the rsn is less than the new rsn */
diff --git a/tools/ctdb.c b/tools/ctdb.c
index d482eab..a56d579 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -1619,6 +1619,80 @@ static int control_rebalancenode(struct ctdb_context *ctdb, int argc, const char
 }
 
 
+static int rebalance_ip(struct ctdb_context *ctdb, ctdb_sock_addr *addr)
+{
+	struct ctdb_public_ip ip;
+	int ret;
+	uint32_t *nodes;
+	uint32_t disable_time;
+	TDB_DATA data;
+	struct ctdb_node_map *nodemap=NULL;
+	TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
+
+	disable_time = 30;
+	data.dptr  = (uint8_t*)&disable_time;
+	data.dsize = sizeof(disable_time);
+	ret = ctdb_client_send_message(ctdb, CTDB_BROADCAST_CONNECTED, CTDB_SRVID_DISABLE_IP_CHECK, data);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR,("Failed to send message to disable ipcheck\n"));
+		return -1;
+	}
+
+	ip.pnn  = -1;
+	ip.addr = *addr;
+
+	data.dptr  = (uint8_t *)&ip;
+	data.dsize = sizeof(ip);
+
+	ret = ctdb_ctrl_getnodemap(ctdb, TIMELIMIT(), options.pnn, tmp_ctx, &nodemap);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR, ("Unable to get nodemap from node %u\n", options.pnn));
+		talloc_free(tmp_ctx);
+		return ret;
+	}
+
+       	nodes = list_of_active_nodes(ctdb, nodemap, tmp_ctx, true);
+	ret = ctdb_client_async_control(ctdb, CTDB_CONTROL_RELEASE_IP,
+					nodes, 0,
+					LONGTIMELIMIT(),
+					false, data,
+					NULL, NULL,
+					NULL);
+	if (ret != 0) {
+		DEBUG(DEBUG_ERR,("Failed to release IP on nodes\n"));
+		talloc_free(tmp_ctx);
+		return -1;
+	}
+
+	talloc_free(tmp_ctx);
+	return 0;
+}
+
+/*
+  release an ip form all nodes and have it re-assigned by recd
+ */
+static int control_rebalanceip(struct ctdb_context *ctdb, int argc, const char **argv)
+{
+	ctdb_sock_addr addr;
+
+	if (argc < 1) {
+		usage();
+		return -1;


-- 
CTDB repository


More information about the samba-cvs mailing list