[SCM] Samba Shared Repository - branch master updated

Amitay Isaacs amitay at samba.org
Thu Apr 30 01:25:03 MDT 2015


The branch, master has been updated
       via  e359d82 ctdb-scripts: Add alternative network family monitoring for NFS
       via  f6af2d9 ctdb-scripts: Run tdb checker under timeout command
       via  83f3a35 ctdb-scripts: Add new configuration variable CTDB_MAX_OPEN_FILES
      from  72090dc s4: torture: Fix uninitialized variable.

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e359d826a42656bb02ca2ab85f0fa886a046cb58
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Apr 28 13:51:00 2015 +1000

    ctdb-scripts: Add alternative network family monitoring for NFS
    
    For example, adding a file called nfs-rpc-checks.d/20.nfsd at udp.check
    will cause NFS to be checked on UDP as well, using a separate counter.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Amitay Isaacs <amitay at gmail.com>
    
    Autobuild-User(master): Amitay Isaacs <amitay at samba.org>
    Autobuild-Date(master): Thu Apr 30 09:24:12 CEST 2015 on sn-devel-104

commit f6af2d96c275ad7614671aabac1e21f9d58b1585
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Apr 28 23:15:37 2015 +1000

    ctdb-scripts: Run tdb checker under timeout command
    
    If tdb database file size grows beyond 4GB, tdbtool/tdbdump can hang
    indefinitely.  This will prevent CTDB from starting up.
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

commit 83f3a356453c40261951e7703a4b19a85ba52b8b
Author: Amitay Isaacs <amitay at gmail.com>
Date:   Tue Apr 28 23:04:53 2015 +1000

    ctdb-scripts: Add new configuration variable CTDB_MAX_OPEN_FILES
    
    Signed-off-by: Amitay Isaacs <amitay at gmail.com>
    Reviewed-by: Martin Schwenke <martin at meltin.net>

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

Summary of changes:
 ctdb/config/ctdb.sysconfig   |  2 +-
 ctdb/config/ctdbd_wrapper    |  4 ++++
 ctdb/config/events.d/00.ctdb |  4 ++--
 ctdb/config/functions        | 19 +++++++++++++++----
 ctdb/doc/ctdbd.conf.5.xml    | 12 ++++++++++++
 5 files changed, 34 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/config/ctdb.sysconfig b/ctdb/config/ctdb.sysconfig
index 9541d50..0a3a23e 100644
--- a/ctdb/config/ctdb.sysconfig
+++ b/ctdb/config/ctdb.sysconfig
@@ -20,7 +20,7 @@ CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
 # CTDB_MANAGES_NFS=yes
 
 # Raise the file descriptor limit for CTDB?
-# ulimit -n 10000
+# CTDB_MAX_OPEN_FILES=10000
 
 # Default is to use the log file below instead of syslog.
 # CTDB_LOGGING=file:/var/log/log.ctdb
diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper
index aac8369..c5fe004 100755
--- a/ctdb/config/ctdbd_wrapper
+++ b/ctdb/config/ctdbd_wrapper
@@ -176,6 +176,10 @@ start()
 	ulimit -c unlimited
     fi
 
+    if [ -n "$CTDB_MAX_OPEN_FILES" ]; then
+	ulimit -n $CTDB_MAX_OPEN_FILES
+    fi
+
     mkdir -p $(dirname "$pidfile")
 
     if [ -n "$CTDB_VALGRIND" -a "$CTDB_VALGRIND" != "no" ] ; then
diff --git a/ctdb/config/events.d/00.ctdb b/ctdb/config/events.d/00.ctdb
index 0688411..d8096ee 100755
--- a/ctdb/config/events.d/00.ctdb
+++ b/ctdb/config/events.d/00.ctdb
@@ -50,14 +50,14 @@ check_tdb ()
 
     if $use_tdb_tool_check ; then
 	# tdbtool always exits with 0  :-(
-	if tdbtool "$_db" check 2>/dev/null |
+	if timeout 10 tdbtool "$_db" check 2>/dev/null |
 	    grep -q "Database integrity is OK" ; then
 	    return 0
 	else
 	    return 1
 	fi
     else
-	tdbdump "$_db" >/dev/null 2>/dev/null
+	timeout 10 tdbdump "$_db" >/dev/null 2>/dev/null
 	return $?
     fi
 }
diff --git a/ctdb/config/functions b/ctdb/config/functions
index 96da817..340b1e5 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -299,7 +299,16 @@ nfs_check_rpc_services ()
 	_t="${_f%.check}"
 	_prog_name="${_t##*/[0-9][0-9].}"
 
-	if _nfs_check_rpc_common "$_prog_name" ; then
+	# If $_prog_name contains '@' then the bit after it is the
+	# address family.
+	_family="${_prog_name#*@}"
+	if [ "$_family" = "$_prog_name" ] ; then
+	    _family=""
+	else
+	    _prog_name="${_prog_name%@*}"
+	fi
+
+	if _nfs_check_rpc_common "$_prog_name" "$_family" ; then
 	    # This RPC service is up, check next service...
 	    continue
 	fi
@@ -323,6 +332,7 @@ nfs_check_rpc_services ()
 _nfs_check_rpc_common ()
 {
     _prog_name="$1"
+    _family="$2"
 
     # Some platforms don't have separate programs for all services.
     case "$_prog_name" in
@@ -356,9 +366,9 @@ _nfs_check_rpc_common ()
 	    exit 1
     esac
 
-    _service_name="nfs_${_prog_name}"
+    _service_name="nfs_${_prog_name}${_family:+_}${_family}"
 
-    if ctdb_check_rpc "$_rpc_prog" $_version >/dev/null ; then
+    if ctdb_check_rpc "$_rpc_prog" "$_version" "$_family" >/dev/null ; then
 	ctdb_counter_init "$_service_name"
 	return 0
     fi
@@ -460,10 +470,11 @@ ctdb_check_rpc ()
 {
     progname="$1"
     version="$2"
+    _family="${3:-tcp}"
 
     _localhost="${CTDB_RPCINFO_LOCALHOST:-127.0.0.1}"
 
-    if ! ctdb_check_rpc_out=$(rpcinfo -T tcp $_localhost $progname $version 2>&1) ; then
+    if ! ctdb_check_rpc_out=$(rpcinfo -T $_family $_localhost $progname $version 2>&1) ; then
 	ctdb_check_rpc_out="ERROR: $progname failed RPC check:
 $ctdb_check_rpc_out"
 	echo "$ctdb_check_rpc_out"
diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml
index cc56d79..bb44317 100644
--- a/ctdb/doc/ctdbd.conf.5.xml
+++ b/ctdb/doc/ctdbd.conf.5.xml
@@ -1631,6 +1631,18 @@ CTDB_SET_MonitorInterval=20
       </varlistentry>
 
       <varlistentry>
+	<term>CTDB_MAX_OPEN_FILES=<parameter>NUM</parameter></term>
+	<listitem>
+	  <para>
+	    NUM is the maximum number of open files.
+	  </para>
+	  <para>
+	    There is no default.
+	  </para>
+	</listitem>
+      </varlistentry>
+
+      <varlistentry>
 	<term>CTDB_RC_LOCAL=<parameter>FILENAME</parameter></term>
 	<listitem>
 	  <para>


-- 
Samba Shared Repository


More information about the samba-cvs mailing list