Skip to content
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

MDEV-35889 set information_schema.system_variables NUMERIC_MIN_VALUE for the innodb_buffer_pool_size system variable based on innodb_page_size #3777

Open
wants to merge 1 commit into
base: 10.5
Choose a base branch
from

Conversation

grooverdan
Copy link
Member

  • The Jira issue number for this PR is: MDEV-35889

Description

reasons for a new function plugin_opt_set_limits_by_name:

  • plugin_opt_set_limits looks like it will do the job, however struct my_option * never gets exposed to the plugin to use. Also to preserve the plugin_opt_set_limits if somehow an plugin did use the interface.
  • exposing intern_find_sys_var to a plugin looks like a layering violation, but otherwise including sql/sys_vars_shared.h does a compile error on THD (for other functions there).

The innodb_buffer_pool_size is dependent on the innodb_page_size. While the minimum is enforced for resizing the minimum isn't exposed by the information_schema.system_variables table.

This creates a plugin function plugin_opt_set_limits_by_name that allows plugins to adjust the limits of their system variables during plugin initialization.

Release Notes

information.system_variables no includes the right NUMBERIC_MIN_VALUE for innodb_buffer_pool_size, regardless of which innodb_page_size is used.

How can this PR be tested?

mtr case included

If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

for the innodb_buffer_pool_size system variable based on innodb_page_size.

The innodb_buffer_pool_size is dependent on the innodb_page_size. While
the minimum is enforced for resizing the minimum isn't exposed by the
information_schema.system_variables table.

This creates a plugin function plugin_opt_set_limits_by_name that
allows plugins to adjust the limits of their system variables during
plugin initialization.
@grooverdan grooverdan added the MariaDB Foundation Pull requests created by MariaDB Foundation label Jan 20, 2025
@grooverdan grooverdan requested review from vuvova and dr-m January 20, 2025 13:06
Copy link
Member

@vuvova vuvova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it went the wrong way. Instead of adding a function for plugin to call to adjust the limits, I'd add an assert into OPTION_SET_LIMITS that max, min, and default values are divisible by the block size. And the same into Sys_var_integer::Sys_var_integer. Also, other asserts from Sys_var_integer could make sense in OPTION_SET_LIMITS too (like min < max)

@grooverdan
Copy link
Member Author

I think it went the wrong way. Instead of adding a function for plugin to call to adjust the limits, I'd add an assert into OPTION_SET_LIMITS that max, min, and default values are divisible by the block size. And the same into Sys_var_integer::Sys_var_integer. Also, other asserts from Sys_var_integer could make sense in OPTION_SET_LIMITS too (like min < max)

I don't follow how assertions are solving a problem. I'm not solving MDEV-35890 here. The innodb buffer pool size is dependent on the page size, set in innodb_init_params, but Sys_vars are initialized before this is called.

Another deeper change possibility that I think is more correct is changing the sys_var min/max/default to pointers and point them to the st_mysql_sys_var values rather than copying them. This saves doing a plugin_opt_set_limits call, but I haven't looked all the way though here.

And missed including test result change. opps.

@vuvova
Copy link
Member

vuvova commented Jan 20, 2025

Variable metadata (for a integer sysvar) include min and max values and a block size. It's reasonable to expect these values to be consistent with each other. min should be less than max. both min and max should be divisible by block size.

Asserts would ensure that variable metadata is internally consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MariaDB Foundation Pull requests created by MariaDB Foundation
Development

Successfully merging this pull request may close these issues.

2 participants