Bug #115047 XA_prepare_log_event holds an invalid XID
Submitted: 17 May 7:12 Modified: 17 May 9:39
Reporter: Alessio Biscuola Email Updates:
Status: Can't repeat Impact on me:
Category:MySQL Server: XA transactions Severity:S3 (Non-critical)
Version:8.0.32 OS:Ubuntu (ubuntu0.20.04.2 )
Assigned to: CPU Architecture:Any
Tags: XA Transaction

[17 May 7:12] Alessio Biscuola
Following an unexpected shutdown of the machine hosting MySQL, the server failed to start upon reboot. The startup failure was due to an error related to the binary log recovery process. The error message encountered is as follows:

innodb_flush_log_at_trx_commit = 1
sync_binlog = 1

[ERROR] [MY-013909] [Server] Found invalid event sequence while recovering from binary log file './binlog.007012', between positions 95978 and 98961: XA_prepare_log_event holds an invalid XID. The recovery process was stopped early and no transaction was recovered. Side effects may be transactions in an inconsistent state between the binary log and the storage engines, or transactions kept by storage engines in a prepared state (possibly holding locks). Either fix the issues with the binary log or, to release possibly acquired locks, disable the binary log during server recovery. Note that disabling the binary log may lead to loss of transactions that were already acknowledged as successful to client connections and may have been replicated to other servers in the topology.

How to repeat:
Experience an unexpected system shutdown with active MySQL transactions.
Reboot the system and attempt to start the MySQL server.
Observe the failure due to the invalid event sequence in the binary log.
[17 May 7:12] Alessio Biscuola
The binary log extraction revealed the following problematic segment:

Attachment: segmentbinlog.txt (text/plain), 28.14 KiB.

[17 May 9:39] MySQL Verification Team
Hi Mr. Biscuola,

Thank you for your bug report.

However, let us inform you that this is a forum for the reports with fully reproducible test cases. A proper test case, for this forum, should consist of a set of SQL statements and (if necessary) configuration settings that always leads to the bug that is reported.

We cannot proceed without a test case as described.

When we get a test case, we shall be happy to attempt to repeat it and thus proceed to process your report.

Can't repeat.