[SCM] CTDB repository - branch 1.2.40 updated - ctdb-1.2.50-3-g0b7027d

Amitay Isaacs amitay at samba.org
Mon Oct 1 20:59:53 MDT 2012


The branch, 1.2.40 has been updated
       via  0b7027db12ad83232e969c80e4ffbdcdb4a1adcd (commit)
       via  5e5a2df00c383c03e136d0c49dd586d556a25a0e (commit)
       via  e62756004d3c61696ffd706442bf9cbfcfbf41f5 (commit)
      from  a17316ab3a5ee3cd748b26863c55e82937edf013 (commit)

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


- Log -----------------------------------------------------------------
commit 0b7027db12ad83232e969c80e4ffbdcdb4a1adcd
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Oct 2 12:45:10 2012 +1000

    New version 1.2.51
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>

commit 5e5a2df00c383c03e136d0c49dd586d556a25a0e
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Sep 28 09:39:12 2012 +1000

    Logging: Map TEVENT_DEBUG_FATAL to DEBUG_CRIT
    
    This is currently mapped to DEBUG_EMERG.  CTDB really has no business
    logging anything at EMERG level since the whole system is not about to
    abort or catch fire.  EMERG causes the message to appear on the
    console and on every terminal.  That's a bit overzealous!
    
    There would be very few situations where logs are being filtered at
    level below ERROR, so CRIT should certainly suffice.
    
    The trigger for this was curious messages saying "No event for <n>
    seconds!" logged in a user's terminal.
    
    Pair-programmed-with: Amitay Isaacs <amitay at gmail.com>
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit e62756004d3c61696ffd706442bf9cbfcfbf41f5
Author: Martin Schwenke <martin at meltin.net>
Date:   Wed Sep 26 14:37:49 2012 +1000

    Eventscripts: "recovered" event should not fail on NATGW failure
    
    The recovery process has no protection against the "recovered" event
    failing, so this can cause a recovery loop.
    
    Instead of failing the "recovered" event, add a "monitor" event and
    fail that instead.  In this case the failure semantics are well
    defined.
    
    A separate patch should ban nodes if the "recovered" event fails for
    an unknown reason.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

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

Summary of changes:
 config/events.d/11.natgw   |   28 +++++++++++++++++++++++-----
 packaging/RPM/ctdb.spec.in |    5 ++++-
 server/ctdb_logging.c      |    4 ++--
 3 files changed, 29 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/11.natgw b/config/events.d/11.natgw
index c7ff289..075ad31 100755
--- a/config/events.d/11.natgw
+++ b/config/events.d/11.natgw
@@ -34,6 +34,24 @@ delete_all() {
 	iptables -D INPUT -p tcp --syn -d $_ip/32 -j REJECT 2>/dev/null
 }
 
+ensure_natgwmaster ()
+{
+    _event="$1"
+
+    NATGWMASTER=`ctdb natgwlist | head -1 | sed -e "s/ .*//"`
+
+    if [ "$NATGWMASTER" = "-1" ]; then
+	echo "There is no NATGW master node"
+	# The recovered event should never fail - we'll catch this
+	# failure in the monitor event.
+	if [ "$1" = "recovered" ] ; then
+	    exit 0
+	else
+	    exit 1
+	fi
+    fi
+}
+
 case "$1" in 
     startup)
 	[ -z "$CTDB_PUBLIC_ADDRESSES" ] && {
@@ -51,7 +69,6 @@ case "$1" in
 
     recovered|updatenatgw|ipreallocated)
 	MYPNN=`ctdb pnn | cut -d: -f2`
-	NATGWMASTER=`ctdb natgwlist | head -1 | sed -e "s/ .*//"`
 	NATGWIP=`ctdb natgwlist | head -1 | sed -e "s/^[^ ]* *//"`
 
 	CTDB_NATGW_PUBLIC_IP_HOST=`echo $CTDB_NATGW_PUBLIC_IP | sed -e "s/\/.*/\/32/"`
@@ -61,10 +78,7 @@ case "$1" in
 	iptables -I INPUT -p tcp --syn -d $CTDB_NATGW_PUBLIC_IP_HOST -j REJECT 2>/dev/null 
 
 
-	if [ "$NATGWMASTER" = "-1" ]; then
-		echo "There is no NATGW master node"
-		exit 1
-	fi
+	ensure_natgwmaster "$1"
 
 	delete_all
 
@@ -101,6 +115,10 @@ case "$1" in
 	delete_all
 	;;
 
+    monitor)
+	ensure_natgwmaster "$1"
+	;;
+
     *)
 	ctdb_standard_event_handler "@"
 	;;
diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index 2548eba..d057b34 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -3,7 +3,7 @@ Name: ctdb
 Summary: Clustered TDB
 Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
-Version: 1.2.50
+Version: 1.2.51
 Release: 1GITHASH
 Epoch: 0
 License: GNU GPL version 3
@@ -146,6 +146,9 @@ development libraries for ctdb
 
 %changelog
 
+* Tue Oct 02 2012 : Version 1.2.51
+  - NATGW eventscript does not fail on recovered in case of misconfiguration
+  - Map TEVENT_DEBUG_FATAL to DEBUG_CRIT
 * Wed Sep 12 2012 : Version 1.2.50
   - Add utility function to dump core and use it for "unknown family, 0" error
 * Tue Aug 21 2012 : Version 1.2.49
diff --git a/server/ctdb_logging.c b/server/ctdb_logging.c
index 2637ad7..0b32d85 100644
--- a/server/ctdb_logging.c
+++ b/server/ctdb_logging.c
@@ -560,11 +560,11 @@ static void ctdb_tevent_logging(void *private_data,
 				const char *fmt,
 				va_list ap)
 {
-	enum debug_level lvl = DEBUG_EMERG;
+	enum debug_level lvl = DEBUG_CRIT;
 
 	switch (level) {
 	case TEVENT_DEBUG_FATAL:
-		lvl = DEBUG_EMERG;
+		lvl = DEBUG_CRIT;
 		break;
 	case TEVENT_DEBUG_ERROR:
 		lvl = DEBUG_ERR;


-- 
CTDB repository


More information about the samba-cvs mailing list