diff options
author | Raghavendra G <rgowdapp@redhat.com> | 2013-12-09 16:10:56 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-01-28 08:43:52 -0800 |
commit | c7ba4f37b048399481e14167a9a649f13a365cf0 (patch) | |
tree | 2fee9db06231a95e821652672e3fefe6c8b663f6 /tests | |
parent | a338c4fbc43be7480fdfe7c2e762a3f76095731e (diff) |
mount/fuse: cleanup old graphs.
After a graph switch, a PARENT_DOWN event from fuse indicates
protocol/client to shutdown all its sockets. However, this event will
be sent only when the first fop is received from fuse mount after
graph switch. Also, this event is sent only on previously active graph.
So, if there are multiple graph switches when there is no activity on
mountpoint, we'll be left with a list of graphs with their sockets
still open.
This patch fixes the issue by sending PARENT_DOWN to previously
non-active graph when a new graph is available irrespective of whether
there is an activity on mount-point.
Change-Id: I9e676658d797c0b2dd3ed5ca5a56271bd94b4bb6
BUG: 924726
Signed-off-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-on: http://review.gluster.org/4713
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/6813
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/bugs/bug-924726.t | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/bugs/bug-924726.t b/tests/bugs/bug-924726.t new file mode 100755 index 00000000000..82c11af878e --- /dev/null +++ b/tests/bugs/bug-924726.t @@ -0,0 +1,45 @@ +#!/bin/bash + +TESTS_EXPECTED_IN_LOOP=10 + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc + +cleanup; + +function get_socket_count() { + netstat -nap | grep $1 | wc -l +} + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info; + +TEST $CLI volume create $V0 $H0:$B0/$V0 +EXPECT 'Created' volinfo_field $V0 'Status'; + +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +TEST glusterfs -s $H0 --volfile-id $V0 $M0; + +TEST ls $M0 + +GLFS_MNT_PID=`ps ax | grep -i $M0 | grep glusterfs | grep -v grep | sed -e "s/^ *\([0-9]*\).*/\1/g"` + +SOCKETS_BEFORE_SWITCH=`netstat -nap | grep $GLFS_MNT_PID | grep ESTABLISHED | wc -l` + +for i in $(seq 1 5); do + TEST_IN_LOOP $CLI volume set $V0 performance.write-behind off; + sleep 1; + TEST_IN_LOOP $CLI volume set $V0 performance.write-behind on; + sleep 1; +done + +SOCKETS_AFTER_SWITCH=`netstat -nap | grep $GLFS_MNT_PID | grep ESTABLISHED | wc -l` + +# currently active graph is not cleaned up till some operation on +# mount-point. Hence there is one extra graph. +TEST [ $SOCKETS_AFTER_SWITCH = `expr $SOCKETS_BEFORE_SWITCH + 1` ] + +cleanup; |