diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2017-03-28 19:26:41 +0530 |
---|---|---|
committer | jiffin tony Thottan <jthottan@redhat.com> | 2017-04-04 04:54:24 -0400 |
commit | 7920d7f3879ca5971d4e7ba569534934bfa676e8 (patch) | |
tree | b73f609cba3c84d891daa0fd8ca7816d2fc57c05 | |
parent | d772a79d6fac46426b5eaa6a307bac74f4e8033f (diff) |
features/shard: Pass the correct iatt for cache invalidation
Backport of: https://review.gluster.org/16961
This fixes a performance issue with shard which was causing
the translator to trigger unusually high number of lookups
for cache invalidation even when there was no modification to
the file.
In shard_common_stat_cbk(), it is local->prebuf that contains the
aggregated size and block count as opposed to buf which only holds the
attributes for the physical copy of base shard. Passing buf for
inode_ctx invalidation would always set refresh to true since the file
size in inode ctx contains the aggregated size and would never be same
as @buf->ia_size. This was leading to every write/read being preceded
by a lookup on the base shard even when the file underwent no
modification.
Change-Id: I85940b4b33e77b98e97e277d880ab35b1496c89a
BUG: 1437330
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-on: https://review.gluster.org/16968
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: jiffin tony Thottan <jthottan@redhat.com>
-rw-r--r-- | xlators/features/shard/src/shard.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index 39d648bb34d..9504f12da85 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -1269,7 +1269,7 @@ shard_common_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, else inode = local->fd->inode; - shard_inode_ctx_invalidate (inode, this, buf); + shard_inode_ctx_invalidate (inode, this, &local->prebuf); unwind: local->handler (frame, this); |