diff options
author | Michael Goulet <mgoulet@fb.com> | 2017-08-17 13:57:09 -0700 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-09-14 19:43:21 +0000 |
commit | c071992e8d6fee2e5df4d8de19dc0ce1d84a10b8 (patch) | |
tree | 4af04f178619fdf76cc54cf31c87a0fc3809c6f2 | |
parent | 6455c52a33c9eb86f1947358e2ed7a7e93f555da (diff) |
Add options to disable new features
Summary: @sshreyas thought the best idea to roll out these new features in the default-off state. This diff adds a few options and modifies tests to make sure that this is done.
Test Plan: The brick restart test works fine, but now it's default disabled on all bricks.
Reviewers: sshreyas, jdarcy
Reviewed By: jdarcy
Subscribers: sshreyas, #posix_storage
Differential Revision: https://phabricator.intern.facebook.com/D5653138
Porting note: includes disconnected-reqs option; retart-bricks inapplicable
Change-Id: I332339894d3cbfafdabeb8592e95c37f30f9751a
Signed-off-by: Jeff Darcy <jdarcy@fb.com>
Reviewed-on: https://review.gluster.org/18291
Reviewed-by: Jeff Darcy <jeff@pl.atyp.us>
Tested-by: Jeff Darcy <jeff@pl.atyp.us>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-set.c | 6 | ||||
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 18 | ||||
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.h | 1 |
3 files changed, 25 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 3f4c5bbb686..24f4f62ce59 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -1559,6 +1559,12 @@ struct volopt_map_entry glusterd_volopt_map[] = { .option = "watchdog-secs", .op_version = 2 }, + { .key = "performance.iot-cleanup-disconnected-reqs", + .voltype = "performance/io-threads", + .option = "cleanup-disconnected-reqs", + .op_version = 2 + }, + /* Other perf xlators' options */ { .key = "performance.cache-size", diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 09ae02bf2ac..04d94691ba3 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -1138,8 +1138,12 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("least-rate-limit", conf->throttle.rate_limit, options, int32, out); + GF_OPTION_RECONF ("cleanup-disconnected-reqs", + conf->cleanup_disconnected_reqs, options, bool, out); + GF_OPTION_RECONF ("watchdog-secs", conf->watchdog_secs, options, int32, out); + if (conf->watchdog_secs > 0) { start_iot_watchdog (this); } else { @@ -1217,9 +1221,13 @@ init (xlator_t *this) conf->ac_iot_limit[IOT_PRI_LEAST], int32, out); GF_OPTION_INIT ("idle-time", conf->idle_time, int32, out); + GF_OPTION_INIT ("enable-least-priority", conf->least_priority, bool, out); + GF_OPTION_INIT ("cleanup-disconnected-reqs", + conf->cleanup_disconnected_reqs, bool, out); + GF_OPTION_INIT ("least-rate-limit", conf->throttle.rate_limit, int32, out); @@ -1321,6 +1329,10 @@ iot_disconnect_cbk (xlator_t *this, client_t *client) call_stub_t *next; iot_conf_t *conf = this->private; + if (!conf || !conf->cleanup_disconnected_reqs) { + goto out; + } + pthread_mutex_lock (&conf->mutex); for (i = 0; i < IOT_PRI_MAX; i++) { list_for_each_entry_safe (curr, next, &conf->reqs[i], list) { @@ -1336,6 +1348,7 @@ iot_disconnect_cbk (xlator_t *this, client_t *client) } pthread_mutex_unlock (&conf->mutex); +out: return 0; } @@ -1479,6 +1492,11 @@ struct volume_options options[] = { .description = "Number of seconds a queue must be stalled before " "starting an 'emergency' thread." }, + { .key = {"cleanup-disconnected-reqs"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "off", + .description = "'Poison' queued requests when a client disconnects" + }, { .key = {NULL}, }, }; diff --git a/xlators/performance/io-threads/src/io-threads.h b/xlators/performance/io-threads/src/io-threads.h index 4056eb5fe09..4300cf673b2 100644 --- a/xlators/performance/io-threads/src/io-threads.h +++ b/xlators/performance/io-threads/src/io-threads.h @@ -83,6 +83,7 @@ struct iot_conf { gf_boolean_t watchdog_running; pthread_t watchdog_thread; gf_boolean_t queue_marked[IOT_PRI_MAX]; + gf_boolean_t cleanup_disconnected_reqs; }; typedef struct iot_conf iot_conf_t; |