xlators/performance: Add pass-through option

Add pass-through option in performance traslators. Set the option in
GF_OPTION_INIT() and GF_OPTION_RECONF()

Updates: #304

Change-Id: If1537450147d154905831e36f7162a32866d7ad6
Signed-off-by: Varsha Rao <varao@redhat.com>
This commit is contained in:
Varsha Rao 2018-03-16 14:23:25 +05:30 committed by Amar Tumballi
parent 0002c36666
commit 909e2cdf06
9 changed files with 139 additions and 10 deletions

View File

@ -1762,8 +1762,18 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.option = "cleanup-disconnected-reqs",
.op_version = GD_OP_VERSION_4_1_0
},
{ .key = "performance.iot-pass-through",
.voltype = "performance/io-threads",
.option = "pass-through",
.op_version = GD_OP_VERSION_4_1_0
},
/* Other perf xlators' options */
{ .key = "performance.io-cache-pass-through",
.voltype = "performance/io-cache",
.option = "pass-through",
.op_version = GD_OP_VERSION_4_1_0
},
{ .key = "performance.cache-size",
.voltype = "performance/quick-read",
.type = NO_DOC,
@ -1874,12 +1884,32 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.op_version = 3,
.flags = VOLOPT_FLAG_CLIENT_OPT
},
{ .key = "performance.open-behind-pass-through",
.voltype = "performance/open-behind",
.option = "pass-through",
.op_version = GD_OP_VERSION_4_1_0,
},
{ .key = "performance.read-ahead-page-count",
.voltype = "performance/read-ahead",
.option = "page-count",
.op_version = 1,
.flags = VOLOPT_FLAG_CLIENT_OPT
},
{ .key = "performance.read-ahead-pass-through",
.voltype = "performance/read-ahead",
.option = "pass-through",
.op_version = GD_OP_VERSION_4_1_0,
},
{ .key = "performance.readdir-ahead-pass-through",
.voltype = "performance/readdir-ahead",
.option = "pass-through",
.op_version = GD_OP_VERSION_4_1_0,
},
{ .key = "performance.md-cache-pass-through",
.voltype = "performance/md-cache",
.option = "pass-through",
.op_version = GD_OP_VERSION_4_1_0
},
{ .key = "performance.md-cache-timeout",
.voltype = "performance/md-cache",
.option = "md-cache-timeout",
@ -1930,7 +1960,12 @@ struct volopt_map_entry glusterd_volopt_map[] = {
.description = "A comma separeted list of xattrs that shall be "
"cached by md-cache. The only wildcard allowed is '*'"
},
/* Crypt xlator options */
{ .key = "performance.nl-cache-pass-through",
.voltype = "performance/nl-cache",
.option = "pass-through",
.op_version = GD_OP_VERSION_4_1_0
},
/* Crypt xlator options */
{ .key = "features.encryption",
.voltype = "encryption/crypt",

View File

@ -916,29 +916,27 @@ mem_acct_init (xlator_t *this)
int32_t
init (xlator_t *this)
{
int ret = 0;
int ret = -1;
if (!this->children) {
gf_msg (this->name, GF_LOG_WARNING, 0,
DC_MSG_VOL_MISCONFIGURED, "Decompounder must have"
" a subvol.");
ret = -1;
goto out;
}
if (!this->parents) {
gf_msg (this->name, GF_LOG_WARNING, 0,
DC_MSG_VOL_MISCONFIGURED, "Volume is dangling.");
ret = -1;
goto out;
}
this->local_pool = mem_pool_new (dc_local_t, 128);
if (!this->local_pool) {
ret = -1;
goto out;
}
ret = 0;
out:
return ret;
}

View File

@ -1664,6 +1664,9 @@ reconfigure (xlator_t *this, dict_t *options)
ioc_table_lock (table);
{
GF_OPTION_RECONF ("pass-through", this->pass_through, options,
bool, out);
GF_OPTION_RECONF ("cache-timeout", table->cache_timeout,
options, int32, unlock);
@ -1762,6 +1765,8 @@ init (xlator_t *this)
table->xl = this;
table->page_size = this->ctx->page_size;
GF_OPTION_INIT ("pass-through", this->pass_through, bool, out);
GF_OPTION_INIT ("cache-size", table->cache_size, size_uint64, out);
GF_OPTION_INIT ("cache-timeout", table->cache_timeout, int32, out);
@ -2196,5 +2201,13 @@ struct volume_options options[] = {
.op_version = {1},
.flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_SETTABLE | OPT_FLAG_DOC
},
{ .key = {"pass-through"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "false",
.op_version = {GD_OP_VERSION_4_1_0},
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC | OPT_FLAG_CLIENT_OPT,
.tags = {"io-cache"},
.description = "Enable/Disable io cache translator"
},
{ .key = {NULL} },
};

View File

@ -1160,6 +1160,9 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("watchdog-secs", conf->watchdog_secs, options,
int32, out);
GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
out);
if (conf->watchdog_secs > 0) {
start_iot_watchdog (this);
} else {
@ -1243,6 +1246,8 @@ init (xlator_t *this)
GF_OPTION_INIT ("cleanup-disconnected-reqs",
conf->cleanup_disconnected_reqs, bool, out);
GF_OPTION_INIT ("pass-through", this->pass_through, bool, out);
conf->this = this;
for (i = 0; i < GF_FOP_PRI_MAX; i++) {
@ -1527,6 +1532,14 @@ struct volume_options options[] = {
.tags = {"io-threads"},
.description = "'Poison' queued requests when a client disconnects"
},
{ .key = {"pass-through"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "false",
.op_version = {GD_OP_VERSION_4_1_0},
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC | OPT_FLAG_CLIENT_OPT,
.tags = {"io-threads"},
.description = "Enable/Disable io threads translator"
},
{ .key = {NULL},
},
};

View File

@ -2984,16 +2984,24 @@ mdc_reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("cache-ima-xattrs", conf->cache_ima, options, bool,
out);
GF_OPTION_RECONF ("cache-posix-acl", conf->cache_posix_acl, options, bool, out);
GF_OPTION_RECONF ("cache-posix-acl", conf->cache_posix_acl, options,
bool, out);
GF_OPTION_RECONF ("cache-swift-metadata", conf->cache_swift_metadata,
options, bool, out);
GF_OPTION_RECONF ("cache-samba-metadata", conf->cache_samba_metadata,
options, bool, out);
GF_OPTION_RECONF ("force-readdirp", conf->force_readdirp, options, bool, out);
GF_OPTION_RECONF ("force-readdirp", conf->force_readdirp, options, bool,
out);
GF_OPTION_RECONF ("cache-invalidation", conf->mdc_invalidation, options,
bool, out);
bool, out);
GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
out);
GF_OPTION_RECONF ("md-cache-statfs", conf->cache_statfs, options,
bool, out);
@ -3057,9 +3065,12 @@ mdc_init (xlator_t *this)
GF_OPTION_INIT ("cache-samba-metadata", conf->cache_samba_metadata,
bool, out);
GF_OPTION_INIT("force-readdirp", conf->force_readdirp, bool, out);
GF_OPTION_INIT("force-readdirp", conf->force_readdirp, bool, out);
GF_OPTION_INIT("cache-invalidation", conf->mdc_invalidation, bool, out);
GF_OPTION_INIT ("pass-through", this->pass_through, bool, out);
pthread_mutex_init (&conf->statfs_cache.lock, NULL);
GF_OPTION_INIT ("md-cache-statfs", conf->cache_statfs, bool, out);
@ -3286,7 +3297,15 @@ struct volume_options mdc_options[] = {
.description = "A comma separeted list of xattrs that shall be "
"cached by md-cache. The only wildcard allowed is '*'",
},
{ .key = {NULL} },
{ .key = {"pass-through"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "false",
.op_version = {GD_OP_VERSION_4_1_0},
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC | OPT_FLAG_CLIENT_OPT,
.tags = {"md-cache"},
.description = "Enable/Disable md cache translator"
},
{ .key = {NULL} },
};

View File

@ -720,6 +720,8 @@ nlc_reconfigure (xlator_t *this, dict_t *options)
options, bool, out);
GF_OPTION_RECONF ("nl-cache-limit", conf->cache_size, options,
size_uint64, out);
GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
out);
out:
return 0;
@ -741,6 +743,7 @@ nlc_init (xlator_t *this)
GF_OPTION_INIT ("nl-cache-positive-entry", conf->positive_entry_cache,
bool, out);
GF_OPTION_INIT ("nl-cache-limit", conf->cache_size, size_uint64, out);
GF_OPTION_INIT ("pass-through", this->pass_through, bool, out);
/* Since the positive entries are stored as list of refs on
* existing inodes, we should not overflow the inode lru_limit.
@ -841,6 +844,15 @@ struct volume_options nlc_options[] = {
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_CLIENT_OPT | OPT_FLAG_DOC,
.description = "Time period after which cache has to be refreshed",
},
{ .key = {"pass-through"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "false",
.op_version = {GD_OP_VERSION_4_1_0},
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC | OPT_FLAG_CLIENT_OPT,
.tags = {"nl-cache"},
.description = "Enable/Disable nl cache translator"
},
{ .key = {NULL} },
};

View File

@ -918,9 +918,12 @@ reconfigure (xlator_t *this, dict_t *options)
bool, out);
GF_OPTION_RECONF ("lazy-open", conf->lazy_open, options, bool, out);
GF_OPTION_RECONF ("read-after-open", conf->read_after_open, options,
bool, out);
GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
out);
ret = 0;
out:
return ret;
@ -952,7 +955,11 @@ init (xlator_t *this)
GF_OPTION_INIT ("use-anonymous-fd", conf->use_anonymous_fd, bool, err);
GF_OPTION_INIT ("lazy-open", conf->lazy_open, bool, err);
GF_OPTION_INIT ("read-after-open", conf->read_after_open, bool, err);
GF_OPTION_INIT ("pass-through", this->pass_through, bool, err);
this->private = conf;
return 0;
@ -1038,6 +1045,14 @@ struct volume_options options[] = {
.tags = {},
/* option_validation_fn validate_fn; */
},
{ .key = {"pass-through"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "false",
.op_version = {GD_OP_VERSION_4_1_0},
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC | OPT_FLAG_CLIENT_OPT,
.tags = {"open-behind"},
.description = "Enable/Disable open behind translator"
},
{ .key = {NULL} }
};

