summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-08-04 00:41:16 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-08-24 15:24:22 -0700
commit56a79b357e09d91305994fcc0b2d250cb9ac243d (patch)
treede4b9d764c16f1ee2298ef49dce481f2e1efa726 /xlators/cluster/ec/src/ec.c
parent1edea9534dfaf95873921a77e40ae73a0d6e4c39 (diff)
cluster/ec: Do multi-threaded self-heal
BUG: 1368451 Change-Id: I5d6b91d714ad6906dc478a401e614115c89a8fbb Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/15083 Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Ashish Pandey <aspandey@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators/cluster/ec/src/ec.c')
-rw-r--r--xlators/cluster/ec/src/ec.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index c803ebfa796..fd8ef24ab11 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -274,6 +274,10 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("read-policy", read_policy, options, str, failed);
if (ec_assign_read_policy (ec, read_policy))
goto failed;
+ GF_OPTION_RECONF ("shd-max-threads", ec->shd.max_threads,
+ options, uint32, failed);
+ GF_OPTION_RECONF ("shd-wait-qlength", ec->shd.wait_qlength,
+ options, uint32, failed);
return 0;
failed:
@@ -613,6 +617,9 @@ init (xlator_t *this)
if (ec_assign_read_policy (ec, read_policy))
goto failed;
+ GF_OPTION_INIT ("shd-max-threads", ec->shd.max_threads, uint32, failed);
+ GF_OPTION_INIT ("shd-wait-qlength", ec->shd.wait_qlength, uint32, failed);
+
this->itable = inode_table_new (EC_SHD_INODE_LRU_LIMIT, this);
if (!this->itable)
goto failed;
@@ -1374,5 +1381,23 @@ struct volume_options options[] =
" subvolume using round-robin algo. 'gfid-hash' selects read"
" subvolume based on hash of the gfid of that file/directory.",
},
+ { .key = {"shd-max-threads"},
+ .type = GF_OPTION_TYPE_INT,
+ .min = 1,
+ .max = 64,
+ .default_value = "1",
+ .description = "Maximum number of parallel heals SHD can do per local "
+ "brick. This can substantially lower heal times, "
+ "but can also crush your bricks if you don't have "
+ "the storage hardware to support this."
+ },
+ { .key = {"shd-wait-qlength"},
+ .type = GF_OPTION_TYPE_INT,
+ .min = 1,
+ .max = 655536,
+ .default_value = "1024",
+ .description = "This option can be used to control number of heals"
+ " that can wait in SHD per subvolume"
+ },
{ }
};