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
|
# Prepare schema.
CREATE TABLE t (a INT PRIMARY KEY, b CHAR(100));
# Disable the dict_stats thread and the master thread to avoid redo log records being created in background.
SET GLOBAL innodb_dict_stats_disabled_debug = 1;
SET GLOBAL innodb_master_thread_disabled_debug = 1;
# Execute sharp checkpoint.
SET GLOBAL innodb_log_checkpoint_now = 1;
# Ensure that redo log is logically empty (within 1 block)
include/assert.inc ['Redo log is logically empty (has 1 block)']
# Disable page cleaners and prevent page flushing/checkpointing.
SET GLOBAL innodb_dict_stats_disabled_debug = 1;
SET GLOBAL innodb_master_thread_disabled_debug = 1;
SET GLOBAL innodb_log_checkpoint_now = 1;
SET GLOBAL innodb_page_cleaner_disabled_debug = 1;
SET GLOBAL innodb_checkpoint_disabled = 1;
SET GLOBAL innodb_purge_stop_now = 1;
# Apply some modifications.
INSERT INTO t(a,b) VALUES (1, REPEAT('x',100)), (2, REPEAT('x',100)), (3, REPEAT('x',100)),
(4, REPEAT('x',100)), (5, REPEAT('x',100)), (6, REPEAT('x',100));
UPDATE t SET b = REPEAT('y',100);
# Wait until the logical size is updated:
SET GLOBAL DEBUG = '+d,syncpoint_log_status_variables_updated';
SET DEBUG_SYNC = 'now WAIT_FOR reached_log_status_variables_updated';
SET GLOBAL DEBUG = '-d,syncpoint_log_status_variables_updated';
SET DEBUG_SYNC = 'now SIGNAL continue_log_status_variables_updated';
# Check if the logical size of the redo log is greater than 1kB.
include/assert.inc ['Redo log has more than 1kB of logical data']
# Apply single row modification.
UPDATE t SET b = REPEAT('z',100) WHERE a=1;
# Wait until the logical size is updated:
SET GLOBAL DEBUG = '+d,syncpoint_log_status_variables_updated';
SET DEBUG_SYNC = 'now WAIT_FOR reached_log_status_variables_updated';
SET GLOBAL DEBUG = '-d,syncpoint_log_status_variables_updated';
SET DEBUG_SYNC = 'now SIGNAL continue_log_status_variables_updated';
# Check if the logical size increase is in proper range (between 100bytes and 1kB).
include/assert.inc ['Redo log increased by at least 100 bytes']
include/assert.inc ['Redo log increased by no more than 16kB']
# Enable page cleaners, page flushing and log checkpointing.
SET GLOBAL innodb_dict_stats_disabled_debug = 0;
SET GLOBAL innodb_master_thread_disabled_debug = 0;
SET GLOBAL innodb_page_cleaner_disabled_debug = 0;
SET GLOBAL innodb_checkpoint_disabled = 0;
SET GLOBAL innodb_purge_stop_now = 0;
SET GLOBAL innodb_purge_run_now = 1;
# Execute sharp checkpoint.
SET GLOBAL innodb_log_checkpoint_now = 1;
# Ensure that redo log is logically empty (within 1 block)
include/assert.inc ['Redo log is logically empty (has 1 block)']
# Enable the dict_stats thread and the master thread.
SET GLOBAL innodb_dict_stats_disabled_debug = 0;
SET GLOBAL innodb_master_thread_disabled_debug = 0;
# Cleanup.
DROP TABLE t;
|