From dd8eb06e26138e149252365043706067782416af Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 26 Sep 2012 12:31:15 +0530 Subject: cluster/afr: Provide option to set readdir-size in entry-self-heal Problem: Entry self-heal does lookups on all the entries that are read in readdir. More the size of readdir more number of lookups happen in parallel. It is observed that it leads to HUGE cpu spikes rendering everything else on the system unusable. Fix: Provided the option self-heal-readdir-size to configure the size. Default value is at 1KB. Tests: Checked that the readdirs are happening with the configured value in entry-self-heal. Change-Id: Icaa937ad88857e6f9a12375b1e7f6a49192bc8b1 BUG: 860895 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/4002 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 882b96cd0..685470d64 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -132,6 +132,7 @@ static struct volopt_map_entry glusterd_volopt_map[] = { {"cluster.quorum-type", "cluster/replicate", "quorum-type", NULL, NO_DOC, 0}, {"cluster.quorum-count", "cluster/replicate", "quorum-count", NULL, NO_DOC, 0}, {"cluster.choose-local", "cluster/replicate", NULL, NULL, DOC, 0}, + {"cluster.self-heal-readdir-size", "cluster/replicate", NULL, NULL, NO_DOC, 0}, {"cluster.stripe-block-size", "cluster/stripe", "block-size", NULL, DOC, 0}, {"cluster.stripe-coalesce", "cluster/stripe", "coalesce", NULL, DOC, 0}, @@ -2558,13 +2559,13 @@ shd_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme, struct volopt_map_entry new_vme = {0}; char *shd_option = NULL; - if (vme->option[0] != '!') - goto out; shd_option = gd_get_matching_option (gd_shd_options, vme->option); - if (!shd_option) + if ((vme->option[0] == '!') && !shd_option) goto out; new_vme = *vme; - new_vme.option = shd_option + 1;//option with out '!' + if (shd_option) { + new_vme.option = shd_option + 1;//option with out '!' + } ret = no_filter_option_handler (graph, &new_vme, param); out: -- cgit