1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-13626: Import and adapt innodb.xa_recovery_debug

Adapt the test that was added in
mysql/mysql-server@6b65d9032c
but omitted in commit 2e814d4702.

Instead of triggering a log checkpoint, we will only trigger
a redo log flush before killing the server.
Note: the mtr.commit() call in trx_rollback_for_mysql()
will not actually make the undo log header page state change durable.
A call to log_write_up_to(mtr.commit_lsn(), true) would do that.

It is unclear what the originally reported bug scenario was.
As long as innobase_rollback_by_xid() will not return without
ensuring that the redo log has been durably written, we should be safe.
This commit is contained in:
Marko Mäkelä
2020-03-31 15:10:54 +03:00
parent 2d16452a31
commit fb217449dc
2 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,27 @@
#
# Bug#20872655 XA ROLLBACK IS NOT CRASH-SAFE
#
CREATE TABLE t(a INT PRIMARY KEY, b INT UNIQUE) ENGINE=INNODB;
INSERT INTO t SET a=0;
connect con1,localhost,root;
XA START 'zombie';
INSERT INTO t SET a=1;
UPDATE t SET b=1 WHERE a=1;
SELECT COUNT(*) FROM t;
COUNT(*)
2
XA END 'zombie';
XA PREPARE 'zombie';
SET DEBUG_SYNC='trx_xa_rollback SIGNAL s1 WAIT_FOR s2';
XA ROLLBACK 'zombie';
connection default;
SET DEBUG_SYNC='now WAIT_FOR s1';
SET GLOBAL innodb_flush_log_at_trx_commit=1;
DELETE FROM t LIMIT 1;
disconnect con1;
XA COMMIT 'zombie';
ERROR XAE04: XAER_NOTA: Unknown XID
SELECT COUNT(*) FROM t;
COUNT(*)
0
DROP TABLE t;