Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-32813

read-only xa prepare may disappear upon server restart

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6
    • None
    • Replication, Server
    • None

    Description

      A prepared user xa that does not modify any engine data may get binlogged. E.g
      from binlog_empty_xa_prepared.test:

      XA START '3';
      CREATE TEMPORARY TABLE tmp_1(c INT);
      XA END '3';
      XA PREPARE '3';
      
      

      ends in binlog with

      | master-bin.000001 | 555 | Gtid              |         1 |         600 | XA START X'33',X'',1 GTID 0-1-2                                |
      | master-bin.000001 | 600 | Query             |         1 |         685 | XA END X'33',X'',1                                             |
      | master-bin.000001 | 685 | XA_prepare        |         1 |         722 | XA PREPARE X'33',X'',1  
      

      and stays recovered

       > xa recover;
      +----------+--------------+--------------+------+
      | formatID | gtrid_length | bqual_length | data |
      +----------+--------------+--------------+------+
      |        1 |            1 |            0 | 3    |
      +----------+--------------+--------------+------+
      

      while the server is alive.

      It's gone after the server restart.
      shutdown;
      Query OK, 0 rows affected (0.00 sec)
       
      18:16:32 [test]> xa recover;
      ERROR 2006 (HY000): MySQL server has gone away
      No connection. Trying to reconnect...
      Connection id:    4
      Current database: test
       
      Empty set (0.03 sec)
      

      An obvious resolution is to prevent logging the empty XA-prepare group.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Elkin Andrei Elkin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.