| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
connection master; |
| 4 |
# Create a GTID event so the binlog background thread will submit a |
| 5 |
# mysql handler job the next time mysqld is restarted. |
| 6 |
create table t1 (a int); |
| 7 |
include/save_master_gtid.inc |
| 8 |
connection slave; |
| 9 |
include/sync_with_master_gtid.inc |
| 10 |
# Set a debug point that forces the main mysqld thread to sleep before |
| 11 |
# anything is initialized for the mysql handle manager |
| 12 |
# Restart the slave mysqld instance so it re-initializes with the |
| 13 |
# binlog background thread submitting a mysql handler job and the |
| 14 |
# mysql handler initialization suspending for a second. Without the fix |
| 15 |
# associated with this test/patch, the following restart will error |
| 16 |
# with a failed assertion. |
| 17 |
include/rpl_restart_server.inc [server_number=2 parameters: --debug_dbug="+d,delay_start_handle_manager"] |
| 18 |
include/start_slave.inc |
| 19 |
# |
| 20 |
# MDEV-33799 |
| 21 |
# Ensure that when the binary log is used for recovery (as tc log), that |
| 22 |
# the recovery process cannot start the binlog background thread before |
| 23 |
# the mysql handle manager has started. |
| 24 |
connection slave; |
| 25 |
# Add test suppresssions so crash recovery messages don't fail the test |
| 26 |
set session sql_log_bin=0; |
| 27 |
call mtr.add_suppression("mariadbd: Got error '145.*"); |
| 28 |
call mtr.add_suppression("Checking table:.*"); |
| 29 |
call mtr.add_suppression("mysql.gtid_slave_pos:.*hasn't closed the table properly"); |
| 30 |
call mtr.add_suppression("Can't init tc log"); |
| 31 |
call mtr.add_suppression("Aborting"); |
| 32 |
set session sql_log_bin=1; |
| 33 |
# Create slave-side only table |
| 34 |
create table t2 (a int) engine=innodb; |
| 35 |
# Crash mariadbd when binlogging transaction to corrupt database state |
| 36 |
connection slave1; |
| 37 |
set @@session.debug_dbug="+d,crash_before_writing_xid"; |
| 38 |
insert into t2 values (1); |
| 39 |
connection slave; |
| 40 |
connection slave1; |
| 41 |
Got one of the listed errors |
| 42 |
# Restart mariadbd in recovery mode. Note --tc-heuristic-recover |
| 43 |
# forces mysqld to exit with error, so we run mariadbd via CLI |
| 44 |
# MYSQLD_LAST_CMD --debug_dbug="+d,delay_start_handle_manager" --tc-heuristic-recover=COMMIT |
| 45 |
connection server_2; |
| 46 |
connection slave1; |
| 47 |
connection slave; |
| 48 |
include/start_slave.inc |
| 49 |
# |
| 50 |
# Cleanup |
| 51 |
# |
| 52 |
connection master; |
| 53 |
drop table t1; |
| 54 |
include/save_master_gtid.inc |
| 55 |
connection slave; |
| 56 |
include/sync_with_master_gtid.inc |
| 57 |
drop table t2; |
| 58 |
include/rpl_end.inc |