| 1 |
# Prepare schema. |
| 2 |
CREATE TABLE t (a INT PRIMARY KEY, b CHAR(100)); |
| 3 |
# Disable the dict_stats thread and the master thread to avoid redo log records being created in background. |
| 4 |
SET GLOBAL innodb_dict_stats_disabled_debug = 1; |
| 5 |
SET GLOBAL innodb_master_thread_disabled_debug = 1; |
| 6 |
# Execute sharp checkpoint. |
| 7 |
SET GLOBAL innodb_log_checkpoint_now = 1; |
| 8 |
# Ensure that redo log is logically empty (within 1 block) |
| 9 |
include/assert.inc ['Redo log is logically empty (has 1 block)'] |
| 10 |
# Disable page cleaners and prevent page flushing/checkpointing. |
| 11 |
SET GLOBAL innodb_dict_stats_disabled_debug = 1; |
| 12 |
SET GLOBAL innodb_master_thread_disabled_debug = 1; |
| 13 |
SET GLOBAL innodb_log_checkpoint_now = 1; |
| 14 |
SET GLOBAL innodb_page_cleaner_disabled_debug = 1; |
| 15 |
SET GLOBAL innodb_checkpoint_disabled = 1; |
| 16 |
SET GLOBAL innodb_purge_stop_now = 1; |
| 17 |
# Apply some modifications. |
| 18 |
INSERT INTO t(a,b) VALUES (1, REPEAT('x',100)), (2, REPEAT('x',100)), (3, REPEAT('x',100)), |
| 19 |
(4, REPEAT('x',100)), (5, REPEAT('x',100)), (6, REPEAT('x',100)); |
| 20 |
UPDATE t SET b = REPEAT('y',100); |
| 21 |
# Wait until the logical size is updated: |
| 22 |
SET GLOBAL DEBUG = '+d,syncpoint_log_status_variables_updated'; |
| 23 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_log_status_variables_updated'; |
| 24 |
SET GLOBAL DEBUG = '-d,syncpoint_log_status_variables_updated'; |
| 25 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_status_variables_updated'; |
| 26 |
# Check if the logical size of the redo log is greater than 1kB. |
| 27 |
include/assert.inc ['Redo log has more than 1kB of logical data'] |
| 28 |
# Apply single row modification. |
| 29 |
UPDATE t SET b = REPEAT('z',100) WHERE a=1; |
| 30 |
# Wait until the logical size is updated: |
| 31 |
SET GLOBAL DEBUG = '+d,syncpoint_log_status_variables_updated'; |
| 32 |
SET DEBUG_SYNC = 'now WAIT_FOR reached_log_status_variables_updated'; |
| 33 |
SET GLOBAL DEBUG = '-d,syncpoint_log_status_variables_updated'; |
| 34 |
SET DEBUG_SYNC = 'now SIGNAL continue_log_status_variables_updated'; |
| 35 |
# Check if the logical size increase is in proper range (between 100bytes and 1kB). |
| 36 |
include/assert.inc ['Redo log increased by at least 100 bytes'] |
| 37 |
include/assert.inc ['Redo log increased by no more than 16kB'] |
| 38 |
# Enable page cleaners, page flushing and log checkpointing. |
| 39 |
SET GLOBAL innodb_dict_stats_disabled_debug = 0; |
| 40 |
SET GLOBAL innodb_master_thread_disabled_debug = 0; |
| 41 |
SET GLOBAL innodb_page_cleaner_disabled_debug = 0; |
| 42 |
SET GLOBAL innodb_checkpoint_disabled = 0; |
| 43 |
SET GLOBAL innodb_purge_stop_now = 0; |
| 44 |
SET GLOBAL innodb_purge_run_now = 1; |
| 45 |
# Execute sharp checkpoint. |
| 46 |
SET GLOBAL innodb_log_checkpoint_now = 1; |
| 47 |
# Ensure that redo log is logically empty (within 1 block) |
| 48 |
include/assert.inc ['Redo log is logically empty (has 1 block)'] |
| 49 |
# Enable the dict_stats thread and the master thread. |
| 50 |
SET GLOBAL innodb_dict_stats_disabled_debug = 0; |
| 51 |
SET GLOBAL innodb_master_thread_disabled_debug = 0; |
| 52 |
# Cleanup. |
| 53 |
DROP TABLE t; |