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

Bulk InnoDB LOAD DATA breaks replication upon hitting duplicate key

    XMLWordPrintable

Details

    Description

      The issue looks logically related to MDEV-33179, in the sense that here LOAD DATA is also silently rolled back on the master; but it is written in the binary log, attempted on the slave and fails there.
      However, since there is no clarity how (and whether) MDEV-33179 is going to be fixed, it's not guaranteed that the fix will help with the replication problem, so I'm filing it separately. If after MDEV-33179 is fixed the fix makes the failure described here disappear, it should be closed as a duplicate.

      --source include/have_innodb.inc
      --source include/have_binlog_format_row.inc
      --source include/master-slave.inc
       
      --write_file $MYSQL_TMP_DIR/1.txt
      1
      2
      1
      EOF
       
      CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=InnoDB;
      SET FOREIGN_KEY_CHECKS=0, UNIQUE_CHECKS=0;
      eval LOAD DATA INFILE '$MYSQL_TMP_DIR/1.txt' INTO TABLE t;
      SET FOREIGN_KEY_CHECKS=1, UNIQUE_CHECKS=1;
      SELECT * FROM t;
       
      --sync_slave_with_master
       
      # Cleanup
      --connection master
      DROP TABLE t;
      --source include/rpl_end.inc
      

      10.11 d0c80c211c1fe3370b68be540bb9113028c6746f

      2024-02-01 11:54:35 7 [ERROR] Slave SQL: Could not execute Write_rows_v1 event on table test.t; Duplicate entry '1' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log master-bin.000001, end_log_pos 731, Gtid 0-1-2, Internal MariaDB error code: 1062
      2024-02-01 11:54:35 7 [Warning] Slave: Duplicate entry '1' for key 'PRIMARY' Error_code: 1062
      

      Attachments

        Issue Links

          Activity

            People

              Elkin Andrei Elkin
              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.