diff options
author | Mohit Agrawal <moagrawa@redhat.com> | 2017-11-28 11:26:10 +0530 |
---|---|---|
committer | Krutika Dhananjay <kdhananj@redhat.com> | 2017-12-01 10:17:44 +0000 |
commit | 185917c7a621ce0971e883b35221895ef235ca18 (patch) | |
tree | 2b6f8fd79dff79969e096e606c7027cb83942dd8 /xlators/storage/posix/src/posix.c | |
parent | 48e3ae7482a7c70dc130dc7f8198636a87649d54 (diff) |
posix: Convert posix_fs_health_check asynchrnously to save timestamp
Problem: Sometime posix_fs_health_check thread is blocked on write/read
call while backend device deleted abruptly.
Solution: To resolve it convert code to update timestamp asynchrnously.
BUG: 1501132
Change-Id: Id68ea6a572bf68fbf437e1d9be5221b63d47ff9c
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 9ba2edf9fdf..0435d7a677f 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -7252,6 +7252,8 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("health-check-interval", priv->health_check_interval, options, uint32, out); + GF_OPTION_RECONF ("health-check-timeout", priv->health_check_timeout, + options, uint32, out); posix_spawn_health_check_thread (this); GF_OPTION_RECONF ("shared-brick-count", priv->shared_brick_count, @@ -7858,6 +7860,8 @@ init (xlator_t *this) _private->health_check_active = _gf_false; GF_OPTION_INIT ("health-check-interval", _private->health_check_interval, uint32, out); + GF_OPTION_INIT ("health-check-timeout", + _private->health_check_timeout, uint32, out); if (_private->health_check_interval) posix_spawn_health_check_thread (this); @@ -8090,6 +8094,17 @@ struct volume_options options[] = { .flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC }, { + .key = {"health-check-timeout"}, + .type = GF_OPTION_TYPE_INT, + .min = 0, + .default_value = "10", + .validate = GF_OPT_VALIDATE_MIN, + .description = "Interval in seconds to wait aio_write finish for health check, " + "set to 0 to disable", + .op_version = {GD_OP_VERSION_4_0_0}, + .flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC + }, + { .key = {"reserve"}, .type = GF_OPTION_TYPE_INT, .min = 0, |