[SCM] CTDB repository - branch master updated - ctdb-1.0.93-17-g3501d6b

Ronnie Sahlberg sahlberg at samba.org
Mon Oct 12 01:54:15 MDT 2009


The branch, master has been updated
       via  3501d6b70bd905d6fdc4e74fe2cedc3ba77e4b86 (commit)
       via  5974b5f7998ef96aeadb7377f32ef1ab85bb5943 (commit)
       via  c1d7c11978d27d2ee41a2129b31d9ab61a43f8da (commit)
       via  5f14874c5c705dd637f88a77f30c930fea1201d2 (commit)
       via  eb1fecaef9aa5cb85dff7d4f7af8a9878deabed8 (commit)
       via  318abeb4b913a8d846e7eaf4cf5c2a67b61ce974 (commit)
      from  b2ce8b900a7d00944c84e0574fea5b371064a06d (commit)

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


- Log -----------------------------------------------------------------
commit 3501d6b70bd905d6fdc4e74fe2cedc3ba77e4b86
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Oct 12 18:53:20 2009 +1100

    new version 1.0.95

commit 5974b5f7998ef96aeadb7377f32ef1ab85bb5943
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Oct 12 18:41:57 2009 +1100

    use the correct expected size for thew _cancel control

commit c1d7c11978d27d2ee41a2129b31d9ab61a43f8da
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Oct 12 18:31:59 2009 +1100

    add a dispatch to the recovery transaction cancel call

commit 5f14874c5c705dd637f88a77f30c930fea1201d2
Merge: b2ce8b900a7d00944c84e0574fea5b371064a06d eb1fecaef9aa5cb85dff7d4f7af8a9878deabed8
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Oct 12 16:51:36 2009 +1100

    Merge commit 'martins/master'

commit eb1fecaef9aa5cb85dff7d4f7af8a9878deabed8
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Oct 12 16:32:49 2009 +1100

    Clean up ctdb_check_directories* eventscript functions.
    
    There are 2 problems with this code:
    
    * The loop in ctdb_check_directories_probe() breaks on filenames
      containing whitespace.
    
      The fix to protect them is to pass "$@" to this function and have it
      operate on "$@".
    
      Note that there's still a problem with whitespace in filenames in
      the 50.samba eventscript.  To fix this ctdb_check_directories_probe
      should read the filenames from stdin.  Another time...
    
    * The check for '%' in filenames in ctdb_check_directories_probe()
      ends up involving several forks.  On a modern machine this can cost
      a couple of minutes when checking a large number of directories.
    
      The fix is to use a case statement.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 318abeb4b913a8d846e7eaf4cf5c2a67b61ce974
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Oct 12 16:17:37 2009 +1100

    40.vsftpd: reset the fail counter in the "recovered" event.
    
    Each recovery that involves IP reassignments results in a restart of
    vsftpd in the "recovered" event.  Currently, we can have several
    recoveries in quick succession and the "monitor" event following each
    can fail because vsftpd isn't ready yet.  This results in cumulative
    failures, so the node is marked unhealthy, even though vsftpd has
    never had a proper opportunity to become ready.
    
    This resets the fail count after each recovery.
    
    While we're here, also move the delete of the restart flag file into
    the body of the conditional.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

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

Summary of changes:
 config/events.d/40.vsftpd |    4 ++--
 config/functions          |   21 +++++++++++----------
 packaging/RPM/ctdb.spec   |    9 ++++++++-
 server/ctdb_control.c     |    5 +++++
 4 files changed, 26 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/40.vsftpd b/config/events.d/40.vsftpd
index bec7862..315c150 100755
--- a/config/events.d/40.vsftpd
+++ b/config/events.d/40.vsftpd
@@ -44,9 +44,9 @@ case $cmd in
 	[ -f $CTDB_BASE/state/vsftpd/restart ] && {
 		service vsftpd stop > /dev/null 2>&1
 		service vsftpd start
+		/bin/rm -f $CTDB_BASE/state/vsftpd/restart 2>/dev/null
+		ctdb_counter_init "$VSFTPD_FAILS"
 	} >/dev/null 2>&1
-
-	/bin/rm -f $CTDB_BASE/state/vsftpd/restart 2>/dev/null
 	;;
 
      monitor)
diff --git a/config/functions b/config/functions
index bec4815..1117189 100644
--- a/config/functions
+++ b/config/functions
@@ -167,17 +167,20 @@ ctdb_check_rpc() {
 
 ######################################################
 # check a set of directories is available
-# return 0 on a missing directory
+# return 1 on a missing directory
 # usage: ctdb_check_directories_probe SERVICE_NAME <directories...>
 ######################################################
 ctdb_check_directories_probe() {
   service_name="$1"
   shift
-  wait_dirs="$*"
-  [ -z "$wait_dirs" ] && return;
-  for d in $wait_dirs; do
-      ( echo $d | grep -q '%' ) && continue
-      [ -d $d ] || return 1
+  for d ; do
+      case "$d" in
+	  *%*)
+	      continue
+	      ;;
+	  *)
+	      [ -d "$d" ] || return 1
+      esac
   done
   return 0
 }
@@ -187,10 +190,8 @@ ctdb_check_directories_probe() {
 # usage: ctdb_check_directories SERVICE_NAME <directories...>
 ######################################################
 ctdb_check_directories() {
-  service_name="$1"
-  shift
-  wait_dirs="$*"
-  ctdb_check_directories_probe "$service_name" $wait_dirs || {
+  # Note: ctdb_check_directories_probe sets both $service_name and $d.
+  ctdb_check_directories_probe "$@" || {
       echo "ERROR: $service_name directory $d not available"
       exit 1
   }
diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index 8e68200..4582967 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -4,7 +4,7 @@ Summary: Clustered TDB
 Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
 Name: ctdb
-Version: 1.0.94
+Version: 1.0.95
 Release: 1
 Epoch: 0
 License: GNU GPL version 3
@@ -132,6 +132,13 @@ fi
 %{_libdir}/pkgconfig/ctdb.pc
 
 %changelog
+* Mon Oct 12 2009 : Version 1.0.95
+ - Add database priorities. Allow samba to set the priority of databases
+   and lock the databases in priority order during recovery
+   to avoid a deadlock when samba locks one database then blocks indefinitely
+   while waiting for the second databaso to become locked.
+ - Be aggressive and ban nodes where the recovery transaction start call
+   fails.
 * Thu Oct 10 2009 : Version 1.0.94
  - Be very aggressive and quickly ban nodes that can not freeze their databases
 * Tue Oct 8 2009 : Version 1.0.93
diff --git a/server/ctdb_control.c b/server/ctdb_control.c
index 57641e7..24d22d0 100644
--- a/server/ctdb_control.c
+++ b/server/ctdb_control.c
@@ -471,6 +471,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
 			ctdb->recovery_lock_file = talloc_strdup(ctdb, discard_const(indata.dptr));
 		}
 		return 0;
+
 	case CTDB_CONTROL_STOP_NODE:
 		CHECK_CONTROL_DATA_SIZE(0);
 		return ctdb_control_stop_node(ctdb, c, async_reply);
@@ -547,6 +548,10 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
 		return ctdb_db->priority;
 	}
 
+	case CTDB_CONTROL_TRANSACTION_CANCEL:
+		CHECK_CONTROL_DATA_SIZE(0);
+		return ctdb_control_transaction_cancel(ctdb);
+
 	default:
 		DEBUG(DEBUG_CRIT,(__location__ " Unknown CTDB control opcode %u\n", opcode));
 		return -1;


-- 
CTDB repository


More information about the samba-cvs mailing list