path: root/xlators/cluster/ec/src/ec.c
diff options
authorAshish Pandey <>2016-03-04 13:05:09 +0530
committerPranith Kumar Karampuri <>2016-03-15 21:54:28 -0700
commit23ccabbeb7879fd05f415690124bd7b4a74d4d33 (patch)
tree76282645ef4bb1b360470aa59d6b8cd7c184a148 /xlators/cluster/ec/src/ec.c
parentb145cd15ded130078c9f1105e76f35d0886e62d5 (diff)
cluster/ec: Provide an option to enable/disable eager lock
Problem: If a fop takes lock, and completes its operation, it waits for 1 second before releasing the lock. However, If ec find any lock contention within this time period, it release the lock immediately before time expires. As we take lock on first brick, for few operations, like read, it might happen that discovery of lock contention might take long time and can degrades the performance. Solution: Provide an option to enable/disable eager lock. If eager lock is disabled, lock will be released as soon as fop completes. gluster v set <VOLUME NAME> disperse.eager-lock on gluster v set <VOLUME NAME> disperse.eager-lock off Change-Id: I000985a787eba3c190fdcd5981dfbf04e64af166 BUG: 1314649 Signed-off-by: Ashish Pandey <> Reviewed-on: Smoke: Gluster Build System <> Reviewed-by: Pranith Kumar Karampuri <> Tested-by: Pranith Kumar Karampuri <> CentOS-regression: Gluster Build System <> NetBSD-regression: NetBSD Build System <>
Diffstat (limited to 'xlators/cluster/ec/src/ec.c')
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index 1f15af10dab..1d53981303a 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -261,6 +261,8 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("iam-self-heal-daemon", ec->shd.iamshd, options,
bool, failed);
+ GF_OPTION_RECONF ("eager-lock", ec->eager_lock, options,
+ bool, failed);
GF_OPTION_RECONF ("background-heals", background_heals, options,
uint32, failed);
GF_OPTION_RECONF ("heal-wait-qlength", heal_wait_qlen, options,
@@ -601,6 +603,7 @@ init (xlator_t *this)
GF_OPTION_INIT ("self-heal-daemon", ec->shd.enabled, bool, failed);
GF_OPTION_INIT ("iam-self-heal-daemon", ec->shd.iamshd, bool, failed);
+ GF_OPTION_INIT ("eager-lock", ec->eager_lock, bool, failed);
GF_OPTION_INIT ("background-heals", ec->background_heals, uint32, failed);
GF_OPTION_INIT ("heal-wait-qlength", ec->heal_wait_qlen, uint32, failed);
ec_configure_background_heal_opts (ec, ec->background_heals,
@@ -1321,6 +1324,12 @@ struct volume_options options[] =
"translator is running as part of self-heal-daemon "
"or not."
+ { .key = {"eager-lock"},
+ .default_value = "on",
+ .description = "This option will enable/diable eager lock for"
+ "disperse volume "
+ },
{ .key = {"background-heals"},
.min = 0,/*Disabling background heals*/