summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-common.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-10-14 14:14:51 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-04-29 18:21:56 -0700
commit84c8cc9c5936a2a7539f343c180f06312c8f6d39 (patch)
tree0a89b67bde2e03dafa9f61ffea34f19d11cc9938 /xlators/cluster/afr/src/afr-common.c
parentf0fb05d2cefae08c143f2bfdef151084f5ddb498 (diff)
cluster/afr: Entry self-heal performance enhancements
Change-Id: I52da41dff5619492b656c2217f4716a6cdadebe0 BUG: 1269461 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12442 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-common.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index fda9785bdda..160170e035c 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -4284,6 +4284,8 @@ afr_local_init (afr_local_t *local, afr_private_t *priv, int32_t *op_errno)
goto out;
}
+ local->need_full_crawl = _gf_false;
+
INIT_LIST_HEAD (&local->healer);
return 0;
out:
@@ -4535,9 +4537,11 @@ afr_mark_pending_changelog (afr_private_t *priv, unsigned char *pending,
int **changelog = NULL;
int idx = -1;
int m_idx = 0;
+ int d_idx = 0;
int ret = 0;
m_idx = afr_index_for_transaction_type (AFR_METADATA_TRANSACTION);
+ d_idx = afr_index_for_transaction_type (AFR_DATA_TRANSACTION);
idx = afr_index_from_ia_type (iat);
@@ -4552,6 +4556,11 @@ afr_mark_pending_changelog (afr_private_t *priv, unsigned char *pending,
changelog[i][m_idx] = hton32(1);
if (idx != -1)
changelog[i][idx] = hton32(1);
+ /* If the newentry marking is on a newly created directory,
+ * then mark it with the full-heal indicator.
+ */
+ if ((IA_ISDIR (iat)) && (priv->esh_granular))
+ changelog[i][d_idx] = hton32(1);
}
ret = afr_set_pending_dict (priv, xattr, changelog);
if (ret < 0) {
@@ -4764,12 +4773,12 @@ afr_selfheal_locked_entry_inspect (call_frame_t *frame, xlator_t *this,
*esh = afr_decide_heal_info (priv, sources, ret);
}
afr_selfheal_unentrylk (frame, this, inode, this->name, NULL,
- data_lock);
+ data_lock, NULL);
}
unlock:
if (!granular_locks)
afr_selfheal_unentrylk (frame, this, inode, priv->sh_domain,
- NULL, locked_on);
+ NULL, locked_on, NULL);
out:
if (locked_replies)
afr_replies_wipe (locked_replies, priv->child_count);