The branch, 1.2-nodeflags has been updated via 2a3872827e3ffda166191fc6ad09144a11d5041c (commit) via 8d47bb47e10fc9caef1a3ea239575dfef61e0a67 (commit) via 52593fcb06b3dfd319da41f1bd5efdfc3b618ee1 (commit) from 976a94c06d1531ddbdb86edc4dae3e28824ae515 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=1.2-nodeflags - Log ----------------------------------------------------------------- commit 2a3872827e3ffda166191fc6ad09144a11d5041c Author: Ronnie Sahlberg <ronniesahlb...@gmail.com> Date: Mon Oct 18 11:57:38 2010 +1100 remove checking for filesystems and filesystem health from the cnfs script. remove the gpfsmount and gpfsumount entry points commit 8d47bb47e10fc9caef1a3ea239575dfef61e0a67 Author: Ronnie Sahlberg <ronniesahlb...@gmail.com> Date: Thu Oct 14 09:49:23 2010 +1100 If tdb_open() fails when trying to open the vacuuming database, print errno so we get some idea of why this failed. commit 52593fcb06b3dfd319da41f1bd5efdfc3b618ee1 Author: Ronnie Sahlberg <ronniesahlb...@gmail.com> Date: Thu Oct 14 08:12:41 2010 +1100 try to restart NFS LOCKD if it failed to start ----------------------------------------------------------------------- Summary of changes: config/events.d/60.nfs | 7 ++++- config/events.d/62.cnfs | 74 ----------------------------------------------- config/functions | 8 +++++ server/ctdb_vacuum.c | 2 +- 4 files changed, 15 insertions(+), 76 deletions(-) Changeset truncated at 500 lines: diff --git a/config/events.d/60.nfs b/config/events.d/60.nfs index cd5219a..ed96ab8 100755 --- a/config/events.d/60.nfs +++ b/config/events.d/60.nfs @@ -79,7 +79,12 @@ case "$1" in } || exit $? # check that lockd responds to rpc requests - ctdb_check_rpc "lockd" 100021 1 + (ctdb_check_rpc "lockd" 100021 1) + [ $? = "0" ] || { + echo "Trying to restart lock manager service" + startstop_nfslock restart + exit 1 + } # mount needs special handling since it is sometimes not started # correctly on RHEL5 diff --git a/config/events.d/62.cnfs b/config/events.d/62.cnfs index e0af722..af4ecc3 100755 --- a/config/events.d/62.cnfs +++ b/config/events.d/62.cnfs @@ -8,20 +8,8 @@ loadconfig STATEDIR=$CTDB_VARDIR/state/gpfs -# filesystems needed by nfs -NFS_FSS=`cat /etc/exports | egrep -v "^#" | sed -e "s/[ \t]*[^ \t]*$//" -e "s/\"//g"` - - - check_if_healthy() { mkdir -p $STATEDIR/fs - FS=`(cd $STATEDIR/fs ; ls )` - [ -z "$FS" ] || { - MISSING=`echo $FS | sed -e "s/@/\//g"` - logger Filesystems required for NFS are missing. Node is UNHEALTHY. [$MISSING] - $CTDB_BASE/events.d/62.cnfs unhealthy "GPFS filesystems required for NFS are not mounted : [$MISSING]" - exit 0 - } [ -f "$STATEDIR/gpfsnoquorum" ] && { logger No GPFS quorum. Node is UNHEALTHY @@ -40,64 +28,6 @@ case "$1" in ;; - # This event is called from the GPFS callbacks when a filesystem is - # unmounted - gpfsumount) - # is this a filesystem we need for nfs? - echo "$NFS_FSS" | egrep "^$2" >/dev/null || { - # no - exit 0 - } - - logger "GPFS unmounted filesystem $2 used by NFS. Mark node as UNHEALTHY" - - MFS=`echo $2 | sed -e "s/\//@/g"` - mkdir -p $STATEDIR/fs - touch "$STATEDIR/fs/$MFS" - $CTDB_BASE/events.d/62.cnfs unhealthy "GPFS unmounted filesystem $2 used by NFS" - ;; - - # This event is called from the GPFS callbacks when a filesystem is - # mounted - gpfsmount) - # is this a filesystem we need for nfs? - echo "$NFS_FSS" | egrep "^$2" >/dev/null || { - # no - exit 0 - } - - logger "GPFS mounted filesystem $2 used by NFS." - - MFS=`echo $2 | sed -e "s/\//@/g"` - mkdir -p $STATEDIR/fs - rm -f "$STATEDIR/fs/$MFS" - - check_if_healthy - ;; - - - - # This event is called from the gpfs callback when GPFS is being shutdown. - gpfsshutdown) - logger "GPFS is shutting down. Marking node as UNHEALTHY and trigger a CTDB failover" - $CTDB_BASE/events.d/62.cnfs unhealthy "GPFS was shut down!" - ;; - - - # This event is called from the gpfs callback when GPFS has started. - # It checks that all required NFS filesystems are mounted - # and flags the node healthy if so. - gpfsstartup) - # assume we always have quorum when starting - # we are only interested in the case when we explicitely - # lost quorum in an otherwise happy cluster - mkdir -p $STATEDIR - rm -f "$STATEDIR/gpfsnoquorum" - logger "GPFS is is started." - check_if_healthy - ;; - - gpfsquorumreached) mkdir -p $STATEDIR rm -f "$STATEDIR/gpfsnoquorum" @@ -112,10 +42,6 @@ case "$1" in $CTDB_BASE/events.d/62.cnfs unhealthy "GPFS quorum was lost! Marking node as UNHEALTHY." ;; - - - - unhealthy) # Mark the node as UNHEALTHY which means all public addresses # will be migrated off the node. diff --git a/config/functions b/config/functions index 9771905..9659d48 100755 --- a/config/functions +++ b/config/functions @@ -417,6 +417,10 @@ startstop_nfslock() { stop) service nfsserver stop > /dev/null 2>&1 ;; + restart) + service nfsserver stop + service nfsserver start + ;; esac ;; rhel) @@ -427,6 +431,10 @@ startstop_nfslock() { stop) service nfslock stop > /dev/null 2>&1 ;; + restart) + service nfslock stop + service nfslock start + ;; esac ;; *) diff --git a/server/ctdb_vacuum.c b/server/ctdb_vacuum.c index b0c7d40..4104853 100644 --- a/server/ctdb_vacuum.c +++ b/server/ctdb_vacuum.c @@ -702,7 +702,7 @@ static int get_vacuum_interval(struct ctdb_db_context *ctdb_db) flags, O_RDWR|O_CREAT, 0600); if (!tdb) { - DEBUG(DEBUG_ERR,("Unable to open/create database %s using default interval\n", vac_dbname)); + DEBUG(DEBUG_ERR,("Unable to open/create database %s using default interval. Errno : %s (%d)\n", vac_dbname, strerror(errno), errno)); talloc_free(tmp_ctx); return interval; } -- CTDB repository