path: root/xlators/cluster/afr/src/afr-dir-write.c
diff options
authorRavishankar N <>2016-12-30 14:57:17 +0530
committerJeff Darcy <>2017-01-12 18:54:02 -0800
commit522640be476a3f97dac932f7046f0643ec0ec2f2 (patch)
tree546c9c1c9d7143041c185c99b84fb2504d341c3c /xlators/cluster/afr/src/afr-dir-write.c
parent79b3fb6e8d3c9d681917be6e6c9f6ba04eb73f82 (diff)
afr: Avoid resetting event_gen when brick is always down
Problem: __afr_set_in_flight_sb_status(), which resets event_gen to zero, is called if failed_subvols[i] is non-zero for any brick. But failed_subvols[i] is true even if the brick was down *before* the transaction started. Hence say if 1 brick is down in a replica-3, every writev that comes will trigger an inode refresh because of this resetting, as seen from the no. of FSTATs in the profile info in the BZ. Fix: Reset event gen only if the brick was previously a valid read child and the FOP failed on it the first time. Also `s/afr_inode_read_subvol_reset/afr_inode_event_gen_reset` because the function only resets event gen and not the data/metadata readable. Change-Id: I603ae646cbde96995c35db77916e2ed80b602a91 BUG: 1409206 Signed-off-by: Ravishankar N <> Reviewed-on: Smoke: Gluster Build System <> Reviewed-by: Pranith Kumar Karampuri <> Tested-by: Pranith Kumar Karampuri <> NetBSD-regression: NetBSD Build System <> CentOS-regression: Gluster Build System <>
Diffstat (limited to 'xlators/cluster/afr/src/afr-dir-write.c')
1 files changed, 3 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c
index 286a539..8e483c3 100644
--- a/xlators/cluster/afr/src/afr-dir-write.c
+++ b/xlators/cluster/afr/src/afr-dir-write.c
@@ -122,12 +122,12 @@ __afr_dir_write_finalize (call_frame_t *frame, xlator_t *this)
if (local->replies[i].op_ret < 0) {
if (local->inode)
- afr_inode_read_subvol_reset (local->inode, this);
+ afr_inode_event_gen_reset (local->inode, this);
if (local->parent)
- afr_inode_read_subvol_reset (local->parent,
+ afr_inode_event_gen_reset (local->parent,
if (local->parent2)
- afr_inode_read_subvol_reset (local->parent2,
+ afr_inode_event_gen_reset (local->parent2,