[MDEV-21856] XID_t::formatID has to be contrained to 4 byte size Created: 2020-03-02  Updated: 2020-03-09  Resolved: 2020-03-09

Status: Closed
Project: MariaDB Server
Component/s: Replication, Server
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.5.2

Type: Bug Priority: Critical
Reporter: Andrei Elkin Assignee: Andrei Elkin
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-742 LP:803649 - Xa recovery failed on cli... Closed

 Description   

There are two causes requiring that.
1. Engine understanding of the member has been of 4 bytes, at least in Innodb case:

 CREATE TABLE `ti` (
  `a` int(11) DEFAULT NULL
) ENGINE=InnoDB;
xa start '1','2',4611686018427387905;
  insert into ti set a=1;
xa end '1','2',4611686018427387905;
xa prepare '1','2',4611686018427387905;
xa recover;
+---------------------+--------------+--------------+------+
| formatID            | gtrid_length | bqual_length | data |
+---------------------+--------------+--------------+------+
| 4611686018427387905 |            1 |            1 | 12   |
+---------------------+--------------+--------------+------+
--error crash
xa commit '1','2',4611686018427387905;
 
# restart mysqld
xa recover;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    4
Current database: test
 
+----------+--------------+--------------+------+
| formatID | gtrid_length | bqual_length | data |
+----------+--------------+--------------+------+
|        1 |            1 |            1 | 12   |
+----------+--------------+--------------+------+

2. and the 2nd reason is XA replication across different platforms which
mean different sizes for ulong specified entity. Constraining it to 4 satisfies them all.


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