cluster/ec: Implement self-heal-window_size option

Fix implements the heal window size option for
EC. This option control the maximum size of
read/write operation carried out in self-heal
process.

BUG: 1441491
Change-Id: I6c0ef65c9ca18b0828f91b319d4f52ac5b77d0d8
Signed-off-by: Sunil Kumar Acharya <sheggodu@redhat.com>
Reviewed-on: https://review.gluster.org/17098
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
This commit is contained in:
Sunil Kumar Acharya 2017-04-20 12:24:51 +05:30 committed by Xavier Hernandez
parent f071d2a285
commit bf20b066c2
4 changed files with 21 additions and 3 deletions

View File

@ -1897,7 +1897,6 @@ ec_rebuild_data (call_frame_t *frame, ec_t *ec, fd_t *fd, uint64_t size,
ec_heal_t *heal = NULL;
int ret = 0;
syncbarrier_t barrier;
struct iobuf_pool *pool = NULL;
if (syncbarrier_init (&barrier))
return -ENOMEM;
@ -1907,9 +1906,8 @@ ec_rebuild_data (call_frame_t *frame, ec_t *ec, fd_t *fd, uint64_t size,
heal->xl = ec->xl;
heal->data = &barrier;
syncbarrier_init (heal->data);
pool = ec->xl->ctx->iobuf_pool;
heal->total_size = size;
heal->size = iobpool_default_pagesize (pool);
heal->size = (128 * GF_UNIT_KB * (ec->self_heal_window_size));
/* We need to adjust the size to a multiple of the stripe size of the
* volume. Otherwise writes would need to fill gaps (head and/or tail)
* with existent data from the bad bricks. This could be garbage on a

View File

@ -565,6 +565,7 @@ struct _ec {
gf_boolean_t optimistic_changelog;
uint32_t background_heals;
uint32_t heal_wait_qlen;
uint32_t self_heal_window_size; /* max size of read/writes */
struct list_head pending_fops;
struct list_head heal_waiting;
struct list_head healing;

View File

@ -280,6 +280,8 @@ reconfigure (xlator_t *this, dict_t *options)
uint32, failed);
GF_OPTION_RECONF ("heal-wait-qlength", heal_wait_qlen, options,
uint32, failed);
GF_OPTION_RECONF ("self-heal-window-size", ec->self_heal_window_size,
options, uint32, failed);
GF_OPTION_RECONF ("heal-timeout", ec->shd.timeout, options,
int32, failed);
ec_configure_background_heal_opts (ec, background_heals,
@ -663,6 +665,8 @@ init (xlator_t *this)
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);
GF_OPTION_INIT ("self-heal-window-size", ec->self_heal_window_size, uint32,
failed);
ec_configure_background_heal_opts (ec, ec->background_heals,
ec->heal_wait_qlen);
GF_OPTION_INIT ("read-policy", read_policy, str, failed);
@ -1303,6 +1307,8 @@ int32_t ec_dump_private(xlator_t *this)
ec_bin(tmp, sizeof(tmp), ec->xl_up, ec->nodes));
gf_proc_dump_write("background-heals", "%d", ec->background_heals);
gf_proc_dump_write("heal-wait-qlength", "%d", ec->heal_wait_qlen);
gf_proc_dump_write("self-heal-window-size", "%"PRIu32,
ec->self_heal_window_size);
gf_proc_dump_write("healers", "%d", ec->healers);
gf_proc_dump_write("heal-waiters", "%d", ec->heal_waiters);
gf_proc_dump_write("read-policy", "%s", ec_read_policies[ec->read_policy]);
@ -1466,6 +1472,14 @@ struct volume_options options[] =
.description = "force the cpu extensions to be used to accelerate the "
"galois field computations."
},
{ .key = {"self-heal-window-size"},
.type = GF_OPTION_TYPE_INT,
.min = 1,
.max = 1024,
.default_value = "1",
.description = "Maximum number blocks(128KB) per file for which "
"self-heal process would be applied simultaneously."
},
{ .key = {"optimistic-change-log"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "on",

View File

@ -3212,6 +3212,11 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.op_version = GD_OP_VERSION_3_9_0,
.flags = OPT_FLAG_CLIENT_OPT
},
{ .key = "disperse.self-heal-window-size",
.voltype = "cluster/disperse",
.op_version = GD_OP_VERSION_3_11_0,
.flags = OPT_FLAG_CLIENT_OPT
},
{ .key = "cluster.use-compound-fops",
.voltype = "cluster/replicate",
.value = "off",