summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorAnuradha Talur <atalur@redhat.com>2015-11-12 19:45:10 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-12-21 01:18:46 -0800
commitcf1667cf2fdc9306ae23db1c171b6bdb225153d7 (patch)
treee32b8198c229c6d7bdd76cd73dc972fc0059d13c /xlators/cluster/afr/src/afr-self-heal-common.c
parent95a576dec754af6609c5356e07003c54058eb675 (diff)
cluster/afr : Readdirp performance enhancement
Backport of: http://review.gluster.org/#/c/12507/ Things done : 1) during lookup and inode_refresh as part of read_txn, request is sent to detect if heal is required or not. 2) If heal is required, be conservative in setting the readdirp entry inodes to NULL, otherwise don't be. 3) Self-heal-daemon now crawls both indices/xattrop and indices/dirty directory while healing. Change-Id: Ic4a4da63fb7e0726eab5f341a200859b29cf7eb7 BUG: 1287531 Signed-off-by: Anuradha Talur <atalur@redhat.com> Reviewed-on: http://review.gluster.org/12507 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> Signed-off-by: Anuradha Talur <atalur@redhat.com> Reviewed-on: http://review.gluster.org/12853
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index c9010dff308..63a52fcae84 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -658,6 +658,8 @@ afr_selfheal_discover_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
{
afr_local_t *local = NULL;
int i = -1;
+ GF_UNUSED int ret = -1;
+ int8_t need_heal = 1;
local = frame->local;
i = (long) cookie;
@@ -669,8 +671,13 @@ afr_selfheal_discover_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
local->replies[i].poststat = *buf;
if (parbuf)
local->replies[i].postparent = *parbuf;
- if (xdata)
+ if (xdata) {
local->replies[i].xdata = dict_ref (xdata);
+ ret = dict_get_int8 (xdata, "link-count", &need_heal);
+ local->replies[i].need_heal = need_heal;
+ } else {
+ local->replies[i].need_heal = need_heal;
+ }
syncbarrier_wake (&local->barrier);