1
1
include/master-slave.inc
2
2
[connection master]
3
3
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
4
- call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occurred on the master. .*");
4
+ call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occured on the master. .*");
5
+ call mtr.add_suppression("Write to binary log failed: Multi-row statements required more than .max_binlog_stmt_cache_size.* ");
6
+ call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size.* ");
7
+ call mtr.add_suppression("Incident event write to the binary log file failed");
8
+ call mtr.add_suppression("handlerton rollback failed");
9
+ "*********** Annotate Event write failure **************"
5
10
SET GLOBAL max_binlog_cache_size = 4096;
6
11
SET GLOBAL binlog_cache_size = 4096;
7
12
SET GLOBAL max_binlog_stmt_cache_size = 4096;
@@ -10,12 +15,212 @@ disconnect master;
10
15
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
11
16
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MYISAM;
12
17
connection master;
13
- ERROR HY000: Writing one row to the row-based binary log failed
18
+ "#######################################################################"
19
+ "# Test Case1: Annotate event write failure for MyISAM #"
20
+ "#######################################################################"
21
+ ERROR HY000: Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage; increase this mysqld variable and try again
22
+ # Validating update was not binlogged..
23
+ # ..success
24
+ # Validating that the inserted data was saved on the master..
25
+ # ..success
26
+ connection slave;
14
27
include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
28
+ # Validating that the insert was not replicated to the slave..
29
+ # ..success
30
+ "#######################################################################"
31
+ "# Test Case2: Annotate event write failure for INNODB #"
32
+ "#######################################################################"
15
33
connection master;
34
+ CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=INNODB;
35
+ ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
36
+ # Validating binlog GTID position progressed from first insert..
37
+ # ..success
38
+ # Validating that only the first insert into t2 saved..
39
+ # ..success
40
+ include/save_master_gtid.inc
41
+ connection slave;
42
+ include/sync_with_master_gtid.inc
43
+ # Validating the first insert into t2 replicated to slave..
44
+ include/diff_tables.inc [master:test.t2,slave:test.t2]
45
+ # ..success
46
+ "#######################################################################"
47
+ "# Test Case3: Annotate event write failure for mixed engine UPDATE #"
48
+ "#######################################################################"
49
+ connection master;
50
+ ERROR HY000: Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage; increase this mysqld variable and try again
51
+ # Validating update was not binlogged..
52
+ # ..success
53
+ # Validating non-transactional part of update saved..
54
+ # ..success
55
+ # Validating transactional part of update was rolled back..
56
+ # ..success
57
+ include/save_master_gtid.inc
58
+ connection slave;
59
+ include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
60
+ # Validating the rolled-back multi-engine update did not replicate to slave at all..
61
+ # ..success
62
+ connection master;
63
+ "****** Clean up *******"
16
64
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
17
65
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
18
66
SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
19
67
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
20
- DROP TABLE t1;
68
+ DROP TABLE t1,t2;
69
+ "*********** TABLE MAP Event write failure **************"
70
+ CREATE TABLE tm (f INT) ENGINE=MYISAM;
71
+ CREATE TABLE ti (f INT) ENGINE=INNODB;
72
+ INSERT INTO tm VALUES (10);
73
+ INSERT INTO ti VALUES (20);
74
+ connection slave;
75
+ "#######################################################################"
76
+ "# Test Case4: Table_map event write failure for trans engine UPDATE #"
77
+ "#######################################################################"
78
+ # Transaction should be rolled back without writing incident event
79
+ connection master;
80
+ SET debug_dbug="+d,table_map_write_error";
81
+ UPDATE ti, tm set ti.f=30;
82
+ ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
83
+ # Validating update was not binlogged..
84
+ # ..success
85
+ # Validating update was rolled back from storage engines..
86
+ # ..success
87
+ include/save_master_gtid.inc
88
+ connection slave;
89
+ include/sync_with_master_gtid.inc
90
+ "#######################################################################"
91
+ "# Test Case5: Table_map event write failure for mixed engine UPDATE #"
92
+ "#######################################################################"
93
+ connection master;
94
+ # In case of mixed engines if non trans table is updated write INCIDENT event
95
+ UPDATE ti,tm SET tm.f=88, ti.f=120;
96
+ ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
97
+ # Validating update was not binlogged..
98
+ # ..success
99
+ # Validating that only the non-transactional update saved on master..
100
+ # ..success
101
+ connection slave;
102
+ include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
103
+ # Validating that neither of the updates replicated to slave..
104
+ # ..success
105
+ "#######################################################################"
106
+ "# Test Case6: Committing a transaction consisting of two updates:
107
+ "# S1) Update transactional table
108
+ "# S2) Update transactional table
109
+ "# with a table_map event write failure on the second event should
110
+ "# roll-back only the second update without incident
111
+ "#######################################################################"
112
+ connection master;
113
+ SET debug_dbug="";
114
+ BEGIN;
115
+ UPDATE ti, tm set ti.f=40;
116
+ SET debug_dbug="+d,table_map_write_error";
117
+ UPDATE ti, tm set ti.f=50;
118
+ ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
119
+ COMMIT;
120
+ # Validating binlog GTID position progressed from first update..
121
+ # ..success
122
+ # Validating the first update saved..
123
+ # ..and that the second update did not save..
124
+ # ..success
125
+ # Validating that only the first update replicated to slave without incident
126
+ connection master;
127
+ include/save_master_gtid.inc
128
+ connection slave;
129
+ include/sync_with_master_gtid.inc
130
+ include/diff_tables.inc [master:test.ti,slave:test.ti]
131
+ "#######################################################################"
132
+ "# Test Case7: Rolling back a transaction consisting of two updates:
133
+ "# S1) Update transactional table
134
+ "# S2) Update transactional table
135
+ "# with a table_map event write failure on the second event should
136
+ "# roll-back both updates without incident
137
+ "#######################################################################"
138
+ connection master;
139
+ SET debug_dbug="";
140
+ BEGIN;
141
+ UPDATE ti, tm set ti.f=60;
142
+ SET debug_dbug="+d,table_map_write_error";
143
+ UPDATE ti, tm set ti.f=70;
144
+ ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
145
+ ROLLBACK;
146
+ # Validating update was not binlogged..
147
+ # ..success
148
+ # Validating that neither update saved on master..
149
+ # ..success
150
+ # Validating the transaction did not replicate to the slave
151
+ connection master;
152
+ include/save_master_gtid.inc
153
+ connection slave;
154
+ include/sync_with_master_gtid.inc
155
+ include/diff_tables.inc [master:test.ti,slave:test.ti]
156
+ "#######################################################################"
157
+ "# Test Case8: Committing a transaction consisting of two updates:
158
+ "# S1) Update transactional table
159
+ "# S2) Update mixed trans/non-trans tables
160
+ "# with a table_map event write failure on the second event should
161
+ "# roll-back only the second update with incident
162
+ "#######################################################################"
163
+ connection master;
164
+ BEGIN;
165
+ SET debug_dbug="";
166
+ UPDATE ti, tm set ti.f=80;
167
+ SET debug_dbug="+d,table_map_write_error";
168
+ UPDATE ti, tm set ti.f=90,tm.f=99;
169
+ ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
170
+ COMMIT;
171
+ # Validating binlog GTID position progressed from first update..
172
+ # ..success
173
+ # Validating the first update saved..
174
+ # ..and the transactional part of the second update did not save..
175
+ # ..whereas the non-trans part of the second update did save..
176
+ # ..success
177
+ # Validating that the incident propagated to the slave
178
+ connection slave;
179
+ include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
180
+ # Validating that the first update replicated to the slave..
181
+ # ..and neither part of the second update replicated..
182
+ # ..success
183
+ "#######################################################################"
184
+ "# Test Case9: Rolling back a transaction consisting of two updates:
185
+ "# S1) Update transactional table
186
+ "# S2) Update mixed trans/non-trans tables
187
+ "# with a table_map event write failure on the second event should
188
+ "# roll-back both transactional updates, preserve the non-transactional
189
+ "# update on the master (only), and write an incident event
190
+ "#######################################################################"
191
+ connection master;
192
+ SET debug_dbug="";
193
+ BEGIN;
194
+ UPDATE ti, tm set ti.f=100;
195
+ SET debug_dbug="+d,table_map_write_error";
196
+ UPDATE ti, tm set ti.f=110,tm.f=111;
197
+ ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
198
+ ROLLBACK;
199
+ # Validating update was not binlogged..
200
+ # ..success
201
+ # Validating trans updates rollback, but the non-trans update stays..
202
+ # ..success
203
+ # Validating that the incident propagated to the slave
204
+ connection slave;
205
+ include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
206
+ # Validating that none of the updates replicated to the slave
207
+ include/diff_tables.inc [master:test.ti,slave:test.ti]
208
+ # ..success
209
+ "#######################################################################"
210
+ "# Test Case10: If an incident event fails to write, a specific error
211
+ "# should be logged
212
+ "#
213
+ "# Note: This test case is the same as test case 5, with the caveat of
214
+ "# the incident event failing to write.
215
+ "#######################################################################"
216
+ connection master;
217
+ SET debug_dbug="d,table_map_write_error,incident_event_write_error";
218
+ UPDATE ti, tm set ti.f=120, tm.f=122;
219
+ ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
220
+ # Validate error message indicating incident event failed to write
221
+ FOUND 1 /Incident event write to the binary log file failed/ in mysqld.1.err
222
+ connection master;
223
+ "******** Clean Up **********"
224
+ SET GLOBAL debug_dbug = '';
225
+ DROP TABLE tm,ti;
21
226
include/rpl_end.inc
0 commit comments