Debian Codegraph @

mysql-test/suite/binlog_encryption/binlog_xa_recover.result

raw
1 SET GLOBAL max_binlog_size= 4096;
2 SET GLOBAL innodb_flush_log_at_trx_commit= 1;
3 RESET MASTER;
4 CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
5 INSERT INTO t1 VALUES (100, REPEAT("x", 4100));
6 INSERT INTO t1 VALUES (101, REPEAT("x", 4100));
7 INSERT INTO t1 VALUES (102, REPEAT("x", 4100));
8 connect con1,localhost,root,,;
9 SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont";
10 SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever";
11 INSERT INTO t1 VALUES (1, REPEAT("x", 4100));
12 connection default;
13 SET DEBUG_SYNC= "now WAIT_FOR con1_wait";
14 connect con2,localhost,root,,;
15 SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont";
16 SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever";
17 INSERT INTO t1 VALUES (2, NULL);
18 connection default;
19 SET DEBUG_SYNC= "now WAIT_FOR con2_wait";
20 connect con3,localhost,root,,;
21 SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont";
22 SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever";
23 INSERT INTO t1 VALUES (3, REPEAT("x", 4100));
24 connection default;
25 SET DEBUG_SYNC= "now WAIT_FOR con3_wait";
26 connect con4,localhost,root,,;
27 SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont";
28 SET SESSION debug_dbug="+d,crash_commit_after_log";
29 INSERT INTO t1 VALUES (4, NULL);
30 connection default;
31 SET DEBUG_SYNC= "now WAIT_FOR con4_wait";
32 SET DEBUG_SYNC= "now SIGNAL con1_cont";
33 SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
34 SET DEBUG_SYNC= "now SIGNAL con2_cont";
35 SET DEBUG_SYNC= "now WAIT_FOR con2_ready";
36 SET DEBUG_SYNC= "now SIGNAL con3_cont";
37 SET DEBUG_SYNC= "now WAIT_FOR con3_ready";
38 show binary logs;
39 Log_name File_size
40 master-bin.000001 #
41 master-bin.000002 #
42 master-bin.000003 #
43 master-bin.000004 #
44 master-bin.000005 #
45 master-bin.000006 #
46 include/show_binlog_events.inc
47 Log_name Pos Event_type Server_id End_log_pos Info
48 master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
49 master-bin.000003 # Start_encryption # #
50 master-bin.000003 # Gtid_list # # [#-#-#]
51 master-bin.000003 # Binlog_checkpoint # # master-bin.000002
52 master-bin.000003 # Binlog_checkpoint # # master-bin.000003
53 master-bin.000003 # Gtid # # BEGIN GTID #-#-#
54 master-bin.000003 # Annotate_rows # # INSERT INTO t1 VALUES (102, REPEAT("x", 4100))
55 master-bin.000003 # Table_map # # table_id: # (test.t1)
56 master-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
57 master-bin.000003 # Xid # # COMMIT /* XID */
58 master-bin.000003 # Rotate # # master-bin.000004;pos=POS
59 include/show_binlog_events.inc
60 Log_name Pos Event_type Server_id End_log_pos Info
61 master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
62 master-bin.000004 # Start_encryption # #
63 master-bin.000004 # Gtid_list # # [#-#-#]
64 master-bin.000004 # Binlog_checkpoint # # master-bin.000003
65 master-bin.000004 # Binlog_checkpoint # # master-bin.000004
66 master-bin.000004 # Gtid # # BEGIN GTID #-#-#
67 master-bin.000004 # Annotate_rows # # INSERT INTO t1 VALUES (1, REPEAT("x", 4100))
68 master-bin.000004 # Table_map # # table_id: # (test.t1)
69 master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F
70 master-bin.000004 # Xid # # COMMIT /* XID */
71 master-bin.000004 # Rotate # # master-bin.000005;pos=POS
72 include/show_binlog_events.inc
73 Log_name Pos Event_type Server_id End_log_pos Info
74 master-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
75 master-bin.000005 # Start_encryption # #
76 master-bin.000005 # Gtid_list # # [#-#-#]
77 master-bin.000005 # Binlog_checkpoint # # master-bin.000004
78 master-bin.000005 # Gtid # # BEGIN GTID #-#-#
79 master-bin.000005 # Annotate_rows # # INSERT INTO t1 VALUES (2, NULL)
80 master-bin.000005 # Table_map # # table_id: # (test.t1)
81 master-bin.000005 # Write_rows_v1 # # table_id: # flags: STMT_END_F
82 master-bin.000005 # Xid # # COMMIT /* XID */
83 master-bin.000005 # Gtid # # BEGIN GTID #-#-#
84 master-bin.000005 # Annotate_rows # # INSERT INTO t1 VALUES (3, REPEAT("x", 4100))
85 master-bin.000005 # Table_map # # table_id: # (test.t1)
86 master-bin.000005 # Write_rows_v1 # # table_id: # flags: STMT_END_F
87 master-bin.000005 # Xid # # COMMIT /* XID */
88 master-bin.000005 # Rotate # # master-bin.000006;pos=POS
89 include/show_binlog_events.inc
90 Log_name Pos Event_type Server_id End_log_pos Info
91 master-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
92 master-bin.000006 # Start_encryption # #
93 master-bin.000006 # Gtid_list # # [#-#-#]
94 master-bin.000006 # Binlog_checkpoint # # master-bin.000004
95 PURGE BINARY LOGS TO "master-bin.000006";
96 Warnings:
97 Note 1375 Binary log 'master-bin.000004' is not purged because it may be needed for crash recovery (XID)
98 show binary logs;
99 Log_name File_size
100 master-bin.000004 #
101 master-bin.000005 #
102 master-bin.000006 #
103 SET DEBUG_SYNC= "now SIGNAL con4_cont";
104 connection con4;
105 Got one of the listed errors
106 connection default;
107 SELECT a FROM t1 ORDER BY a;
108 a
109 1
110 2
111 3
112 4
113 100
114 101
115 102
116 Test that with multiple binlog checkpoints, recovery starts from the last one.
117 SET GLOBAL max_binlog_size= 4096;
118 SET GLOBAL innodb_flush_log_at_trx_commit= 1;
119 RESET MASTER;
120 connect con10,localhost,root,,;
121 SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont";
122 INSERT INTO t1 VALUES (10, REPEAT("x", 4100));
123 connection default;
124 SET DEBUG_SYNC= "now WAIT_FOR con10_ready";
125 connect con11,localhost,root,,;
126 SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont";
127 INSERT INTO t1 VALUES (11, REPEAT("x", 4100));
128 connection default;
129 SET DEBUG_SYNC= "now WAIT_FOR con11_ready";
130 connect con12,localhost,root,,;
131 SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont";
132 INSERT INTO t1 VALUES (12, REPEAT("x", 4100));
133 connection default;
134 SET DEBUG_SYNC= "now WAIT_FOR con12_ready";
135 INSERT INTO t1 VALUES (13, NULL);
136 show binary logs;
137 Log_name File_size
138 master-bin.000001 #
139 master-bin.000002 #
140 master-bin.000003 #
141 master-bin.000004 #
142 include/show_binlog_events.inc
143 Log_name Pos Event_type Server_id End_log_pos Info
144 master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
145 master-bin.000004 # Start_encryption # #
146 master-bin.000004 # Gtid_list # # [#-#-#]
147 master-bin.000004 # Binlog_checkpoint # # master-bin.000001
148 master-bin.000004 # Gtid # # BEGIN GTID #-#-#
149 master-bin.000004 # Annotate_rows # # INSERT INTO t1 VALUES (13, NULL)
150 master-bin.000004 # Table_map # # table_id: # (test.t1)
151 master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F
152 master-bin.000004 # Xid # # COMMIT /* XID */
153 SET DEBUG_SYNC= "now SIGNAL con10_cont";
154 connection con10;
155 connection default;
156 SET DEBUG_SYNC= "now SIGNAL con12_cont";
157 connection con12;
158 connection default;
159 SET DEBUG_SYNC= "now SIGNAL con11_cont";
160 connection con11;
161 connection default;
162 Now crash the server
163 SET SESSION debug_dbug="+d,crash_commit_after_log";
164 INSERT INTO t1 VALUES (14, NULL);
165 Got one of the listed errors
166 connection default;
167 SELECT a FROM t1 ORDER BY a;
168 a
169 1
170 2
171 3
172 4
173 10
174 11
175 12
176 13
177 14
178 100
179 101
180 102
181 *** Check that recovery works if we crashed early during rotate, before
182 *** binlog checkpoint event could be written.
183 SET GLOBAL max_binlog_size= 4096;
184 SET GLOBAL innodb_flush_log_at_trx_commit= 1;
185 RESET MASTER;
186 INSERT INTO t1 VALUES (21, REPEAT("x", 4100));
187 INSERT INTO t1 VALUES (22, REPEAT("x", 4100));
188 INSERT INTO t1 VALUES (23, REPEAT("x", 4100));
189 SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event";
190 INSERT INTO t1 VALUES (24, REPEAT("x", 4100));
191 Got one of the listed errors
192 SELECT a FROM t1 ORDER BY a;
193 a
194 1
195 2
196 3
197 4
198 10
199 11
200 12
201 13
202 14
203 21
204 22
205 23
206 24
207 100
208 101
209 102
210 show binary logs;
211 Log_name File_size
212 master-bin.000001 #
213 master-bin.000002 #
214 master-bin.000003 #
215 master-bin.000004 #
216 master-bin.000005 #
217 include/show_binlog_events.inc
218 Log_name Pos Event_type Server_id End_log_pos Info
219 master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
220 master-bin.000004 # Start_encryption # #
221 master-bin.000004 # Gtid_list # # [#-#-#]
222 master-bin.000004 # Binlog_checkpoint # # master-bin.000003
223 master-bin.000004 # Binlog_checkpoint # # master-bin.000004
224 master-bin.000004 # Gtid # # BEGIN GTID #-#-#
225 master-bin.000004 # Annotate_rows # # INSERT INTO t1 VALUES (24, REPEAT("x", 4100))
226 master-bin.000004 # Table_map # # table_id: # (test.t1)
227 master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F
228 master-bin.000004 # Xid # # COMMIT /* XID */
229 master-bin.000004 # Rotate # # master-bin.000005;pos=POS
230 connection default;
231 DROP TABLE t1;