MDEV-32841 Add tests for new counters.

Only add innodb_async_reads/writes_total_count here.
For all other counters, writing reproducible tests is rather tricky.
This commit is contained in:
Vladislav Vaintroub 2024-01-24 19:28:51 +01:00
parent 59df9f26bb
commit de9c357284
4 changed files with 40 additions and 0 deletions

View file

@ -23,12 +23,21 @@ WHERE table_name = '`test`.`ib_bp_test`';
PAGE_NUMBER
select count(*) from ib_bp_test LIMIT 0;
count(*)
select variable_value into @innodb_async_reads_total_count_before
from information_schema.global_status
where variable_name='innodb_async_reads_total_count';
SET GLOBAL innodb_buffer_pool_load_now = ON;
SELECT variable_value
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
variable_value
Buffer pool(s) load completed at TIMESTAMP_NOW
select (cast(variable_value as unsigned) >
cast(@innodb_async_reads_total_count_before as unsigned))
as async_reads_grow
from information_schema.global_status where variable_name='innodb_async_reads_total_count';
async_reads_grow
1
SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
WHERE table_name = '`test`.`ib_bp_test`';
COUNT(*)

View file

@ -3,12 +3,22 @@ SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm;
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
SET GLOBAL innodb_max_dirty_pages_pct=90.0;
select variable_value into @innodb_async_writes_total_count_before
from information_schema.global_status
where variable_name='innodb_async_writes_total_count';
CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_10000;
SELECT variable_value>0 FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
variable_value>0
1
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
select (cast(variable_value as unsigned) >
cast(@innodb_async_writes_total_count_before as unsigned))
as innodb_async_writes_grow
from information_schema.global_status
where variable_name='innodb_async_writes_total_count';
innodb_async_writes_grow
1
DROP TABLE t;
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct;
SET GLOBAL innodb_max_dirty_pages_pct_lwm = @save_pct_lwm;

View file

@ -88,6 +88,11 @@ 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 LIMIT 0;
# Check that async reads are executed during bufferpool load
select variable_value into @innodb_async_reads_total_count_before
from information_schema.global_status
where variable_name='innodb_async_reads_total_count';
# Load
SET GLOBAL innodb_buffer_pool_load_now = ON;
@ -108,6 +113,12 @@ FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
--enable_warnings
select (cast(variable_value as unsigned) >
cast(@innodb_async_reads_total_count_before as unsigned))
as async_reads_grow
from information_schema.global_status where variable_name='innodb_async_reads_total_count';
SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
WHERE table_name = '`test`.`ib_bp_test`';

View file

@ -14,6 +14,9 @@ WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
--source include/wait_condition.inc
SET GLOBAL innodb_max_dirty_pages_pct=90.0;
select variable_value into @innodb_async_writes_total_count_before
from information_schema.global_status
where variable_name='innodb_async_writes_total_count';
CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_10000;
@ -24,6 +27,13 @@ SET GLOBAL innodb_max_dirty_pages_pct=0.0;
# Without the MDEV-24917 fix, we would time out here.
--source include/wait_condition.inc
select (cast(variable_value as unsigned) >
cast(@innodb_async_writes_total_count_before as unsigned))
as innodb_async_writes_grow
from information_schema.global_status
where variable_name='innodb_async_writes_total_count';
DROP TABLE t;
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct;