File: log_file_consumer.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (76 lines) | stat: -rw-r--r-- 2,490 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Test for redo files cooperation between producer (log_writer)
# and consumer (log_checkpointer) when it comes to log files
# producing and consuming.

--source include/have_debug.inc
--source include/have_debug_sync.inc

--echo # Prepare schema used in the tests.
--source include/ib_log_spammer_init.inc
CREATE TABLE t (a INT) ENGINE=InnoDB;

--echo # Ensure there is a lot of free space in the redo log.
SET GLOBAL innodb_log_checkpoint_now = ON;

SET GLOBAL DEBUG = '+d,log_force_consumption';

SET GLOBAL DEBUG = '+d,syncpoint_log_before_waiting_for_next_file';

--echo # Freeze log files consumer.
let err_msg=Redo log writer is waiting for a new redo log file;
--eval CALL mtr.add_suppression("$err_msg.*");

SET GLOBAL DEBUG = '+d,syncpoint_log_before_file_consume';

--echo # Wait until log files consumer is frozen.

SET DEBUG_SYNC = 'now WAIT_FOR reached_log_before_file_consume';

--echo # Consumer is frozen. Create connection which generates spam to the redo log.

--connect(C1,localhost,root,,test)
--send CALL log_spammer()
--connection default

--echo # Redo log data is being generated.
--echo # Wait until log_writer signals it is waiting for a next file available.

SET DEBUG_SYNC = 'now WAIT_FOR reached_log_before_waiting_for_next_file';

SET GLOBAL DEBUG = '-d,syncpoint_log_before_waiting_for_next_file';

# No need to keep the log_writer paused because it will be waiting anyway.
SET DEBUG_SYNC = 'now SIGNAL continue_log_before_waiting_for_next_file';

--echo # The log_writer is waiting because there are no free files and consumer is frozen.
--echo # Check that error log received information about that.

let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err;

let SEARCH_PATTERN=$err_msg;
--source include/search_pattern.inc

--echo # Unfreeze the log file consumer and wait until next log file is produced.

SET GLOBAL DEBUG = '+d,syncpoint_log_after_file_produced';

SET GLOBAL DEBUG = '-d,syncpoint_log_before_file_consume';

SET DEBUG_SYNC = 'now SIGNAL continue_log_before_file_consume';
SET DEBUG_SYNC = 'now WAIT_FOR reached_log_after_file_produced';

SET GLOBAL DEBUG = '-d,syncpoint_log_after_file_produced';
SET DEBUG_SYNC = 'now SIGNAL continue_log_after_file_produced';

--echo # Create 1 row in t.
INSERT INTO t(a) VALUES(42);

--echo # Kill the MySQL and recover to see all is fine
--source include/kill_and_restart_mysqld.inc

SELECT * FROM t;

--echo # Cleanup.
SET DEBUG_SYNC = 'RESET';
DROP TABLE t;
--source include/ib_log_spammer_cleanup.inc