1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-36781: Assertion i < BUF_BUDDY_SIZES failed in buf_buddy_shrink()

buf_buddy_shrink(): Properly cover the case when KEY_BLOCK_SIZE
corresponds to the innodb_page_size, that is, the ROW_FORMAT=COMPRESSED
page frame is directly allocated from the buffer pool, not via the
binary buddy allocator.

buf_LRU_check_size_of_non_data_objects(): Avoid a crash when the
buffer pool is being shrunk.

buf_pool_t::shrink(): Abort if over 95% of the shrunk buffer pool
would be occupied by the adaptive hash index or record locks.
This commit is contained in:
Marko Mäkelä
2025-05-13 12:27:46 +03:00
parent 56e0be34bc
commit bb48d7bc81
6 changed files with 31 additions and 15 deletions

View File

@@ -12,12 +12,19 @@ select @@innodb_buffer_pool_size;
10485760
create table t1 (id int primary key, val int not null)
ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
create table t2 (id int primary key, val int not null)
ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=$kbs;
SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR
INSERT INTO t1 SELECT seq*4,seq*4 FROM seq_1_to_262144;
SET STATEMENT foreign_key_checks=0, unique_checks=0 FOR
INSERT INTO t2 SELECT seq*4,seq*4 FROM seq_1_to_16384;
set global innodb_buffer_pool_size = 7340032;
select count(val) from t1;
count(val)
262144
select count(val) from t2;
count(val)
16384
set global innodb_adaptive_hash_index=OFF;
set global innodb_buffer_pool_size = 24117248;
set global innodb_buffer_pool_size = 26214400;
@@ -29,7 +36,10 @@ select @@innodb_buffer_pool_size;
select count(val) from t1;
count(val)
262144
drop table t1;
select count(val) from t2;
count(val)
16384
drop table t1,t2;
SET GLOBAL innodb_max_purge_lag_wait = 0;
SET @save_pct= @@GLOBAL.innodb_max_dirty_pages_pct;
SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm;