diff options
author | Ronnie Sahlberg <sahlberg@ronnie> | 2007-07-10 09:45:14 +1000 |
---|---|---|
committer | Ronnie Sahlberg <sahlberg@ronnie> | 2007-07-10 09:45:14 +1000 |
commit | dbc66d054bfe2acbf8eb3bee57b05ef3fed9f734 (patch) | |
tree | 83a417d487e3287437669357bfb4f7eac59978f4 | |
parent | a859723912fd4c204007a136d6b82b5cc4145081 (diff) | |
download | samba-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-x | ctdb/config/events.d/60.nfs | 16 |
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 |