XA_RBDEADLOCK is not returned on XA END after the transacting ended with a deadlock
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PBXT |
Fix Committed
|
Medium
|
Paul McCullagh |
Bug Description
If a deadlock error happened inside an XA transaction (with PBXT), XA_RBDEADLOCK is not produced upon xa end.
The transaction is rolled back, but XA END, XA PREPARE and XA COMMIT do not return any error.
Note this problem is probably related to the fact that PBXT does an automatic rollback on deadlock.
How to repeat:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 ( c1 int primary key, c2 varchar(20)) ENGINE=innodb;
insert t1 (c1, c2) values (1, "abc"), (2, "def"), (3, "ghi");
-- Connection 1:
XA START 'conn1';
update t1 set c2="9999999" where c1=3;
update t1 set c2="ABC" where c1=1;
-- Connection 2:
XA START 'conn2';
update t1 set c2="DEF" where c1=2;
update t1 set c2="123" where c1=1;
-- Connection 1:
update t1 set c2="456" where c1=2;
-- DEADLOCK error
XA END 'conn1';
-- Here InnoDB returns:
-- ERROR 1614 (XA102): XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
XA PREPARE 'conn1';
XA COMMIT 'conn1';
-- Connection 2:
XA END 'conn2';
XA PREPARE 'conn2';
XA COMMIT 'conn2';
SELECT * FROM t1; shows that XA 'conn1' was not committed.
Related branches
Changed in pbxt: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in pbxt: | |
assignee: | nobody → Paul McCullagh (paul-mccullagh) |
status: | Confirmed → In Progress |
Changed in pbxt: | |
status: | In Progress → Fix Committed |