| 1 |
# Prepare schema used in the tests. |
| 2 |
CREATE TABLE t (a INT) ENGINE=InnoDB; |
| 3 |
# Ensure there is a lot of free space in the redo log. |
| 4 |
SET GLOBAL innodb_log_checkpoint_now = ON; |
| 5 |
# Disable checkpointing |
| 6 |
SET GLOBAL innodb_checkpoint_disabled = ON; |
| 7 |
SET GLOBAL DEBUG = '+d,log_force_consumption'; |
| 8 |
# Pause any new log file productions |
| 9 |
SET GLOBAL DEBUG = '+d,syncpoint_log_before_file_produced'; |
| 10 |
# Get notified when a new log file is produced (since now). |
| 11 |
SET GLOBAL DEBUG = '+d,syncpoint_log_after_file_produced'; |
| 12 |
# Waiting until we have exactly 1 redo log file. |
| 13 |
There are <= 1 non-temporary redo log files. |
| 14 |
# Create connection which generates spam to the redo log. |
| 15 |
CALL log_spammer(); |
| 16 |
# Redo log data is being generated. |
| 17 |
# Wait until few log files are produced. |
| 18 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_before_file_produced WAIT_FOR reached_log_before_file_produced'; |
| 19 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_after_file_produced WAIT_FOR reached_log_after_file_produced'; |
| 20 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_before_file_produced WAIT_FOR reached_log_before_file_produced'; |
| 21 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_after_file_produced WAIT_FOR reached_log_after_file_produced'; |
| 22 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_before_file_produced WAIT_FOR reached_log_before_file_produced'; |
| 23 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_after_file_produced WAIT_FOR reached_log_after_file_produced'; |
| 24 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_before_file_produced WAIT_FOR reached_log_before_file_produced'; |
| 25 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_after_file_produced WAIT_FOR reached_log_after_file_produced'; |
| 26 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_before_file_produced WAIT_FOR reached_log_before_file_produced'; |
| 27 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_after_file_produced WAIT_FOR reached_log_after_file_produced'; |
| 28 |
Redo files: 6 |
| 29 |
SET GLOBAL DEBUG = '-d,syncpoint_log_before_file_produced'; |
| 30 |
SET GLOBAL DEBUG = '-d,syncpoint_log_after_file_produced'; |
| 31 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_before_file_produced,continue_log_after_file_produced'; |
| 32 |
# Create 1 row in t. |
| 33 |
INSERT INTO t(a) VALUES(42); |
| 34 |
# Kill the MySQL and recover to see all is fine |
| 35 |
# Kill and restart |
| 36 |
SELECT * FROM t; |
| 37 |
a |
| 38 |
42 |
| 39 |
# Cleanup. |
| 40 |
SET DEBUG_SYNC = 'RESET'; |
| 41 |
DROP TABLE t; |