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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
|
include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Slave SQL: The incident LOST_EVENTS occurred on the master. .*");
call mtr.add_suppression("Write to binary log failed: Multi-row statements required more than .max_binlog_stmt_cache_size.* ");
call mtr.add_suppression("Write to binary log failed: Multi-statement transaction required more than .max_binlog_cache_size.* ");
call mtr.add_suppression("Incident event write to the binary log file failed");
call mtr.add_suppression("handlerton rollback failed");
ALTER DATABASE test CHARACTER SET latin1 COLLATE latin1_swedish_ci;
"*********** Annotate Event write failure **************"
SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
SET GLOBAL max_binlog_stmt_cache_size = 4096;
SET GLOBAL binlog_stmt_cache_size = 4096;
disconnect master;
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MYISAM;
connection master;
"#######################################################################"
"# Test Case1: Annotate event write failure for MyISAM #"
"#######################################################################"
ERROR HY000: Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.
# Validating update was not binlogged..
# ..success
# Validating that the inserted data was saved on the master..
# ..success
connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
# Validating that the insert was not replicated to the slave..
# ..success
"#######################################################################"
"# Test Case2: Annotate event write failure for INNODB #"
"#######################################################################"
connection master;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=INNODB;
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again
# Validating binlog GTID position progressed from first insert..
# ..success
# Validating that only the first insert into t2 saved..
# ..success
include/save_master_gtid.inc
connection slave;
include/sync_with_master_gtid.inc
# Validating the first insert into t2 replicated to slave..
include/diff_tables.inc [master:test.t2,slave:test.t2]
# ..success
"#######################################################################"
"# Test Case3: Annotate event write failure for mixed engine UPDATE #"
"#######################################################################"
connection master;
ERROR HY000: Multi-row statements required more than 'max_binlog_stmt_cache_size' bytes of storage.
# Validating update was not binlogged..
# ..success
# Validating non-transactional part of update saved..
# ..success
# Validating transactional part of update was rolled back..
# ..success
include/save_master_gtid.inc
connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
# Validating the rolled-back multi-engine update did not replicate to slave at all..
# ..success
connection master;
"****** Clean up *******"
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
DROP TABLE t1,t2;
"*********** TABLE MAP Event write failure **************"
CREATE TABLE tm (f INT) ENGINE=MYISAM;
CREATE TABLE ti (f INT) ENGINE=INNODB;
INSERT INTO tm VALUES (10);
INSERT INTO ti VALUES (20);
connection slave;
"#######################################################################"
"# Test Case4: Table_map event write failure for trans engine UPDATE #"
"#######################################################################"
# Transaction should be rolled back without writing incident event
connection master;
SET debug_dbug="+d,table_map_write_error";
UPDATE ti, tm set ti.f=30;
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again
# Validating update was not binlogged..
# ..success
# Validating update was rolled back from storage engines..
# ..success
include/save_master_gtid.inc
connection slave;
include/sync_with_master_gtid.inc
"#######################################################################"
"# Test Case5: Table_map event write failure for mixed engine UPDATE #"
"#######################################################################"
connection master;
# In case of mixed engines if non trans table is updated write INCIDENT event
UPDATE ti,tm SET tm.f=88, ti.f=120;
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again
# Validating update was not binlogged..
# ..success
# Validating that only the non-transactional update saved on master..
# ..success
connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
# Validating that neither of the updates replicated to slave..
# ..success
"#######################################################################"
"# Test Case6: Committing a transaction consisting of two updates:
"# S1) Update transactional table
"# S2) Update transactional table
"# with a table_map event write failure on the second event should
"# roll-back only the second update without incident
"#######################################################################"
connection master;
SET debug_dbug="";
BEGIN;
UPDATE ti, tm set ti.f=40;
SET debug_dbug="+d,table_map_write_error";
UPDATE ti, tm set ti.f=50;
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again
COMMIT;
# Validating binlog GTID position progressed from first update..
# ..success
# Validating the first update saved..
# ..and that the second update did not save..
# ..success
# Validating that only the first update replicated to slave without incident
connection master;
include/save_master_gtid.inc
connection slave;
include/sync_with_master_gtid.inc
include/diff_tables.inc [master:test.ti,slave:test.ti]
"#######################################################################"
"# Test Case7: Rolling back a transaction consisting of two updates:
"# S1) Update transactional table
"# S2) Update transactional table
"# with a table_map event write failure on the second event should
"# roll-back both updates without incident
"#######################################################################"
connection master;
SET debug_dbug="";
BEGIN;
UPDATE ti, tm set ti.f=60;
SET debug_dbug="+d,table_map_write_error";
UPDATE ti, tm set ti.f=70;
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again
ROLLBACK;
# Validating update was not binlogged..
# ..success
# Validating that neither update saved on master..
# ..success
# Validating the transaction did not replicate to the slave
connection master;
include/save_master_gtid.inc
connection slave;
include/sync_with_master_gtid.inc
include/diff_tables.inc [master:test.ti,slave:test.ti]
"#######################################################################"
"# Test Case8: Committing a transaction consisting of two updates:
"# S1) Update transactional table
"# S2) Update mixed trans/non-trans tables
"# with a table_map event write failure on the second event should
"# roll-back only the second update with incident
"#######################################################################"
connection master;
BEGIN;
SET debug_dbug="";
UPDATE ti, tm set ti.f=80;
SET debug_dbug="+d,table_map_write_error";
UPDATE ti, tm set ti.f=90,tm.f=99;
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again
COMMIT;
# Validating binlog GTID position progressed from first update..
# ..success
# Validating the first update saved..
# ..and the transactional part of the second update did not save..
# ..whereas the non-trans part of the second update did save..
# ..success
# Validating that the incident propagated to the slave
connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
# Validating that the first update replicated to the slave..
# ..and neither part of the second update replicated..
# ..success
"#######################################################################"
"# Test Case9: Rolling back a transaction consisting of two updates:
"# S1) Update transactional table
"# S2) Update mixed trans/non-trans tables
"# with a table_map event write failure on the second event should
"# roll-back both transactional updates, preserve the non-transactional
"# update on the master (only), and write an incident event
"#######################################################################"
connection master;
SET debug_dbug="";
BEGIN;
UPDATE ti, tm set ti.f=100;
SET debug_dbug="+d,table_map_write_error";
UPDATE ti, tm set ti.f=110,tm.f=111;
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again
ROLLBACK;
# Validating update was not binlogged..
# ..success
# Validating trans updates rollback, but the non-trans update stays..
# ..success
# Validating that the incident propagated to the slave
connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1590]
# Validating that none of the updates replicated to the slave
include/diff_tables.inc [master:test.ti,slave:test.ti]
# ..success
"#######################################################################"
"# Test Case10: If an incident event fails to write, a specific error
"# should be logged
"#
"# Note: This test case is the same as test case 5, with the caveat of
"# the incident event failing to write.
"#######################################################################"
connection master;
SET debug_dbug="d,table_map_write_error,incident_event_write_error";
UPDATE ti, tm set ti.f=120, tm.f=122;
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mariadbd variable and try again
# Validate error message indicating incident event failed to write
FOUND 1 /Incident event write to the binary log file failed/ in mysqld.1.err
connection master;
"******** Clean Up **********"
SET GLOBAL debug_dbug = '';
DROP TABLE tm,ti;
ALTER DATABASE test CHARACTER SET utf8mb4 COLLATE utf8mb4_uca1400_ai_ci;
include/rpl_end.inc
|