Debian Codegraph @

mysql-test/suite/innodb/include/log_flush_order_test_too_slow.inc

raw
1 # Scenario "too_slow" - no-redo dirtied page inserted too late.
2 #
3
4 let $i = $n_conn;
5 while ($i > 0) {
6 connect(con$i, localhost, root,,);
7 dec $i;
8 }
9
10 --connection default
11
12 --echo #
13 --echo # 0. Freeze single no-redo mtr (MTR_LOG_NO_REDO) in mtr0mtr.cc, just
14 --echo # before it inserts the dirty page to flush list.
15 --echo #
16
17 BEGIN;
18 DELETE FROM tmp_t WHERE a < 0;
19
20 SET DEBUG = "+d,btr_ins_pause_on_mtr_noredo_before_add_dirty_blocks";
21
22 --send CALL mtr_noredo_generate_single();
23
24 connect(con_mgr, localhost, root,,);
25
26 SET DEBUG_SYNC = "now WAIT_FOR btr_ins_paused";
27
28 --source ../include/log_read_current_lsn.inc
29 let $init_lsn = $current_lsn;
30
31 if ($debug_test) {
32 --echo Current LSN: $current_lsn
33 }
34
35 --echo #
36 --echo # 1. Allow user threads to execute many redo-based mini-transactions,
37 --echo # until current lsn is greater than init_lsn by more than capacity
38 --echo # of log.recent_closed.
39 --echo #
40
41 let $i = $n_conn;
42 while ($i > 0) {
43 --connection con$i
44 BEGIN;
45 eval DELETE FROM t$i WHERE a < 0;
46 dec $i;
47 }
48
49 let $i = $n_conn;
50 while ($i > 0) {
51 --connection con$i
52
53 eval SET @q = CONCAT("CALL mtr_redo_generate_multi(", $i, ", 1800, 120)");
54 PREPARE stmt FROM @q;
55 --send EXECUTE stmt;
56
57 dec $i;
58 }
59 --connection con_mgr
60
61 let $wait_lsn = $init_lsn + 2*1024*1024 + 10;
62 --source ../include/log_wait_for_current_lsn.inc
63
64 --echo #
65 --echo # 2. Optionally flush all dirty pages.
66 --echo #
67
68 if ($empty_flush_list) {
69 --echo Flush all dirty pages...
70 SET GLOBAL innodb_buf_flush_list_now = 1;
71 }
72
73 --echo #
74 --echo # 3. Resume the frozen no-redo mtr which seems to be too old.
75 --echo #
76
77 SET DEBUG_SYNC = "now SIGNAL btr_ins_resume";
78
79 --connection default
80 reap;
81 SET DEBUG = "-d,btr_ins_pause_on_mtr_noredo_before_add_dirty_blocks";
82 SET DEBUG_SYNC = "mtr_noredo_before_add_dirty_blocks CLEAR";
83 COMMIT;
84 # Just to clear the signal btr_ins_resume:
85 SET DEBUG_SYNC = "now WAIT_FOR btr_ins_resume";
86
87 disconnect con_mgr;
88
89 --echo #
90 --echo # 4. Finish pending insertions in redo-based mini-transactions.
91 --echo #
92
93 let $i = $n_conn;
94 while ($i > 0) {
95 --connection con$i
96 reap;
97 COMMIT;
98 disconnect con$i;
99 dec $i;
100 }
101 --connection default
102
103 --echo #
104 --echo # 5. Execute two standard mini-transactions to ensure all is fine.
105 --echo #
106
107 CALL mtr_redo_generate_single(1, 1000);
108 CALL mtr_noredo_generate_single();
109 CALL mtr_redo_generate_single(2, 1000);