1source include/not_embedded.inc;
2source include/have_binlog_format_mixed.inc;
3source include/master-slave.inc;
4
5#
6# Semisync initialization
7#
8--connection master
9RESET MASTER;
10--let $sav_enabled_master=`SELECT @@GLOBAL.rpl_semi_sync_master_enabled`
11SET @@GLOBAL.rpl_semi_sync_master_enabled = 1;
12
13--connection slave
14source include/stop_slave.inc;
15--let $sav_enabled_slave=`SELECT @@GLOBAL.rpl_semi_sync_slave_enabled`
16SET @@GLOBAL. rpl_semi_sync_slave_enabled = 1;
17source include/start_slave.inc;
18
19# Prove fixes to
20# MDEV-19376 Assert (!m_active_tranxs->is_tranx_end_pos(trx_wait_binlog_name...)
21#
22#
23# Run few queries to replicate/execute on slave.
24# Stop the slave applier.
25# Replicate/not-executed few more.
26# Restart the slave.
27#
28--connection master
29CREATE TABLE t1 (a INT);
30INSERT INTO t1 SET a = 1;
31--source include/save_master_gtid.inc
32--let $resume_gtid = $master_pos
33FLUSH LOGS;
34INSERT INTO t1 SET a = 2;
35
36--sync_slave_with_master
37--connection slave
38--source include/stop_slave_sql.inc
39
40--connection master
41INSERT INTO t1 SET a = 3;
42
43# the sync connection is 'slave' by default
44--source include/sync_slave_io_with_master.inc
45--connection slave
46--source include/stop_slave_io.inc
47
48--connection master
49RESET MASTER;
50--eval SET @@global.gtid_binlog_state = '$resume_gtid'
51
52# The resume gtid is set up to point to the very first binlog file
53--connection slave
54CHANGE MASTER TO MASTER_USE_GTID = slave_pos;
55--eval SET @@global.gtid_slave_pos = '$resume_gtid'
56# Yet the slave io first submits the last received binlog file name:pos.
57--source include/start_slave.inc
58
59# Here goes the cracker.
60--connection master
61INSERT INTO t1 SET a = 4;
62
63#
64# Clean up
65#
66--connection master
67DROP TABLE t1;
68--eval SET @@GLOBAL. rpl_semi_sync_master_enabled = $sav_enabled_master
69
70--sync_slave_with_master
71source include/stop_slave.inc;
72--eval SET @@GLOBAL. rpl_semi_sync_slave_enabled = $sav_enabled_slave
73source include/start_slave.inc;
74--source include/rpl_end.inc
75