diff options
author | Ravishankar N <ravishankar@redhat.com> | 2016-02-29 05:16:50 +0000 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-03-04 17:28:58 -0800 |
commit | ad0b1253b9d74797620c493184818685c024f17c (patch) | |
tree | 0838d2891c57057b294923154c9f99e85c91239c /tests/basic | |
parent | 2c410a4c0964f4bec3a513a405a39486dd0183eb (diff) |
afr: do not set arbiter as a readable subvol in inode context
Backport-of: http://review.gluster.org/#/c/13539/
Problem:
If afr_lookup_done() or afr_read_subvol_select_by_policy() chooses the
arbiter brick to serve the stat() data, file size will be reported as
zero from the mount, despite other data bricks being available. This can
break programs like tar which use the stat info to decide how much to read.
Fix:
In the inode-context, mark arbiter as a non-readable subvol for both
data and metadata.
It it to be noted that by making this fix, we are *not* going to serve
metadata FOPS anymore from the arbiter brick despite the brick storing
the metadata. It makes sense to do this because the ever increasing
over-loaded FOPs (getxattr returning stat data etc.) and compound FOPS
in gluster will otherwise make it difficult to add checks in code to
handle corner cases.
Change-Id: Ic60b25d77fd05e0897481b7fcb3716d4f2101001
BUG: 1313921
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reported-by: Mat Clayton <mat@mixcloud.com>
Reviewed-on: http://review.gluster.org/13582
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: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'tests/basic')
-rw-r--r-- | tests/basic/afr/arbiter.t | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/basic/afr/arbiter.t b/tests/basic/afr/arbiter.t index be8f676d1ec..a04dfc560ef 100644 --- a/tests/basic/afr/arbiter.t +++ b/tests/basic/afr/arbiter.t @@ -20,6 +20,7 @@ TEST $CLI volume delete $V0 # Create and mount a replica 3 arbiter volume. TEST $CLI volume create $V0 replica 3 arbiter 1 $H0:$B0/${V0}{0,1,2} TEST $CLI volume set $V0 performance.write-behind off +TEST $CLI volume set $V0 performance.stat-prefetch off TEST $CLI volume set $V0 cluster.self-heal-daemon off TEST $CLI volume start $V0 TEST glusterfs --volfile-id=$V0 --volfile-server=$H0 --entry-timeout=0 $M0; @@ -40,9 +41,11 @@ TEST kill_brick $V0 $H0 $B0/${V0}1 echo "B2 is down, B3 is the only source, writes will fail" >> $M0/file EXPECT_NOT "0" echo $? TEST ! cat $M0/file -# Metadata I/O should still succeed. -TEST getfattr -n user.name $M0/file -TEST setfattr -n user.name -v value3 $M0/file +# Though metadata IO could have been served from arbiter, we do not allow it +# anymore as FOPS like getfattr could be overloaded to return iatt buffers for +# use by other translators. +TEST ! getfattr -n user.name $M0/file +TEST ! setfattr -n user.name -v value3 $M0/file #shd should not data self-heal from arbiter to the sinks. TEST $CLI volume set $V0 cluster.self-heal-daemon on |