mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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:
@ -23,12 +23,21 @@ WHERE table_name = '`test`.`ib_bp_test`';
|
|||||||
PAGE_NUMBER
|
PAGE_NUMBER
|
||||||
select count(*) from ib_bp_test LIMIT 0;
|
select count(*) from ib_bp_test LIMIT 0;
|
||||||
count(*)
|
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;
|
SET GLOBAL innodb_buffer_pool_load_now = ON;
|
||||||
SELECT variable_value
|
SELECT variable_value
|
||||||
FROM information_schema.global_status
|
FROM information_schema.global_status
|
||||||
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
|
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
|
||||||
variable_value
|
variable_value
|
||||||
Buffer pool(s) load completed at TIMESTAMP_NOW
|
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
|
SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
|
||||||
WHERE table_name = '`test`.`ib_bp_test`';
|
WHERE table_name = '`test`.`ib_bp_test`';
|
||||||
COUNT(*)
|
COUNT(*)
|
||||||
|
@ -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_lwm=0.0;
|
||||||
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
|
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
|
||||||
SET GLOBAL innodb_max_dirty_pages_pct=90.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;
|
CREATE TABLE t ENGINE=InnoDB SELECT * FROM seq_1_to_10000;
|
||||||
SELECT variable_value>0 FROM information_schema.global_status
|
SELECT variable_value>0 FROM information_schema.global_status
|
||||||
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
|
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
|
||||||
variable_value>0
|
variable_value>0
|
||||||
1
|
1
|
||||||
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
|
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;
|
DROP TABLE t;
|
||||||
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct;
|
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct;
|
||||||
SET GLOBAL innodb_max_dirty_pages_pct_lwm = @save_pct_lwm;
|
SET GLOBAL innodb_max_dirty_pages_pct_lwm = @save_pct_lwm;
|
||||||
|
@ -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
|
# Load the table so that entries in the I_S table do not appear as NULL
|
||||||
select count(*) from ib_bp_test LIMIT 0;
|
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
|
# Load
|
||||||
SET GLOBAL innodb_buffer_pool_load_now = ON;
|
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';
|
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
|
||||||
--enable_warnings
|
--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
|
SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
|
||||||
WHERE table_name = '`test`.`ib_bp_test`';
|
WHERE table_name = '`test`.`ib_bp_test`';
|
||||||
|
|
||||||
|
@ -14,6 +14,9 @@ WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
|
|||||||
--source include/wait_condition.inc
|
--source include/wait_condition.inc
|
||||||
|
|
||||||
SET GLOBAL innodb_max_dirty_pages_pct=90.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;
|
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.
|
# Without the MDEV-24917 fix, we would time out here.
|
||||||
--source include/wait_condition.inc
|
--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;
|
DROP TABLE t;
|
||||||
|
|
||||||
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct;
|
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct;
|
||||||
|
Reference in New Issue
Block a user