Debian Codegraph @

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

raw
1 --source include/have_debug.inc
2
3 --source include/ib_log_spammer_init.inc
4
5 CREATE TABLE t(a INT PRIMARY KEY, b INT);
6 INSERT INTO t(a, b) VALUES(1, 1);
7
8 let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;
9
10 --echo # Resize redo log to 100M:
11 SET GLOBAL innodb_redo_log_capacity = 100*1024*1024;
12
13 SET GLOBAL innodb_log_checkpoint_now = 1;
14
15 --echo # Create connection which generates spam to the redo log.
16 --connect(C1,localhost,root,,test)
17 --send CALL log_spammer()
18 --connect(C2,localhost,root,,test)
19 --send CALL log_spammer()
20 --connection default
21
22 --echo # Wait until redo occupies at least 10MB on disk
23 let $wait_timeout= 600;
24 let $wait_condition =
25 SELECT variable_value >= 10*1024*1024
26 FROM performance_schema.global_status
27 WHERE variable_name = 'Innodb_redo_log_physical_size';
28 --source include/wait_condition.inc
29
30 SET GLOBAL DEBUG = 'd,log_force_truncate';
31
32 --echo # Resize redo log to 8M with usage of truncate (in background spammer keeps adding to redo!):
33 SET GLOBAL innodb_redo_log_capacity = 8*1024*1024;
34
35 --echo # Waiting for status = OK....
36 let $wait_timeout= 60000;
37 let $wait_condition =
38 SELECT variable_value = 'OK'
39 FROM performance_schema.global_status
40 WHERE variable_name = 'Innodb_redo_log_resize_status';
41 --source include/wait_condition.inc
42
43 let SEARCH_PATTERN=Truncating redo log file;
44 --source include/search_pattern.inc
45
46 UPDATE t SET b = 2 WHERE a = 1;
47
48 CALL mtr.add_suppression("The last block of redo had corrupted first_rec_group");
49
50 --source include/kill_and_restart_mysqld.inc
51
52 SELECT * FROM t;
53
54 DROP TABLE t;
55
56 --source include/ib_log_spammer_cleanup.inc