include/master-slave.inc [connection master] connection slave; include/stop_slave.inc set @save_par_thds= @@global.slave_parallel_threads; set @save_strict_mode= @@global.gtid_strict_mode; set @save_innodb_lock_wait_timeout= @@global.innodb_lock_wait_timeout; change master to master_use_gtid=slave_pos; set @@global.slave_parallel_threads= 4; set @@global.slave_parallel_mode= optimistic; set @@global.gtid_strict_mode=ON; set statement sql_log_bin=0 for alter table mysql.gtid_slave_pos engine=innodb; include/start_slave.inc connection master; create table t1 (a int primary key, b int) engine=innodb; insert t1 values (1,1); include/save_master_gtid.inc connection slave; include/sync_with_master_gtid.inc include/stop_slave.inc set @@global.innodb_lock_wait_timeout= 1; connection master; set @@session.gtid_seq_no=100; xa start '1'; update t1 set b=b+10 where a=1; xa end '1'; xa prepare '1'; xa commit '1'; include/save_master_gtid.inc connection slave1; BEGIN; SELECT * FROM mysql.gtid_slave_pos WHERE seq_no=100 FOR UPDATE; domain_id sub_id server_id seq_no connection slave; include/start_slave.inc include/wait_for_slave_sql_error.inc [errno=1942] include/stop_slave_io.inc connection slave1; ROLLBACK; # Cleanup connection master; drop table t1; connection slave; # TODO: Remove after fixing MDEV-21777 set @@global.gtid_slave_pos= "0-1-100"; set @@global.slave_parallel_threads= @save_par_thds; set @@global.gtid_strict_mode= @save_strict_mode; set @@global.innodb_lock_wait_timeout= @save_innodb_lock_wait_timeout; include/start_slave.inc include/rpl_end.inc # End of rpl_xa_prepare_gtid_fail.test