| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
# |
| 4 |
# Initialize test data |
| 5 |
connection master; |
| 6 |
create table t1 (a int) engine=innodb; |
| 7 |
insert into t1 values (1); |
| 8 |
include/save_master_gtid.inc |
| 9 |
connection slave; |
| 10 |
include/sync_with_master_gtid.inc |
| 11 |
include/stop_slave.inc |
| 12 |
call mtr.add_suppression("Connection was killed"); |
| 13 |
call mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends"); |
| 14 |
set @save_parallel_threads= @@global.slave_parallel_threads; |
| 15 |
set @save_parallel_mode= @@global.slave_parallel_mode; |
| 16 |
set @save_transaction_retries= @@global.slave_transaction_retries; |
| 17 |
set @save_innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout; |
| 18 |
set @@global.slave_parallel_threads= 2; |
| 19 |
set @@global.slave_parallel_mode= CONSERVATIVE; |
| 20 |
set @@global.slave_transaction_retries= 0; |
| 21 |
set @@global.innodb_lock_wait_timeout= 10; |
| 22 |
# Grabbing lock on innodb row to force future replication transaction to wait (and eventually timeout) |
| 23 |
BEGIN; |
| 24 |
select * from t1 where a=1 for update; |
| 25 |
a |
| 26 |
1 |
| 27 |
connection master; |
| 28 |
set @old_dbug= @@session.debug_dbug; |
| 29 |
set @@session.debug_dbug="+d,binlog_force_commit_id"; |
| 30 |
SET @commit_id= 10000; |
| 31 |
update t1 set a=2 where a=1; |
| 32 |
SET @commit_id= 10001; |
| 33 |
insert into t1 values (3); |
| 34 |
set @@session.debug_dbug= @old_dbug; |
| 35 |
connection slave; |
| 36 |
start slave; |
| 37 |
# Waiting for first transaction to start (and be held at innodb row lock).. |
| 38 |
# Waiting for next transaction to start and hold at do_gco_wait().. |
| 39 |
connection slave1; |
| 40 |
set @@session.debug_dbug="+d,hold_sss_with_err_lock"; |
| 41 |
show slave status; |
| 42 |
connection slave; |
| 43 |
set debug_sync="now wait_for sss_got_err_lock"; |
| 44 |
kill <TID of worker in do_gco_wait>; |
| 45 |
set debug_sync="now signal sss_continue"; |
| 46 |
connection slave1; |
| 47 |
# Waiting for SHOW SLAVE STATUS to complete.. |
| 48 |
# ..done |
| 49 |
connection slave; |
| 50 |
ROLLBACK; |
| 51 |
include/wait_for_slave_sql_error.inc [errno=1927] |
| 52 |
# |
| 53 |
# Cleanup |
| 54 |
connection master; |
| 55 |
drop table t1; |
| 56 |
include/save_master_gtid.inc |
| 57 |
connection slave; |
| 58 |
set debug_sync= "RESET"; |
| 59 |
set @@global.slave_parallel_threads= @save_parallel_threads; |
| 60 |
set @@global.slave_parallel_mode= @save_parallel_mode; |
| 61 |
set @@global.slave_transaction_retries= @save_transaction_retries; |
| 62 |
set @@global.innodb_lock_wait_timeout= @save_innodb_lock_wait_timeout; |
| 63 |
start slave sql_thread; |
| 64 |
include/sync_with_master_gtid.inc |
| 65 |
include/rpl_end.inc |
| 66 |
# End of rpl_deadlock_show_slave_status.test |