Debian Codegraph @

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

raw
1 --source include/have_debug.inc
2 --source include/have_debug_sync.inc
3
4 --echo # Prepare schema used in the tests.
5 --source include/ib_log_spammer_init.inc
6
7 let $orig_redo_log_capacity = `SELECT @@innodb_redo_log_capacity`;
8
9 --echo # Ensure there is a lot of free space in the redo log.
10 SET GLOBAL innodb_log_checkpoint_now = ON;
11
12 SET GLOBAL DEBUG="+d,log_force_consumption";
13
14 --echo # Waiting until we have exactly 1 redo log file.
15 let MYSQLD_DATADIR=`SELECT @@datadir`;
16 let MYSQLD_IB_REDO_LOG_NON_TMP_FILES_COUNT_MAX = 1;
17 --source include/ib_redo_log_files_count_wait.inc
18
19 --echo # Disable checkpointing
20 SET GLOBAL innodb_checkpoint_disabled = ON;
21
22 CREATE TABLE t (a INT) ENGINE=InnoDB;
23
24 --echo # Create connection which generates spam to the redo log.
25 --connect(C1,localhost,root,,test)
26 --send CALL log_spammer()
27 --connection default
28
29 --echo # Redo log data is being generated and redo is resized-up after each round.
30 let $i = 0;
31 while ($i < 4) {
32 --echo "Waiting for physical size to reach 75% of"
33 SELECT @@innodb_redo_log_capacity;
34
35 let $wait_timeout= 60;
36 let $wait_condition=
37 SELECT 0.75*@@innodb_redo_log_capacity/1024/1024 <= variable_value
38 FROM performance_schema.global_status WHERE variable_name = 'Innodb_redo_log_physical_size';
39 --source include/wait_condition.inc
40
41 --sleep 1
42 SET GLOBAL innodb_redo_log_capacity = @@innodb_redo_log_capacity * 2;
43 inc $i;
44 }
45
46 --echo # Create 1 row in t.
47 INSERT INTO t(a) VALUES(42);
48
49 --echo # Enable checkpointing
50 SET GLOBAL innodb_checkpoint_disabled = OFF;
51
52 --echo # Redo log is resized-down in single shot.
53 --eval SET GLOBAL innodb_redo_log_capacity = $orig_redo_log_capacity
54
55 let $wait_timeout= 60;
56 let $wait_condition=
57 SELECT variable_value <= @@innodb_redo_log_capacity/1024/1024
58 FROM performance_schema.global_status WHERE variable_name = 'Innodb_redo_log_physical_size';
59 --source include/wait_condition.inc
60
61 --echo # Kill the MySQL and recover to see all is fine
62 --source include/kill_and_restart_mysqld.inc
63
64 SELECT * FROM t;
65
66 --echo # Cleanup
67 DROP TABLE t;
68 --source include/ib_log_spammer_cleanup.inc