[SCM] CTDB repository - branch master updated - ctdb-1.0.113-75-g627a6d6

Ronnie Sahlberg sahlberg at samba.org
Mon Feb 8 19:31:22 MST 2010


The branch, master has been updated
       via  627a6d67a0e9e61f8713e62695b3518c51909230 (commit)
      from  f63c091f12f8d582e9518673365c7c52479c470c (commit)

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


- Log -----------------------------------------------------------------
commit 627a6d67a0e9e61f8713e62695b3518c51909230
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Tue Feb 9 12:46:35 2010 +1030

    event scripts: add logging for low memory conditions
    
    We should never enter swap; if we do, show the memory state of the machine and the process list.  This will help us diagnose what caused the condition before it's too late and the box starts OOM-killing processes.
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

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

Summary of changes:
 config/events.d/00.ctdb |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/config/events.d/00.ctdb b/config/events.d/00.ctdb
index 1d4c145..ed8f9f2 100755
--- a/config/events.d/00.ctdb
+++ b/config/events.d/00.ctdb
@@ -29,11 +29,21 @@ case "$1" in
 	;;
 
     monitor)
+	# We should never enter swap, so SwapTotal == SwapFree.
+	if [ -n "`grep '^Swap\(Total\|Free\)' /proc/meminfo | uniq -s 10 -u`" ]; then
+	    echo We are swapping:
+	    cat /proc/meminfo
+	    ps auxfww
+	fi
+
 	# monitor that we are not running out of memory
 	[ -z "$CTDB_MONITOR_FREE_MEMORY" ] || {
 		FREE_MEM=`free -m | grep "buffers/cache" | while read A B C D ;do /bin/echo -n $D ; done`
 		[ `expr "$FREE_MEM" "<" "$CTDB_MONITOR_FREE_MEMORY"` != "0" ] && {
 			echo "OOM. Free:$FREE_MEM while CTDB treshold is $CTDB_MONITOR_FREE_MEMORY"
+			cat /proc/meminfo
+			ps auxfww
+			echo m > /proc/sysrq-trigger
 			ctdb disable
 			sleep 3
 			ctdb shutdown


-- 
CTDB repository


More information about the samba-cvs mailing list