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

Cluster is inconsistent after SAVEPOINT statement is rolled back

Details

    Description

      The following test show how to make a cluster inconsistent with a transaction that uses a savepoint with both innodb and aria storage engines involved:

      connection node_1;
      CREATE TABLE t1 (a INTEGER PRIMARY KEY) engine=innodb;
      START TRANSACTION;
      INSERT INTO t1 VALUES (1);
      SELECT count(*) a from mysql.db;
      a
      2
      SAVEPOINT s1;
      ERROR 42000: The storage engine for the table doesn't support SAVEPOINT
      INSERT INTO t1 VALUES (2);
      COMMIT;
      connection node_1;
      SELECT * FROM t1;
      a
      1
      2
      connection node_2;
      SELECT * FROM t1;
      a
      2
      

      Aria does not support SAVEPOINT, so an error is returned and the statement is rolled back.
      This statement rollback is incorrectly causes the trx cache to be truncated back to the beginning of the transaction. Ultimately causing an inconsistency, as only the second half of the transaction is replicated to the rest of the cluster.

      Attachments

        Activity

          A pull request has been submitted, and is ready for review.

          sciascid Daniele Sciascia added a comment - A pull request has been submitted, and is ready for review.
          sysprg Julius Goryavsky added a comment - Thanks, fix merged with head revision: https://github.com/MariaDB/server/commit/362c0950e8999a88f5866fc7361e10615364e4a3
          sysprg Julius Goryavsky added a comment - Fix merged with head revision: https://github.com/MariaDB/server/commit/362c0950e8999a88f5866fc7361e10615364e4a3

          People

            sysprg Julius Goryavsky
            sciascid Daniele Sciascia
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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