Debian Codegraph @

mysql-test/suite/innodb/t/page_cleaner.test

raw
1 --source include/have_innodb.inc
2 --source include/have_sequence.inc
3
4 SET @save_pct= @@GLOBAL.innodb_max_dirty_pages_pct;
5 SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm;
6
7 SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
8 SET GLOBAL innodb_max_dirty_pages_pct=0.0;
9
10 CREATE TABLE t(a INT) ENGINE=InnoDB STATS_PERSISTENT=0;
11 --connect (prevent_purge,localhost,root)
12 START TRANSACTION WITH CONSISTENT SNAPSHOT;
13 --connection default
14 SET GLOBAL innodb_max_purge_lag_wait=0;
15
16 let $wait_condition =
17 SELECT variable_value = 0
18 FROM information_schema.global_status
19 WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
20 --source include/wait_condition.inc
21
22 SET GLOBAL innodb_max_dirty_pages_pct=90.0;
23 --disable_cursor_protocol
24 select variable_value into @innodb_async_writes_total_count_before
25 from information_schema.global_status
26 where variable_name='innodb_async_writes_total_count';
27 --enable_cursor_protocol
28
29 --disable_cursor_protocol
30 SELECT variable_value INTO @log_writes FROM information_schema.global_status
31 WHERE variable_name='innodb_log_writes';
32 --enable_cursor_protocol
33
34 BEGIN;
35 --disable_query_log
36 let $N=500;
37 while ($N) {
38 INSERT INTO t SELECT * FROM seq_1_to_10;
39 dec $N;
40 }
41 --enable_query_log
42 ROLLBACK;
43
44 SELECT if(variable_value-@log_writes<500,'ok',variable_value-@log_writes)
45 FROM information_schema.global_status WHERE variable_name='innodb_log_writes';
46 --disconnect prevent_purge
47
48 SELECT variable_value>0 FROM information_schema.global_status
49 WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
50
51 SET GLOBAL innodb_max_dirty_pages_pct=0.0;
52
53 # Without the MDEV-24917 fix, we would time out here.
54 --source include/wait_condition.inc
55
56 select (cast(variable_value as unsigned) >
57 cast(@innodb_async_writes_total_count_before as unsigned))
58 as innodb_async_writes_grow
59 from information_schema.global_status
60 where variable_name='innodb_async_writes_total_count';
61
62 DROP TABLE t;
63
64 SET GLOBAL innodb_max_dirty_pages_pct = @save_pct;
65 SET GLOBAL innodb_max_dirty_pages_pct_lwm = @save_pct_lwm;