summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2017-11-17 07:20:21 +0530
committerAmar Tumballi <amarts@redhat.com>2017-11-22 07:47:49 +0000
commit4ad64ffe8664cc0b964586af6efcf53cc619b68a (patch)
tree37f1bcb17436e473d2e3dd9596098873d92b66bc /xlators/cluster/ec
parent3ad68df725ac32f83b5ea7c0976e2327e7037c8c (diff)
ec: Use tiebreaker_inodelk where necessary
When there are big directories or files that need to be healed, other shds are stuck on getting lock on self-heal domain for these directories/files. If there is a tie-breaker logic, other shds can heal some other files/directories while 1 of the shds is healing the big file/directory. Before this patch: 96.67 4890.64 us 12.89 us 646115887.30us 340869 INODELK After this patch: 40.76 42.35 us 15.09 us 6546.50us 438478 INODELK Fixes gluster/glusterfs#354 Change-Id: Ia995b5576b44f770c064090705c78459e543cc64 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/ec')
-rw-r--r--xlators/cluster/ec/src/ec-heal.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c
index 79159dc943d..8d62b01ac8a 100644
--- a/xlators/cluster/ec/src/ec-heal.c
+++ b/xlators/cluster/ec/src/ec-heal.c
@@ -1559,9 +1559,9 @@ ec_heal_entry (call_frame_t *frame, ec_t *ec, inode_t *inode,
sprintf (selfheal_domain, "%s:self-heal", ec->xl->name);
ec_mask_to_char_array (ec->xl_up, up_subvols, ec->nodes);
/*If other processes are already doing the heal, don't block*/
- ret = cluster_inodelk (ec->xl_list, up_subvols, ec->nodes, replies,
- locked_on, frame, ec->xl, selfheal_domain, inode,
- 0, 0);
+ ret = cluster_tiebreaker_inodelk (ec->xl_list, up_subvols, ec->nodes,
+ replies, locked_on, frame, ec->xl,
+ selfheal_domain, inode, 0, 0);
{
if (ret <= ec->fragments) {
gf_msg_debug (ec->xl->name, 0, "%s: Skipping heal "
@@ -2391,9 +2391,10 @@ ec_heal_data (call_frame_t *frame, ec_t *ec, gf_boolean_t block, inode_t *inode,
locked_on, frame, ec->xl,
selfheal_domain, inode, 0, 0);
} else {
- ret = cluster_tryinodelk (ec->xl_list, output, ec->nodes,
- replies, locked_on, frame, ec->xl,
- selfheal_domain, inode, 0, 0);
+ ret = cluster_tiebreaker_inodelk (ec->xl_list, output,
+ ec->nodes, replies, locked_on,
+ frame, ec->xl,
+ selfheal_domain, inode, 0, 0);
}
{
if (ret <= ec->fragments) {
@@ -2444,8 +2445,10 @@ ec_heal_do (xlator_t *this, void *data, loc_t *loc, int32_t partial)
/* If it is heal request from getxattr, complete the heal and then
* unwind, if it is ec_heal with NULL as frame then no need to block
- * the heal as the caller doesn't care about its completion*/
- if (fop->req_frame)
+ * the heal as the caller doesn't care about its completion. In case
+ * of heald whichever gets tiebreaking inodelk will take care of the
+ * heal, so no need to block*/
+ if (fop->req_frame && !ec->shd.iamshd)
blocking = _gf_true;
frame = create_frame (this, this->ctx->pool);