[SCM] CTDB repository - branch 1.2 updated - ctdb-1.9.1-290-gc12e749

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


The branch, 1.2 has been updated
       via  c12e749e84f1ef1f5b5d8a26900f1d5c74e2319a (commit)
       via  3fd4da153703bc83cf102ad367dd20d873e938a0 (commit)
       via  fcb05df6aa47bfe65a05724abfcdf7baf350d085 (commit)
       via  484bf2966f415a37dc6ab35288e8a27839274681 (commit)
       via  672fd18647ba12d5dca504422b35776a4fa92396 (commit)
      from  7f14b5ea1ab723fc5e56df924e09c5df7846e671 (commit)

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


- Log -----------------------------------------------------------------
commit c12e749e84f1ef1f5b5d8a26900f1d5c74e2319a
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 3fd4da153703bc83cf102ad367dd20d873e938a0
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 fcb05df6aa47bfe65a05724abfcdf7baf350d085
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 484bf2966f415a37dc6ab35288e8a27839274681
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 672fd18647ba12d5dca504422b35776a4fa92396
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