-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brick inode table size #4339
base: devel
Are you sure you want to change the base?
Brick inode table size #4339
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -784,6 +784,7 @@ server_reconfigure(xlator_t *this, dict_t *options) | |
rpc_transport_t *xprt = NULL; | ||
rpc_transport_t *xp_next = NULL; | ||
int inode_lru_limit; | ||
int inode_table_size; | ||
gf_boolean_t trace; | ||
data_t *data; | ||
int ret = 0; | ||
|
@@ -825,6 +826,22 @@ server_reconfigure(xlator_t *this, dict_t *options) | |
kid = this; | ||
} | ||
|
||
if (dict_get_int32_sizen(options, "inode-table-size", &inode_table_size) == | ||
0) { | ||
conf->inode_table_size = inode_table_size; | ||
gf_msg_trace(this->name, 0, | ||
"Reconfigured inode-table-size to " | ||
"%d", | ||
conf->inode_table_size); | ||
|
||
/* traverse through the xlator graph. For each xlator in the | ||
graph check whether it is a bound_xl or not (bound_xl means | ||
the xlator will have its itable pointer set). If so, then | ||
set the lru limit for the itable. | ||
*/ | ||
xlator_foreach(this, xlator_set_inode_table_size, &inode_table_size); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think you need to call xlator_foreach here to configure the inode_table_size, you can pass the value(inode_table_size, dentry_hash_size)during call inode_table_new in the function server_setvolume. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was following the example from network.inode-lru-limit, will make the required update here, thanks for pointing this out. So just save this into the conf variable then. |
||
} | ||
|
||
if (dict_get_int32_sizen(options, "inode-lru-limit", &inode_lru_limit) == | ||
0) { | ||
conf->inode_lru_limit = inode_lru_limit; | ||
|
@@ -1813,12 +1830,21 @@ struct volume_options server_options[] = { | |
{.key = {"inode-lru-limit"}, | ||
.type = GF_OPTION_TYPE_INT, | ||
.min = 0, | ||
.max = 1048576, | ||
.max = 67108864, | ||
.default_value = "16384", | ||
.description = "Specifies the limit on the number of inodes " | ||
"in the lru list of the inode cache.", | ||
.op_version = {1}, | ||
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC}, | ||
{.key = {"inode-table-size"}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to declare a new option inode-table-size, i think inode-table-size is already present, We can pass as an argument inode_table_size to the process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How would you pass that to a brick? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the time being you can pass as an argument to a brick process as like kill the running brick process and start a brick process with same argument and add inode-table-size something like "--inode-table-size=65536" and later you can change glusterd to pass the argument during start of a brick process instead of creating a new option . There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So either modify glusterd or add an option? Isn't then just adding an option simpler because that's how most of the rest of the system is managed anyway? Please note, just trying to understand the logic here. If adding options to glusterd is the way to go - is there an example mechanism I can follow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I still believe the best way is to use an existing option(inode-table-size) instead of creating a new argument.To @xhernandez @aravindavk Can you please share your view about the same. |
||
.type = GF_OPTION_TYPE_INT, | ||
.min = 0, | ||
.max = 67108864, | ||
.default_value = "65536", | ||
.description = "Specifies the size of the inode hash table, " | ||
"must be a power of two.", | ||
.op_version = {GD_OP_VERSION_10_0}, /* if possible */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is probably wrong. Should be 11_0. |
||
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC}, | ||
{.key = {"trace"}, .type = GF_OPTION_TYPE_BOOL}, | ||
{ | ||
.key = {"config-directory", "conf-dir"}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ other .op_versions here is 1, but this option will only be available from glusterfs 11.2 (or patched 11.1s).