summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-10-15 04:48:09 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-23 07:03:12 -0700
commit00d2fafa1bcab7758aa20741a20fb4ea38b9a8ff (patch)
tree20754e41c3fe40fff4e3ecc0369ca0dd0812c2f9 /xlators/cluster/afr/src/afr.c
parent58efcf03a63324b7bbfda864647d35256917058a (diff)
cluster/afr: Pipeline the "full" data self-heal read-write loop.
Start upto "data-self-heal-window-size" instances of the read-write loop of the "full" data self-heal algorithm simultaneously. Add a new option "data-self-heal-window-size" with range [1-1024], and a default value of 16. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 320 (Improve self-heal performance) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=320
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index eea030ad1..bf023ce27 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -2338,6 +2338,7 @@ init (xlator_t *this)
char * change_log = NULL;
int32_t lock_server_count = 1;
+ int32_t window_size;
int fav_ret = -1;
int read_ret = -1;
@@ -2391,6 +2392,19 @@ init (xlator_t *this)
priv->data_self_heal_algorithm = strdup (algo);
}
+
+ priv->data_self_heal_window_size = 16;
+
+ dict_ret = dict_get_int32 (this->options, "data-self-heal-window-size",
+ &window_size);
+ if (dict_ret == 0) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Setting data self-heal window size to %d.",
+ window_size);
+
+ priv->data_self_heal_window_size = window_size;
+ }
+
dict_ret = dict_get_str (this->options, "metadata-self-heal",
&self_heal);
if (dict_ret == 0) {
@@ -2665,6 +2679,11 @@ struct volume_options options[] = {
{ .key = {"data-self-heal-algorithm"},
.type = GF_OPTION_TYPE_STR
},
+ { .key = {"data-self-heal-window-size"},
+ .type = GF_OPTION_TYPE_INT,
+ .min = 1,
+ .max = 1024
+ },
{ .key = {"metadata-self-heal"},
.type = GF_OPTION_TYPE_BOOL
},