Debian Codegraph @

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

raw
1 # Test for recovery based on multiple log files of different
2 # sizes. The sizes of log files are randomly chosen within
3 # the range 64kB .. 1 MB. Checkpointing is disabled and once
4 # we ran out of free log files, we crash and recover.
5
6 --source include/have_debug.inc
7 --source include/have_debug_sync.inc
8
9 --echo # Prepare schema used in the tests.
10 --source include/ib_log_spammer_init.inc
11 CREATE TABLE t (a INT) ENGINE=InnoDB;
12
13 --echo # Ensure there is a lot of free space in the redo log.
14 SET GLOBAL innodb_log_checkpoint_now = ON;
15
16 --echo # Disable checkpointing
17 SET GLOBAL innodb_checkpoint_disabled = ON;
18
19 SET GLOBAL DEBUG = '+d,log_force_consumption';
20
21 --echo # Pause any new log file productions
22 SET GLOBAL DEBUG = '+d,syncpoint_log_before_file_produced';
23
24 --echo # Get notified when a new log file is produced (since now).
25 SET GLOBAL DEBUG = '+d,syncpoint_log_after_file_produced';
26
27 --echo # Waiting until we have exactly 1 redo log file.
28 let MYSQLD_DATADIR=`SELECT @@datadir`;
29 let MYSQLD_IB_REDO_LOG_NON_TMP_FILES_COUNT_MAX = 1;
30 --source include/ib_redo_log_files_count_wait.inc
31
32 --echo # Create connection which generates spam to the redo log.
33 --connect(C1,localhost,root,,test)
34 --send CALL log_spammer()
35 --connection default
36
37 --echo # Redo log data is being generated.
38 --sleep 1
39
40 --echo # Wait until few log files are produced.
41 let $i = 5;
42 while ($i > 0) {
43 SET DEBUG_SYNC = 'now SIGNAL continue_log_before_file_produced WAIT_FOR reached_log_before_file_produced';
44 SET DEBUG_SYNC = 'now SIGNAL continue_log_after_file_produced WAIT_FOR reached_log_after_file_produced';
45 dec $i;
46 }
47
48 perl;
49 require 'include/ib_redo_log_files.inc';
50 my $n_files = scalar(log_get_non_tmp_files());
51 print "Redo files: $n_files\n";
52 EOF
53
54 SET GLOBAL DEBUG = '-d,syncpoint_log_before_file_produced';
55 SET GLOBAL DEBUG = '-d,syncpoint_log_after_file_produced';
56 SET DEBUG_SYNC = 'now SIGNAL continue_log_before_file_produced,continue_log_after_file_produced';
57
58 --echo # Create 1 row in t.
59 INSERT INTO t(a) VALUES(42);
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 SET DEBUG_SYNC = 'RESET';
68 DROP TABLE t;
69 --source include/ib_log_spammer_cleanup.inc