[MDEV-21304] kill session deletes XA prepared transaktion Created: 2019-12-12  Updated: 2019-12-12  Resolved: 2019-12-12

Status: Closed
Project: MariaDB Server
Component/s: XA
Affects Version/s: 10.3.20
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: steen bartholdy Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Environment:

mysql client :
MariaDB [(none)]> \s
--------------
mysql Ver 15.1 Distrib 10.3.20-MariaDB, for Linux (x86_64) using readline 5.1

Connection id: 13
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server: MariaDB
Server version: 10.3.20-MariaDB-log MariaDB Server
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
UNIX socket: /data/3310/init/mysql3310.sock
Uptime: 35 min 32 sec

Threads: 9 Questions: 47 Slow queries: 0 Opens: 23 Flush tables: 1 Open tables: 16 Queries per second avg: 0.022
--------------

MariaDB [(none)]>


Issue Links:
Duplicate
is duplicated by MDEV-742 LP:803649 - Xa recovery failed on cli... Closed

 Description   

test sequence :
session 1 ( which is killed ) :
create table test( id int, text varchar(30) );
xa start 'test1';
insert into test values ( 1, 'killing this ses' );
xa end 'test1';
xa prepare 'test1';
– to my knowledge : this prepared XA transaction has to survive a crash otherwise cant the transaction coordinator issue a xa commit;
kontrol session 2 :
MariaDB [(none)]> xa recover;
---------------------------------------+

formatID gtrid_length bqual_length data

---------------------------------------+

1 5 0 test1

---------------------------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> kill 10;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> xa recover;
Empty set (0.00 sec)

MariaDB [(none)]>
So when the kill session is issued the xa recover list becomes empty.
If this simulated crash happends, then the XA transaction coordinator will not be able to do XA commit if the XA transaction in the mariadb was part of a transaction involving multiple XA transaction providers.
This can lead to data discrepency ( some does XA commit, mariadb cant ) during crash and XA should be crash proof.
mysql 5.7.28 lists the XA transaction when the XA transaction is prepared and session is killed.
It looks like bug :
https://bugs.mysql.com/bug.php?id=12161
hasnt been resolved into the mariadb code.
Kind regards
Steen



 Comments   
Comment by Sergei Golubchik [ 2019-12-12 ]

This is being fixed as MDEV-742

Generated at Thu Feb 08 09:06:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.