View File

@ -1132,6 +1132,9 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("page-size", conf->page_size, options, size_uint64,
out);
GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
out);
ret = 0;
out:
return ret;
@ -1172,6 +1175,8 @@ init (xlator_t *this)
GF_OPTION_INIT ("force-atime-update", conf->force_atime_update, bool, out);
GF_OPTION_INIT ("pass-through", this->pass_through, bool, out);
conf->files.next = &conf->files;
conf->files.prev = &conf->files;
@ -1280,5 +1285,13 @@ struct volume_options options[] = {
.tags = {"read-ahead"},
.description = "Page size with which read-ahead performs server I/O"
},
{ .key = {"pass-through"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "false",
.op_version = {GD_OP_VERSION_4_1_0},
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC | OPT_FLAG_CLIENT_OPT,
.tags = {"read-ahead"},
.description = "Enable/Disable read ahead translator"
},
{ .key = {NULL} },
};

View File

@ -600,6 +600,8 @@ reconfigure(xlator_t *this, dict_t *options)
size_uint64, err);
GF_OPTION_RECONF("parallel-readdir", priv->parallel_readdir, options,
bool, err);
GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
err);
return 0;
err:
@ -647,6 +649,7 @@ init(xlator_t *this)
err);
GF_OPTION_INIT("parallel-readdir", priv->parallel_readdir, bool,
err);
GF_OPTION_INIT ("pass-through", this->pass_through, bool, err);
return 0;
@ -725,6 +728,14 @@ struct volume_options options[] = {
"the performance improvement is higher in large "
"clusters"
},
{ .key = {"pass-through"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "false",
.op_version = {GD_OP_VERSION_4_1_0},
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC | OPT_FLAG_CLIENT_OPT,
.tags = {"readdir-ahead"},
.description = "Enable/Disable readdir ahead translator"
},
{ .key = {NULL} },
};