summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-08-05 16:58:01 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-08-07 00:20:17 -0700
commit6408e0e864261479e2a1466f27baba2105aab287 (patch)
tree99c053e57709a204c1cb50927db313f21d786e26
parent90beb1602cb2926c14a9bd02653cd75b40661cd4 (diff)
features/shard: Fix excessive logging in readdir(p) callback
Backport of: http://review.gluster.org/#/c/11843/ On enabling features.shard on a volume which already has few files, performing operations on the mount was causing excessive logging of messages of the following kind: [2015-08-05 10:57:48.743352] E [shard.c:232:shard_modify_size_and_block_count] 2-dis-shard: Failed to get trusted.glusterfs.shard.file-size for 0b2bd401-c438-4d57-8ae5-8d26105d3396 Turns out this is coming from shard_readdir_cbk() where the shard translator unconditionally looks for the xattr 'trusted.glusterfs.shard.file-size' in every entry's rsp dict and logs this error on not finding it. But files that are not sharded (i.e., the ones that were created before sharding was enabled on the volume) will not (and should not) have this xattr associated with them. So these logs are misleading and must be suppressed in readdir(p). Change-Id: I2f084023fc3a2a5147d7f364253290280b816db9 BUG: 1250834 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/11850 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
-rw-r--r--xlators/features/shard/src/shard.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index 4284ad679ef..8c9f9f8978e 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -3400,7 +3400,9 @@ shard_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
if (IA_ISDIR (entry->d_stat.ia_type))
continue;
- shard_modify_size_and_block_count (&entry->d_stat, entry->dict);
+ if (dict_get (entry->dict, GF_XATTR_SHARD_FILE_SIZE))
+ shard_modify_size_and_block_count (&entry->d_stat,
+ entry->dict);
}
local->op_ret = op_ret;