3604df
From 795a095a6740a66744f10f864c99095205c97c1a Mon Sep 17 00:00:00 2001
3604df
From: Krutika Dhananjay <kdhananj@redhat.com>
3604df
Date: Tue, 28 Mar 2017 19:26:41 +0530
3604df
Subject: [PATCH 304/316] features/shard: Pass the correct iatt for cache
3604df
 invalidation
3604df
3604df
        Backport of: https://review.gluster.org/16961
3604df
3604df
This fixes a performance issue with shard which was causing
3604df
the translator to trigger unusually high number of lookups
3604df
for cache invalidation even when there was no modification to
3604df
the file.
3604df
3604df
In shard_common_stat_cbk(), it is local->prebuf that contains the
3604df
aggregated size and block count as opposed to buf which only holds the
3604df
attributes for the physical copy of base shard. Passing buf for
3604df
inode_ctx invalidation would always set refresh to true since the file
3604df
size in inode ctx contains the aggregated size and would never be same
3604df
as @buf->ia_size. This was leading to every write/read being preceded
3604df
by a lookup on the base shard even when the file underwent no
3604df
modification.
3604df
3604df
Change-Id: I97b52224823d57f86eb92cc36a726049bdb5cb23
3604df
BUG: 1439731
3604df
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
3604df
Reviewed-on: https://code.engineering.redhat.com/gerrit/102819
3604df
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
3604df
---
3604df
 xlators/features/shard/src/shard.c | 2 +-
3604df
 1 file changed, 1 insertion(+), 1 deletion(-)
3604df
3604df
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
3604df
index 39d648b..9504f12 100644
3604df
--- a/xlators/features/shard/src/shard.c
3604df
+++ b/xlators/features/shard/src/shard.c
3604df
@@ -1269,7 +1269,7 @@ shard_common_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
3604df
         else
3604df
                 inode = local->fd->inode;
3604df
 
3604df
-        shard_inode_ctx_invalidate (inode, this, buf);
3604df
+        shard_inode_ctx_invalidate (inode, this, &local->prebuf);
3604df
 
3604df
 unwind:
3604df
         local->handler (frame, this);
3604df
-- 
3604df
1.8.3.1
3604df