summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonnie Sahlberg <sahlberg@ronnie>2007-07-10 09:45:14 +1000
committerRonnie Sahlberg <sahlberg@ronnie>2007-07-10 09:45:14 +1000
commitdbc66d054bfe2acbf8eb3bee57b05ef3fed9f734 (patch)
tree83a417d487e3287437669357bfb4f7eac59978f4
parenta859723912fd4c204007a136d6b82b5cc4145081 (diff)
downloadsamba-dbc66d054bfe2acbf8eb3bee57b05ef3fed9f734.tar.gz
samba-dbc66d054bfe2acbf8eb3bee57b05ef3fed9f734.tar.xz
samba-dbc66d054bfe2acbf8eb3bee57b05ef3fed9f734.zip
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)
-rwxr-xr-xctdb/config/events.d/60.nfs16
1 files 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