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

Server Crash During XA Prepare Can Break Replication

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
    • N/A
    • Replication
    • 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

              Elkin Andrei Elkin
              bnestere Brandon Nesterenko
              Votes:
              1 Vote for this issue
              Watchers:
              7 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.