mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-13626: Clean up the buffer pool resizing tests from MySQL 5.7
buf_pool_resize(): Simplify the fault injection for innodb.buf_pool_resize_oom. innodb.buf_pool_resize_oom: Use a small buffer pool. innodb.innodb_buffer_pool_load_now: Make use of the sequence engine, to avoid creating explicit InnoDB record locks. Clean up the accesses to information_schema.innodb_buffer_page_lru.
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
--source include/have_innodb.inc
|
||||
# include/restart_mysqld.inc does not work in embedded mode
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
--let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
|
||||
|
||||
@ -26,32 +27,19 @@ CREATE TABLE ib_bp_test
|
||||
(a INT AUTO_INCREMENT, b VARCHAR(64), c TEXT, PRIMARY KEY (a), KEY (b, c(128)))
|
||||
ENGINE=INNODB;
|
||||
|
||||
let $check_cnt =
|
||||
SELECT PAGE_NUMBER FROM information_schema.innodb_buffer_page_lru
|
||||
WHERE table_name = '`test`.`ib_bp_test`';
|
||||
|
||||
SELECT SPACE INTO @space FROM information_schema.innodb_buffer_page_lru
|
||||
WHERE table_name = '`test`.`ib_bp_test`' AND PAGE_NUMBER=3;
|
||||
|
||||
let SPACE=`SELECT @space`;
|
||||
|
||||
INSERT INTO ib_bp_test
|
||||
SELECT NULL, REPEAT('b', 64), REPEAT('c', 256) FROM seq_1_to_16382;
|
||||
|
||||
SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
|
||||
WHERE table_name LIKE '%ib_bp_test%';
|
||||
|
||||
--let SPACE = `SELECT space FROM information_schema.innodb_sys_tables WHERE name LIKE '%ib_bp_test%'`
|
||||
|
||||
# See that we have a small number of pages in the LRU
|
||||
--eval $check_cnt
|
||||
|
||||
# Here we end up with 16382 rows in the table
|
||||
--disable_query_log
|
||||
INSERT INTO ib_bp_test (b, c) VALUES (REPEAT('b', 64), REPEAT('c', 256));
|
||||
INSERT INTO ib_bp_test (b, c) VALUES (REPEAT('B', 64), REPEAT('C', 256));
|
||||
let $i=12;
|
||||
while ($i)
|
||||
{
|
||||
--eval INSERT INTO ib_bp_test (b, c) VALUES ($i, $i * $i);
|
||||
INSERT INTO ib_bp_test (b, c) SELECT b, c FROM ib_bp_test;
|
||||
dec $i;
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
# Accept 83 for 64k page size, 163 for 32k page size, 329 for 16k page size,
|
||||
# 662 for 8k page size & 1392 for 4k page size
|
||||
--replace_result 83 {checked_valid} 163 {checked_valid} 329 {checked_valid} 662 {checked_valid} 1392 {checked_valid}
|
||||
--eval $check_cnt
|
||||
WHERE table_name = '`test`.`ib_bp_test`';
|
||||
|
||||
# Dump
|
||||
SET GLOBAL innodb_buffer_pool_dump_now = ON;
|
||||
@ -81,6 +69,8 @@ EOF
|
||||
|
||||
--move_file $file $file.now
|
||||
|
||||
# Complete purge (and change buffer merge).
|
||||
SET GLOBAL innodb_fast_shutdown=0;
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
# Make sure no dump after shutdown
|
||||
@ -92,10 +82,11 @@ EOF
|
||||
--move_file $file.now $file
|
||||
|
||||
# See that we have no pages in the LRU
|
||||
--eval $check_cnt
|
||||
SELECT PAGE_NUMBER FROM information_schema.innodb_buffer_page_lru
|
||||
WHERE table_name = '`test`.`ib_bp_test`';
|
||||
|
||||
# Load the table so that entries in the I_S table do not appear as NULL
|
||||
select count(*) from ib_bp_test where a = 1;
|
||||
select count(*) from ib_bp_test LIMIT 0;
|
||||
|
||||
# Load
|
||||
SET GLOBAL innodb_buffer_pool_load_now = ON;
|
||||
@ -117,10 +108,8 @@ FROM information_schema.global_status
|
||||
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
|
||||
--enable_warnings
|
||||
|
||||
# Accept 83 for 64k page size, 163 for 32k page size, 329 for 16k page size,
|
||||
# 662 for 8k page size & 1392 for 4k page size
|
||||
--replace_result 83 {checked_valid} 163 {checked_valid} 329 {checked_valid} 662 {checked_valid} 1392 {checked_valid}
|
||||
--eval $check_cnt
|
||||
SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
|
||||
WHERE table_name = '`test`.`ib_bp_test`';
|
||||
|
||||
# Add some total garbage to the dump file
|
||||
--let IBDUMPFILE = $file
|
||||
|
Reference in New Issue
Block a user