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

Server Crash During XA Prepare Can Break Replication

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
    • Fix Version/s: 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
    • Component/s: None
    • Labels:
      None

      Description

      If a slave crashes (unrelated) while processing an XA PREPARE such that the event fully commits in the binlog and innodb; however, crashes before updating gtid_slave_pos, attempts to restart the slave SQL thread will crash with errors such as out-of-order GTID attempt (if gtid strict mode is enabled) or XID already exists (otherwise). The following comment in Xid_apply_log_event::do_apply_event() documents this behavior.

        /*
          ...
          
          XA_PREPARE_LOG_EVENT also updates the gtid table *but* the update gets
          committed as separate "autocommit" transaction.
        */
      

      I think logic should be added to detect the possibility of a crash happening before the separate transaction completes, and if so, automatically update gtid slave state on restart, because gtid_binlog_pos will already be updated.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bnestere Brandon Nesterenko
              Reporter:
              bnestere Brandon Nesterenko
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.