Commit a061ae10 authored by Brandon Nesterenko's avatar Brandon Nesterenko

MDEV-33921: Fix rpl_xa_empty_transaction.test

The test was missing a save_master_gtid.inc on the master,
leading to the slave thinking it was in sync after executing
sync_with_master_gtid.inc, despite not having executed the
latest transaction. This skipped transaction, XA COMMIT,
was supposed to error-to-be-ignored because its XID could not
be found, but be thrown out because the replication filters
would filter out the target database. However, if the slave
was able to stop before executing the transaction, then
the replication filer is reset (to empty), and when the
slave is later restarted, that transactions error would
no longer be ignored.

Additionally, as the test cases added in MDEV-33921 rely
on GTID synchronization, the test cases now force
master_use_gtid=slave_pos for consistency
parent 36b867ad
......@@ -1176,10 +1176,12 @@ include/save_master_gtid.inc
connection server_3;
include/sync_with_master_gtid.inc
include/stop_slave.inc
change master to master_use_gtid=slave_pos;
connection server_2;
include/stop_slave.inc
SET @@GLOBAL.replicate_ignore_db= "";
SET @@GLOBAL.replicate_do_db= "db2";
change master to master_use_gtid=slave_pos;
include/start_slave.inc
connection server_1;
use db1;
......@@ -1220,9 +1222,11 @@ include/rpl_restart_server.inc [server_number=2]
connection server_2;
include/stop_slave.inc
SET @@GLOBAL.replicate_do_db= "db2";
change master to master_use_gtid=slave_pos;
include/start_slave.inc
connection server_1;
XA COMMIT "x2";
include/save_master_gtid.inc
connection server_2;
include/sync_with_master_gtid.inc
include/save_master_gtid.inc
......
......@@ -190,11 +190,13 @@ create table db1.t1 (a int) engine=innodb;
--connection server_3
--source include/sync_with_master_gtid.inc
--source include/stop_slave.inc
change master to master_use_gtid=slave_pos;
--connection server_2
--source include/stop_slave.inc
SET @@GLOBAL.replicate_ignore_db= "";
SET @@GLOBAL.replicate_do_db= "db2";
change master to master_use_gtid=slave_pos;
--source include/start_slave.inc
--connection server_1
......@@ -256,10 +258,12 @@ XA PREPARE "x2";
--connection server_2
--source include/stop_slave.inc
SET @@GLOBAL.replicate_do_db= "db2";
change master to master_use_gtid=slave_pos;
--source include/start_slave.inc
--connection server_1
XA COMMIT "x2";
--source include/save_master_gtid.inc
--connection server_2
--source include/sync_with_master_gtid.inc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment