[SCM] CTDB repository - branch 1.2-nodeflags updated - ctdb-1.9.1-274-g01ab6b9

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


The branch, 1.2-nodeflags has been updated
       via  01ab6b99d463a3f8796b1108b4ec849ba8348f66 (commit)
       via  d4943b5209007abc8aeee0fc1c5d2c13ca04db6e (commit)
       via  c3a67d3887cbba1ec836564a15a9eb4d2c000599 (commit)
       via  d0cc5fd41c8b4c0052567ccd803b7e2be8dff4ae (commit)
       via  68026dc394c5fa1bd3f477523fadcf6f4c21fc26 (commit)
      from  e2b22278817b8c27e682fcd2b3a69fdd09754bf7 (commit)

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


- Log -----------------------------------------------------------------
commit 01ab6b99d463a3f8796b1108b4ec849ba8348f66
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 d4943b5209007abc8aeee0fc1c5d2c13ca04db6e
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 c3a67d3887cbba1ec836564a15a9eb4d2c000599
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 d0cc5fd41c8b4c0052567ccd803b7e2be8dff4ae
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 68026dc394c5fa1bd3f477523fadcf6f4c21fc26
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