Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-4800

Recovery of prepared XA transactions seems broken in 8.0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 8.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Upstream 8.0.12 SQL :

      mysql> create database test; use test;
      Query OK, 1 row affected (0.08 sec)
      Database changed
      mysql> CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=INNODB;
      Query OK, 0 rows affected (0.25 sec)
      mysql> XA BEGIN 'a','ab';
      Query OK, 0 rows affected (0.00 sec)
      mysql> INSERT INTO t1 VALUES (1);
      Query OK, 1 row affected (0.03 sec)
      mysql> SELECT * FROM t1;
      +---+
      | a |
      +---+
      | 1 |
      +---+
      1 row in set (0.00 sec)
      mysql> XA END 'a','ab';
      Query OK, 0 rows affected (0.00 sec)
      mysql> XA PREPARE 'a','ab';
      Query OK, 0 rows affected (0.00 sec)
      

      Then kill -9 `pidof mysqld` and restart the server, then :

      mysql> XA RECOVER;
      ERROR 2006 (HY000): MySQL server has gone away
      No connection. Trying to reconnect...
      Connection id: 8
      Current database: test
      +----------+--------------+--------------+------+
      | formatID | gtrid_length | bqual_length | data |
      +----------+--------------+--------------+------+
      | 1 | 1 | 2 | aab |
      +----------+--------------+--------------+------+
      1 row in set (0.07 sec)
      mysql> XA COMMIT 'a','ab';
      Query OK, 0 rows affected (0.10 sec)
      mysql> SELECT * FROM t1;
      +---+
      | a |
      +---+
      | 1 |
      +---+
      1 row in set (0.00 sec)
      

      This is perfectly as expected. In Percona Server 8.0 though, after the server is killed and restarted, we get this instead :

      mysql> XA RECOVER;
      ERROR 2006 (HY000): MySQL server has gone away
      No connection. Trying to reconnect...
      Connection id:    8
      Current database: test
      
      +----------+--------------+--------------+------+
      | formatID | gtrid_length | bqual_length | data |
      +----------+--------------+--------------+------+
      |        1 |            1 |            2 | aab  |
      +----------+--------------+--------------+------+
      1 row in set (0.02 sec)
      
      mysql> XA COMMIT 'a','ab';
      ERROR 1401 (XAE03): XAER_RMERR: Fatal error occurred in the transaction branch - check your data for consistency
      mysql> xa recover;
      Empty set (0.00 sec)
      
      mysql> SELECT * FROM t1;
      Empty set (0.00 sec)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                george.lorch George Lorch
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 45 minutes
                  1h 45m