Skip to content

MDEV-36868: Inconsistency when shrinking innodb_buffer_pool_size #4062

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

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

Conversation

dr-m
Copy link
Contributor

@dr-m dr-m commented May 23, 2025

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

Description

buf_pool_t::resize(): After successfully shrinking the buffer pool, announce the success. The size had already been updated in shrunk(). After failing to shrink the buffer pool, re-enable the adaptive hash index if it had been enabled.

Release Notes

When an attempt to reduce the allocation with SET GLOBAL innodb_buffer_pool_size is made, the adaptive hash index would not always be re-enabled afterwards. Also, no message was output about shrinking the buffer pool.

How can this PR be tested?

SET GLOBAL innodb_buffer_pool_size=16*1024*1024;
SET GLOBAL innodb_buffer_pool_size=8*1024*1024;

and check the server error log.

Basing the PR against the correct MariaDB version

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.

buf_pool_t::resize(): After successfully shrinking the buffer pool,
announce the success. The size had already been updated in shrunk().
After failing to shrink the buffer pool, re-enable the adaptive
hash index if it had been enabled.
@dr-m dr-m self-assigned this May 23, 2025
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@mariadb-DebarunBanerjee mariadb-DebarunBanerjee left a comment

Choose a reason for hiding this comment

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

The changes look correct to me. Since the impact could be significant let's add a test to protect it.

Comment on lines +2082 to +2085
#ifdef BTR_CUR_HASH_ADAPT
if (ahi_disabled)
btr_search_enable(true);
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please add a testcase to check it ? Looks like it is doable just checking checking innodb_adaptive_hash_index global which should reflect the correct state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants