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

XA PREPARE transactions should survive innodb_force_recovery=1 or 2

Details

    Description

      We should revert part of this InnoDB change in MySQL 5.0.3 (making innodb_force_recovery=1 and innodb_force_recovery=2 initiate rollback of a transaction that reached the XA PREPARE state before previous crash or shutdown) (March 2005).
      It seems that the option tc_heuristic_recover=ROLLBACK in MySQL 5.0.3 (January 2005) was introduced for exactly this purpose; there was no need to convolute the logic of an already confusing InnoDB parameter.

      Attachments

        Issue Links

          Activity

            marko Marko Mäkelä created issue -
            marko Marko Mäkelä made changes -
            Field Original Value New Value

            Actually the questionable logic for rolling back XA PREPARE transactions was added already in a March 1, 2005 commit, that is, 12 days before the refactoring, which also added innodb_support_xa that was made a no-op in MySQL 5.7.10 and MariaDB 10.2.6 and removed in MariaDB 10.3.0.

            marko Marko Mäkelä added a comment - Actually the questionable logic for rolling back XA PREPARE transactions was added already in a March 1, 2005 commit , that is, 12 days before the refactoring, which also added innodb_support_xa that was made a no-op in MySQL 5.7.10 and MariaDB 10.2.6 and removed in MariaDB 10.3.0 .
            marko Marko Mäkelä made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            marko Marko Mäkelä added a comment - bb-10.0-marko
            marko Marko Mäkelä made changes -
            Assignee Marko Mäkelä [ marko ] Jan Lindström [ jplindst ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            marko Marko Mäkelä made changes -
            Fix Version/s 10.0.33 [ 22552 ]
            Fix Version/s 10.1.27 [ 22609 ]
            Fix Version/s 10.2.9 [ 22611 ]
            Fix Version/s 10.3.1 [ 22532 ]
            Fix Version/s 10.0 [ 16000 ]
            Assignee Jan Lindström [ jplindst ] Marko Mäkelä [ marko ]
            Resolution Fixed [ 1 ]
            Status In Review [ 10002 ] Closed [ 6 ]

            ok to push as we have that tc_heuristic_recover.

            jplindst Jan Lindström (Inactive) added a comment - ok to push as we have that tc_heuristic_recover.
            marko Marko Mäkelä made changes -
            Component/s Backup [ 13902 ]

            Before this change, when preparing a backup, Mariabackup 10.1 would unconditionally roll back transactions that were recovered in XA PREPARE state. Starting with Mariabackup 10.1.27, such transactions will be left alone.
            Mariabackup for MariaDB 10.2 (first released as version 10.2.7) does not process any undo log records or change any transaction state. (Even the --export option is not supported before MDEV-13466 implements it.)

            marko Marko Mäkelä added a comment - Before this change, when preparing a backup, Mariabackup 10.1 would unconditionally roll back transactions that were recovered in XA PREPARE state. Starting with Mariabackup 10.1.27, such transactions will be left alone. Mariabackup for MariaDB 10.2 (first released as version 10.2.7) does not process any undo log records or change any transaction state. (Even the --export option is not supported before MDEV-13466 implements it.)

            As a result of this change, setting innodb_force_recovery=3 will no longer hide recovered XA PREPARE transactions from the server.
            If the binlog is enabled and internally acts as a XA resource manager for cross-engine transactions, this means that also with innodb_force_recovery=3, decisions to XA COMMIT or XA ROLLBACK based on the binlog contents will continue to be made. This affects the way how MDEV-13437 can be reproduced.

            marko Marko Mäkelä added a comment - As a result of this change, setting innodb_force_recovery=3 will no longer hide recovered XA PREPARE transactions from the server. If the binlog is enabled and internally acts as a XA resource manager for cross-engine transactions, this means that also with innodb_force_recovery=3, decisions to XA COMMIT or XA ROLLBACK based on the binlog contents will continue to be made. This affects the way how MDEV-13437 can be reproduced.
            marko Marko Mäkelä made changes -
            Fix Version/s 10.3.2 [ 22533 ]
            Fix Version/s 10.3.1 [ 22532 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 82199 ] MariaDB v4 [ 152678 ]

            People

              marko Marko Mäkelä
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.