[SCM] CTDB repository - branch master updated - ctdb-1.10-67-g5be8610

Ronnie Sahlberg sahlberg at samba.org
Mon Jan 10 23:24:58 MST 2011


The branch, master has been updated
       via  5be8610ffa33db49e33949560d0ef2fa5f3c0c73 (commit)
       via  0f462e9e9fe12b595f3c7452123db8e69548abd6 (commit)
       via  c4f9e8a43540bc049b2771e0a2d76d37b9d17331 (commit)
       via  8bcf7ab164429ddc0ae530133e114f186a8146dd (commit)
       via  a9bf4f82852975b0b627f61ceb2d23401f630805 (commit)
      from  38dc1ac2e87416a22c9356596286b773d601e71c (commit)

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


- Log -----------------------------------------------------------------
commit 5be8610ffa33db49e33949560d0ef2fa5f3c0c73
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jan 11 17:13:57 2011 +1100

    Eventscripts: lower the fail/restart limits for nfsd.
    
    We were potentially leaving a node unable to serve requests for too
    long.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 0f462e9e9fe12b595f3c7452123db8e69548abd6
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jan 11 17:13:06 2011 +1100

    Eventscripts: use "startstop_nfs restart" to reconfigure NFS.
    
    This was defaulting to just "service nfs restart", which doesn't have
    the workarounds we need.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit c4f9e8a43540bc049b2771e0a2d76d37b9d17331
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jan 11 17:12:03 2011 +1100

    Eventscripts: only autostart during a monitor event.
    
    Otherwise we might short-circuit events that are run only once and
    actually need to do something.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit 8bcf7ab164429ddc0ae530133e114f186a8146dd
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jan 11 17:10:55 2011 +1100

    Eventscripts: print a message when reconfiguring a service.
    
    Otherwise there can be strange error messages from services
    stopping/starting, without any context.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

commit a9bf4f82852975b0b627f61ceb2d23401f630805
Author: Martin Schwenke <martin at meltin.net>
Date:   Tue Jan 11 17:06:48 2011 +1100

    Eventscripts: work around NFS restart failure under load.
    
    "service nfs restart" can fail.  To stop nfsd it sends a SIGINT and
    nfsd might take a while to process it if the system is loaded.
    Starting nfsd may then fail because resources are still in use.
    
    This does some /proc magic to tell nfsd to do no more processing.  It
    then runs service stop, kills nfsd with SIGKILL, and then runs service
    start.  This is much less likely to fail.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>

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

Summary of changes:
 config/events.d/60.nfs |    5 +++--
 config/functions       |   17 ++++++++++++++---
 2 files changed, 17 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/60.nfs b/config/events.d/60.nfs
index c473be8..79a071b 100755
--- a/config/events.d/60.nfs
+++ b/config/events.d/60.nfs
@@ -14,6 +14,7 @@ start_nfs() {
 service_name="nfs"
 service_start="start_nfs"
 service_stop="startstop_nfs stop"
+service_reconfigure="startstop_nfs restart"
 
 loadconfig
 
@@ -88,13 +89,13 @@ case "$1" in
 			service_name="nfs_knfsd"
 			ctdb_counter_incr
 
-			ctdb_check_counter_equal 10 || {
+			ctdb_check_counter_equal 2 || {
 				echo "Trying to restart NFS service"
 				startstop_nfs restart >/dev/null 2>&1 &
 				exit 0
 			}
 
-			ctdb_check_counter_limit 15 quiet >/dev/null
+			ctdb_check_counter_limit 5 quiet >/dev/null
 		) || {
 			echo "$ctdb_check_rpc_out"
 			echo "Trying to restart NFS service"
diff --git a/config/functions b/config/functions
index 4dc645b..6c44fb8 100755
--- a/config/functions
+++ b/config/functions
@@ -375,7 +375,10 @@ startstop_nfs() {
 			service nfsserver stop > /dev/null 2>&1
 			;;
 		restart)
-			service nfsserver restart
+			echo 0 >/proc/fs/nfsd/threads
+			service nfsserver stop > /dev/null 2>&1
+			pkill -9 nfsd
+			service nfsserver start
 			;;
 		esac
 		;;
@@ -390,8 +393,12 @@ startstop_nfs() {
 			service nfslock stop > /dev/null 2>&1
 			;;
 		restart)
-			service nfslock restart
-			service nfs restart
+			echo 0 >/proc/fs/nfsd/threads
+			service nfs stop > /dev/null 2>&1
+			service nfslock stop > /dev/null 2>&1
+			pkill -9 nfsd
+			service nfslock start
+			service nfs start
 			;;
 		esac
 		;;
@@ -644,6 +651,7 @@ ctdb_service_unset_reconfigure ()
 
 ctdb_service_reconfigure ()
 {
+    echo "Reconfiguring service \"$service_name\"..."
     if [ -n "$service_reconfigure" ] ; then
 	eval $service_reconfigure
     else
@@ -684,6 +692,8 @@ ctdb_start_stop_service ()
 {
     _service_name="${1:-${service_name}}"
 
+    [ "$event_name" = "monitor" ] || return 0
+
     _active="$ctdb_active_dir/$_service_name"
     if is_ctdb_managed_service "$_service_name"; then
 	if ! [ -e "$_active" ] ; then
@@ -879,3 +889,4 @@ update_tickles ()
 script_name="${0##*/}"       # basename
 service_name="$script_name"  # default is just the script name
 service_fail_limit=1
+event_name="$1"


-- 
CTDB repository


More information about the samba-cvs mailing list