From dbc66d054bfe2acbf8eb3bee57b05ef3fed9f734 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Tue, 10 Jul 2007 09:45:14 +1000 Subject: dont restart the tcp service after a ip takeover, it is more efficient to just kill off the tcp connections (This used to be ctdb commit bc481c3f1a44c50648488c4f8a7f15ec395d446f) --- ctdb/config/events.d/60.nfs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/ctdb/config/events.d/60.nfs b/ctdb/config/events.d/60.nfs index 48b50f126b..47f8a903a6 100755 --- a/ctdb/config/events.d/60.nfs +++ b/ctdb/config/events.d/60.nfs @@ -61,12 +61,18 @@ case $cmd in ;; recovered) - # restart NFS to ensure that all TCP connections to the released ip - # are closed + # RST all tcp connections used for NFS to ensure that they do + # not survive in ESTABLISHED state across a failover/failback + # and create an ack storm [ -f /etc/ctdb/state/nfs/restart ] && { - ( service nfs status > /dev/null 2>&1 && - service nfs restart > /dev/null 2>&1 && - service nfslock restart > /dev/null 2>&1 ) & + netstat -tn |egrep '^tcp.*\s+[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:2049\s+.*ESTABLISHED' | awk '{print $4" "$5}' | while read dest src; do + srcip=`echo $src | cut -d: -f1` + srcport=`echo $src | cut -d: -f2` + destip=`echo $dest | cut -d: -f1` + destport=`echo $dest | cut -d: -f2` + ctdb killtcp $srcip:$srcport $destip:$destport + ctdb killtcp $destip:$destport $srcip:$srcport + done } > /dev/null 2>&1 /bin/rm -f /etc/ctdb/state/nfs/restart -- cgit