| 1 |
######### |
| 2 |
# Setup # |
| 3 |
######### |
| 4 |
CREATE TABLE t1 (c INT); |
| 5 |
INSERT INTO t1 VALUES (1), (2), (3), (4); |
| 6 |
SET @innodb_io_capacity_saved = @@global.innodb_io_capacity; |
| 7 |
SET @innodb_idle_flush_pct_saved = @@global.innodb_idle_flush_pct; |
| 8 |
SET GLOBAL innodb_io_capacity = 200; |
| 9 |
SHOW VARIABLES LIKE "%innodb_io_capacity%"; |
| 10 |
Variable_name Value |
| 11 |
innodb_io_capacity 200 |
| 12 |
innodb_io_capacity_max 2000 |
| 13 |
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; |
| 14 |
set global innodb_idle_flush_pct=0; |
| 15 |
SET GLOBAL innodb_monitor_enable = all; |
| 16 |
SELECT COUNT=0 FROM INFORMATION_SCHEMA.INNODB_METRICS |
| 17 |
WHERE NAME='buffer_flush_batch_total_pages'; |
| 18 |
COUNT=0 |
| 19 |
1 |
| 20 |
SET GLOBAL innodb_limit_optimistic_insert_debug=2; |
| 21 |
insert into t1 select * from t1; |
| 22 |
insert into t1 select * from t1; |
| 23 |
insert into t1 select * from t1; |
| 24 |
insert into t1 select * from t1; |
| 25 |
insert into t1 select * from t1; |
| 26 |
insert into t1 select * from t1; |
| 27 |
SELECT COUNT>0 FROM INFORMATION_SCHEMA.INNODB_METRICS |
| 28 |
WHERE NAME='buffer_pool_pages_dirty'; |
| 29 |
COUNT>0 |
| 30 |
1 |
| 31 |
SELECT COUNT=0 FROM INFORMATION_SCHEMA.INNODB_METRICS |
| 32 |
WHERE NAME='buffer_flush_batch_total_pages'; |
| 33 |
COUNT=0 |
| 34 |
1 |
| 35 |
SET GLOBAL innodb_page_cleaner_disabled_debug = 0; |
| 36 |
SET GLOBAL innodb_idle_flush_pct=25; |
| 37 |
# Waiting for buffer pool pages to get flushed |
| 38 |
SELECT COUNT>0 FROM INFORMATION_SCHEMA.INNODB_METRICS |
| 39 |
WHERE NAME='buffer_flush_background_total_pages'; |
| 40 |
COUNT>0 |
| 41 |
1 |
| 42 |
########### |
| 43 |
# Cleanup # |
| 44 |
########### |
| 45 |
SET GLOBAL innodb_io_capacity = @innodb_io_capacity_saved; |
| 46 |
SET GLOBAL innodb_idle_flush_pct = @innodb_idle_flush_pct_saved; |
| 47 |
SET GLOBAL innodb_limit_optimistic_insert_debug=0; |
| 48 |
SET GLOBAL innodb_monitor_disable = all; |
| 49 |
SET GLOBAL innodb_monitor_reset_all = all; |
| 50 |
SELECT COUNT>0 FROM INFORMATION_SCHEMA.INNODB_METRICS |
| 51 |
WHERE NAME='buffer_flush_background_total_pages'; |
| 52 |
COUNT>0 |
| 53 |
0 |
| 54 |
DROP TABLE t1; |