1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00
Files
mariadb/mysql-test/suite/rpl/r/rpl_xa_2pc_multi_engine.result
Brandon Nesterenko f1276aa1bc MDEV-26652: xa transactions binlogged in wrong order
Disclaimer: This report was fixed in a previous commit with
MDEV-21117, this patch only adds a test to show the presence of
the fix.

Prior to MDEV-21117, the ordering of the handlers in a
transaction's ha_info list solely determined the order in which
the handlertons commit. The binlog is supposed to commit first,
and is normally placed first in the ha_list to do so; however,
in multi-engine 2-phase XA transactions, the binlog can be
placed second. This allowed a race-condition for other
concurrent transactions to commit and binlog before the prior
XA COMMIT would be written to binlog.

MDEV-21117 fixed this so the binlog is specially considered
to commit first, before traversing the ha_list (see
commit_one_phase_2() in sql/hander.cc for this specific change
in 6c39eaeb12).
2025-01-30 11:30:33 -07:00

27 lines
681 B
Plaintext

include/master-slave.inc
[connection master]
connection master;
create table t1 (a int primary key, b int) engine=innodb;
insert t1 values (1,1),(3,3),(5,5),(7,7);
create table t2 (m int) engine=aria;
# Create multi-engine, two-phase XA transaction (T1)
xa start '1';
insert t2 values (1);
update t1 set b=50 where b=5;
xa end '1';
xa prepare '1';
# Create T2
connection server_1;
update t1 set b=10 where a=5;
connection master;
xa commit '1';
connection server_1;
include/save_master_gtid.inc
# This would hang prior to MDEV-21117
connection slave;
include/sync_with_master_gtid.inc
connection master;
drop table t1, t2;
include/rpl_end.inc
# End of rpl_xa_2pc_multi_engine.test