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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
# Scenario "too_slow" - no-redo dirtied page inserted too late.
#
let $i = $n_conn;
while ($i > 0) {
connect(con$i, localhost, root,,);
dec $i;
}
--connection default
--echo #
--echo # 0. Freeze single no-redo mtr (MTR_LOG_NO_REDO) in mtr0mtr.cc, just
--echo # before it inserts the dirty page to flush list.
--echo #
BEGIN;
DELETE FROM tmp_t WHERE a < 0;
SET DEBUG = "+d,btr_ins_pause_on_mtr_noredo_before_add_dirty_blocks";
--send CALL mtr_noredo_generate_single();
connect(con_mgr, localhost, root,,);
SET DEBUG_SYNC = "now WAIT_FOR btr_ins_paused";
--source ../include/log_read_current_lsn.inc
let $init_lsn = $current_lsn;
if ($debug_test) {
--echo Current LSN: $current_lsn
}
--echo #
--echo # 1. Allow user threads to execute many redo-based mini-transactions,
--echo # until current lsn is greater than init_lsn by more than capacity
--echo # of log.recent_closed.
--echo #
let $i = $n_conn;
while ($i > 0) {
--connection con$i
BEGIN;
eval DELETE FROM t$i WHERE a < 0;
dec $i;
}
let $i = $n_conn;
while ($i > 0) {
--connection con$i
eval SET @q = CONCAT("CALL mtr_redo_generate_multi(", $i, ", 1800, 120)");
PREPARE stmt FROM @q;
--send EXECUTE stmt;
dec $i;
}
--connection con_mgr
let $wait_lsn = $init_lsn + 2*1024*1024 + 10;
--source ../include/log_wait_for_current_lsn.inc
--echo #
--echo # 2. Optionally flush all dirty pages.
--echo #
if ($empty_flush_list) {
--echo Flush all dirty pages...
SET GLOBAL innodb_buf_flush_list_now = 1;
}
--echo #
--echo # 3. Resume the frozen no-redo mtr which seems to be too old.
--echo #
SET DEBUG_SYNC = "now SIGNAL btr_ins_resume";
--connection default
reap;
SET DEBUG = "-d,btr_ins_pause_on_mtr_noredo_before_add_dirty_blocks";
SET DEBUG_SYNC = "mtr_noredo_before_add_dirty_blocks CLEAR";
COMMIT;
# Just to clear the signal btr_ins_resume:
SET DEBUG_SYNC = "now WAIT_FOR btr_ins_resume";
disconnect con_mgr;
--echo #
--echo # 4. Finish pending insertions in redo-based mini-transactions.
--echo #
let $i = $n_conn;
while ($i > 0) {
--connection con$i
reap;
COMMIT;
disconnect con$i;
dec $i;
}
--connection default
--echo #
--echo # 5. Execute two standard mini-transactions to ensure all is fine.
--echo #
CALL mtr_redo_generate_single(1, 1000);
CALL mtr_noredo_generate_single();
CALL mtr_redo_generate_single(2, 1000);
|