diff options
| author | Shreyas Siravara <sshreyas@fb.com> | 2017-09-07 16:27:09 -0700 |
|---|---|---|
| committer | Shreyas Siravara <sshreyas@fb.com> | 2017-09-07 23:55:31 +0000 |
| commit | 9423bc2223227661453a8afd5ab940048abeb008 (patch) | |
| tree | ca7a7924bde87a309e21e03be1837d667d61bfc7 /tests/basic | |
| parent | 4a007de8e1bcef9ce059cdca4dcc510846702e1d (diff) | |
cluster/afr: Set AFR UP message as soon as quorum is obtained.
Summary:
AFR currently waits for all children to respond before sending an UP
message. This means that one dead host cal cause us to wait a TCP
timeout (2 mins!) before declaring the volume up.
Now we send an UP as soon as quorum is obtained.
This is a port of D4701919 to 3.8.
Reviewed By: sshreyas
Change-Id: I642d4eb7dc7e0b289e89b7a16abf99a3f98aa8b3
Reviewed-on: https://review.gluster.org/18231
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Shreyas Siravara <sshreyas@fb.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'tests/basic')
| -rw-r--r-- | tests/basic/afr-early-up.t | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tests/basic/afr-early-up.t b/tests/basic/afr-early-up.t new file mode 100644 index 00000000000..703855f4fac --- /dev/null +++ b/tests/basic/afr-early-up.t @@ -0,0 +1,62 @@ +#!/bin/bash + +. $(dirname $0)/../include.rc +. $(dirname $0)/../volume.rc +. $(dirname $0)/../dht.rc + +function mount_gluster () +{ + local host=$1 + local volume=$2 + local mount=$3 + local timeout=$4 + + if ! glusterfs -s $host --volfile-id $volume $mount; then + echo "N" + return + fi + + if ! timeout -s 9 $timeout stat $mount; then + echo "N" + return + fi + + echo "Y" +} + +cleanup; + +TEST glusterd +TEST pidof glusterd +TEST $CLI volume info; + +TEST $CLI volume create $V0 replica 3 $H0:$B0/${V0}{1,2,3}; + +EXPECT "$V0" volinfo_field $V0 'Volume Name'; +EXPECT 'Created' volinfo_field $V0 'Status'; +EXPECT '3' brick_count $V0 + +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +BRICKPORT=$(pgrep -fl glusterfsd | head -n1 | sed 's/^.*listen-port=//') + +TEST $CLI volume set $V0 cluster.quorum-type auto +EXPECT auto volume_option $V0 cluster.quorum-type + +# Use iptables to block access to one of the brick ports. +BRICKPORT=$(pgrep -fla glusterfsd | head -n1 | sed 's/^.*listen-port=//') +iptables -A INPUT -p tcp --dport $BRICKPORT -j DROP +ip6tables -A INPUT -p tcp --dport $BRICKPORT -j DROP + +# Should still be able to mount within 10 seconds even though brick is +# unreachable. +EXPECT "Y" mount_gluster $H0 $V0 $M0 10 + +# Mount should be writable (we should have quorum) +TEST dd if=/dev/zero of=$M0/test.out bs=128K count=1 conv=fsync + +iptables -D INPUT -p tcp --dport $BRICKPORT -j DROP +ip6tables -D INPUT -p tcp --dport $BRICKPORT -j DROP + +cleanup; |
