diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2016-03-19 11:40:26 +0530 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2016-05-14 07:30:21 -0700 |
commit | be312da5eac94410c41dac5dc1dde810974a12b7 (patch) | |
tree | 497b8b9f3bd55c4a91f80a6b1e74daf479906a59 /tests | |
parent | bf80f5a94b7d5e617612904723c2ae053e137d3b (diff) |
cluster/afr: Don't let NFS cache stat after writes
Problem:
Afr does post-ops after write but the stat buffer it unwinds is at the
time of write, so if nfs client caches this, it will see different
ctime when it does stat on it after post-op is done. From NFS client's
perspective it thinks the file is changed. Tar which depends on this
to be correct keeps giving 'file changed as we read it' warning.
If Afr instead has to choose to unwind after post-op, eager-lock,
delayed-post-op will have to be disabled which will lead to bad
performance for all write usecases.
Fix:
Don't let client cache stat after write.
>Change-Id: Ic6062acc6e5cdd97a9c83c56bd529ec83cee8a23
>BUG: 1302948
>Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
>Signed-off-by: Anuradha Talur <atalur@redhat.com>
>Reviewed-on: http://review.gluster.org/13785
>Smoke: Gluster Build System <jenkins@build.gluster.com>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
>Reviewed-by: Niels de Vos <ndevos@redhat.com>
BUG: 1335285
Change-Id: Ibef4fc80496d12acd15db57713af2e3a1c9109a7
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/14300
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basic/afr/tarissue.t | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/basic/afr/tarissue.t b/tests/basic/afr/tarissue.t new file mode 100644 index 00000000000..a35d468eb0c --- /dev/null +++ b/tests/basic/afr/tarissue.t @@ -0,0 +1,37 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc +. $(dirname $0)/../../nfs.rc + +TESTS_EXPECTED_IN_LOOP=10 +cleanup; + +#Basic checks +TEST glusterd +TEST pidof glusterd + +#Create a distributed-replicate volume +TEST $CLI volume create $V0 replica 2 $H0:$B0/${V0}{1..6}; +TEST $CLI volume set $V0 cluster.consistent-metadata on +TEST $CLI volume set $V0 cluster.post-op-delay-secs 0 +TEST $CLI volume set $V0 nfs.rdirplus off +TEST $CLI volume set $V0 nfs.disable false +TEST $CLI volume start $V0 +EXPECT_WITHIN $NFS_EXPORT_TIMEOUT "1" is_nfs_export_available; + +# Mount NFS +mount_nfs $H0:/$V0 $N0 vers=3 + +#Create files +TEST mkdir -p $N0/nfs/dir1/dir2 +for i in {1..10}; do + TEST_IN_LOOP dd if=/dev/urandom of=$N0/nfs/dir1/dir2/file$i bs=1024k count=1 +done +TEST tar cvf /tmp/dir1.tar.gz $N0/nfs/dir1 + +TEST rm -f /tmp/dir1.tar.gz + +EXPECT_WITHIN $UMOUNT_TIMEOUT "Y" force_umount $N0 + +cleanup; |