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

XA COMMIT/ROLLBACK not written into binary log, replication fails

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
      --source include/have_binlog_format_mixed.inc
      --source include/master-slave.inc
       
      CREATE TEMPORARY TABLE tmp (a INT) ENGINE=MyISAM;
      XA START 'x';
      --error ER_DUP_FIELDNAME
      CREATE OR REPLACE TEMPORARY TABLE tmp ENGINE=MyISAM IGNORE AS SELECT 1, 1;
      XA END 'x';
      XA PREPARE 'x';
      XA COMMIT 'x';
       
      XA START 'x';
      CREATE OR REPLACE TEMPORARY TABLE tmp ENGINE=MyISAM AS SELECT 1;
      XA END 'x';
      XA PREPARE 'x';
      XA COMMIT 'x';
       
      --sync_slave_with_master
       
      # Cleanup
      --connection master
      # Normally not necessary, but in this case MTR otherwise complains
      # about "Slave_open_temp_tables	1"
      DROP TEMPORARY TABLE IF EXISTS tmp;
      --source include/rpl_end.inc
      

      10.5 5673cbe0941e105eb73b5ecf651a529f8e717b52

      master-bin.000001	285	Binlog_checkpoint	1	329	master-bin.000001
      master-bin.000001	329	Gtid	1	371	GTID 0-1-1
      master-bin.000001	371	Query	1	486	use `test`; CREATE TEMPORARY TABLE tmp (a INT) ENGINE=MyISAM
      master-bin.000001	486	Gtid	1	529	XA START X'78',X'',1 GTID 0-1-2
      master-bin.000001	529	Query	1	689	DROP TEMPORARY TABLE IF EXISTS `test`.`tmp`/* Generated to handle failed CREATE OR REPLACE */
      master-bin.000001	689	Query	1	774	XA END X'78',X'',1
      master-bin.000001	774	XA_prepare	1	811	XA PREPARE X'78',X'',1
      master-bin.000001	811	Gtid	1	853	BEGIN GTID 0-1-3
      master-bin.000001	853	Query	1	983	use `test`; CREATE OR REPLACE TEMPORARY TABLE tmp ENGINE=MyISAM AS SELECT 1
      master-bin.000001	983	Query	1	1056	COMMIT
      master-bin.000001	1056	Gtid	1	1099	XA START X'78',X'',1 GTID 0-1-4
      master-bin.000001	1099	Query	1	1184	XA END X'78',X'',1
      master-bin.000001	1184	XA_prepare	1	1221	XA PREPARE X'78',X'',1
      master-bin.000001	1221	Gtid	1	1264	GTID 0-1-5
      master-bin.000001	1264	Query	1	1352	XA COMMIT X'78',X'',1
      master-bin.000001	1352	Gtid	1	1394	GTID 0-1-6
      master-bin.000001	1394	Query	1	1509	use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `tmp`
      

      So, the first XA COMMIT is missing, and the replica fails with

      2024-10-07  0:00:18 7 [ERROR] Slave SQL: XAER_DUPID: The XID already exists, Gtid 0-1-4, Internal MariaDB error code: 1440
      

      Attachments

        Activity

          People

            bnestere Brandon Nesterenko
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.