summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 556423f..1c26db6 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -1829,14 +1829,22 @@ init (xlator_t *this)
gf_msg (this->name, GF_LOG_INFO, 0,
GD_MSG_DICT_SET_FAILED,
"base-port override: %d", conf->base_port);
- }
- conf->max_port = GF_PORT_MAX;
- if (dict_get_uint32 (this->options, "max-port",
- &conf->max_port) == 0) {
+ }
+ conf->max_port = GF_PORT_MAX;
+ if (dict_get_uint32 (this->options, "max-port",
+ &conf->max_port) == 0) {
gf_msg (this->name, GF_LOG_INFO, 0,
GD_MSG_DICT_SET_FAILED,
"max-port override: %d", conf->max_port);
- }
+ }
+
+ conf->mgmt_v3_lock_timeout = GF_LOCK_TIMER;
+ if (dict_get_uint32 (this->options, "lock-timer",
+ &conf->mgmt_v3_lock_timeout) == 0) {
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ GD_MSG_DICT_SET_FAILED,
+ "lock-timer override: %d", conf->mgmt_v3_lock_timeout);
+ }
/* Set option to run bricks on valgrind if enabled in glusterd.vol */
this->ctx->cmd_args.valgrind = valgrind;
@@ -1862,6 +1870,7 @@ init (xlator_t *this)
this->private = conf;
glusterd_mgmt_v3_lock_init ();
+ glusterd_mgmt_v3_lock_timer_init();
glusterd_txn_opinfo_dict_init ();
glusterd_shdsvc_build (&conf->shd_svc);
@@ -2024,6 +2033,7 @@ fini (xlator_t *this)
gf_store_handle_destroy (conf->handle);
glusterd_sm_tr_log_delete (&conf->op_sm_log);
glusterd_mgmt_v3_lock_fini ();
+ glusterd_mgmt_v3_lock_timer_fini ();
glusterd_txn_opinfo_dict_fini ();
GF_FREE (conf);
@@ -2147,6 +2157,14 @@ struct volume_options options[] = {
.max = GF_PORT_MAX,
.description = "Sets the max port for portmap query"
},
+ { .key = {"mgmt-v3-lock-timeout"},
+ .type = GF_OPTION_TYPE_INT,
+ .max = 600,
+ .description = "Sets the mgmt-v3-lock-timeout for transactions."
+ "Specifes the default timeout value after which "
+ "lock acquired while performing transaction will "
+ "be released."
+ },
{ .key = {"snap-brick-path"},
.type = GF_OPTION_TYPE_STR,
.description = "directory where the bricks for the snapshots will be created"