XA operations do not take global commit lock under LOCK TABLES FOR BACKUP
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona Server moved to https://jira.percona.com/projects/PS | Status tracked in 5.7 | |||||
5.5 |
Invalid
|
Undecided
|
Unassigned | |||
5.6 |
Triaged
|
Medium
|
Unassigned | |||
5.7 |
Triaged
|
Medium
|
Unassigned |
Bug Description
In 5.7.19 Oracle fixed Bug #84442 "XA PREPARE inconsistent with XTRABACKUP"
(https:/
XA PREPARE, XA ROLLBACK, and XA COMMIT for a transaction from a
disconnected session did not take a global commit lock and modified
the binary log and InnoDB redo log even when FLUSH TABLES WITH READ
LOCK was in effect. This could lead to inconsistent backups when
backup tools assumed that the server was in a read-only state.
Similar changes must be implemented for Percona-specific LOCK TABLES FOR BACKUP / LOCK BINLOG FOR BACKUP.
In the following MTR test case fragment "xa prepare 'test1'" must fail with ER_LOCK_
--echo # Check XA state when lock_wait_timeout happens
--echo # More tests added to flush_read_
connect (con_tmp,
set session lock_wait_
create table asd (a int);
xa start 'test1';
insert into asd values(1);
xa end 'test1';
connection default;
lock tables for backup;
connection con_tmp;
--echo # PREPARE error will do auto rollback.
--ERROR ER_LOCK_
xa prepare 'test1';
show errors;
connection default;
unlock tables;
The full set of test cases can be found in Oracle's commit 25106b8 /github. com/mysql/ mysql-server/ commit/ 25106b8
"Bug 25364178 - XA PREPARE INCONSISTENT WITH XTRABACKUP"
https:/