Skip to content

MDEV-40950: Crash after memory pressure event - #5796

Open
dr-m wants to merge 1 commit into
10.11from
MDEV-40950
Open

dr-m wants to merge 1 commit into
10.11from
MDEV-40950

Conversation

@dr-m

@dr-m dr-m commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

buf_pool_t::garbage_collect(): Correctly handle the SHRINK_ABORT return value of buf_pool_t::shrink().

This fixes a regression that was introduced in ba81009 of #3826.

@dr-m
dr-m requested a review from Thirunarayanan September 30, 2026 08:38
@dr-m dr-m self-assigned this Sep 30, 2026
buf_pool_t::garbage_collect(): Correctly handle the SHRINK_ABORT
return value of buf_pool_t::shrink().
@CLAassistant

Copy link
Copy Markdown

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.

Comment on lines -1068 to +1073
if (shrink(size))
{
switch (shrink(size)) {
case SHRINK_IN_PROGRESS:
continue;
case SHRINK_ABORT:
goto aborted;
case SHRINK_DONE:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If the goto aborted is removed, the test innodb.innodb_buffer_pool_resize_temporary will trigger a debug assertion failure:

Version: '10.11.19-MariaDB-debug-log'  socket: '/dev/shm/10/mysql-test/var/tmp/mysqld.1.sock'  port: 19000  Source distribution
2026-09-30 11:42:38 4 [Note] InnoDB: Resizing hash tables
2026-09-30 11:42:38 4 [Note] InnoDB: innodb_buffer_pool_size=24m (1515 pages) resized from 8m (505 pages)
2026-09-30 11:42:38 0 [Note] InnoDB: Memory pressure event shrunk innodb_buffer_pool_size=16m (1010 pages) from 24m (1515 pages)
2026-09-30 11:42:38 4 [Note] InnoDB: Memory pressure event shrunk innodb_buffer_pool_size=8m (505 pages) from 16m (1010 pages)
mariadbd: …/storage/innobase/buf/buf0buf.cc:4209: void buf_pool_t::validate(): Assertion `(free).count <= n_free' failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants