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

[ERROR] Slave (additional info): Commit failed due to failure of an earlier commit on which this one depends Error_code: 1964 on parallel replica

    XMLWordPrintable

Details

    Description

      --source include/have_binlog_format_statement.inc
      --source include/have_innodb.inc
      --source include/master-slave.inc
       
      --connection slave
      STOP SLAVE;
      SET GLOBAL slave_parallel_threads=10;
      START SLAVE;
       
      --connection master
      SET sql_mode='';
      CREATE TABLE t (c INT) ENGINE=InnoDB;
      INSERT INTO t VALUES (REPEAT (0,200000));
      INSERT INTO t SELECT * FROM t;
      INSERT INTO t VALUES (1);
      

      Leads to:

      11.5.0 e4afa610539ae01164485554e2de839bea9de816 (Optimized, MTR Output)

      INSERT INTO t VALUES (1);
      ***Warnings generated in error logs during shutdown after running tests: main.test
       
      2024-06-10 13:57:45 19 [Warning] Slave: Duplicate entry '0-3' for key 'PRIMARY' Error_code: 1062
      2024-06-10 13:57:45 18 [Warning] Slave: Connection was killed Error_code: 1927
      2024-06-10 13:57:45 18 [Warning] Slave: Connection was killed Error_code: 1927
      2024-06-10 13:57:45 18 [Warning] Slave: Deadlock found when trying to get lock; try restarting transaction Error_code: 1213
      2024-06-10 13:57:45 18 [Warning] Slave: Commit failed due to failure of an earlier commit on which this one depends Error_code: 1964
       
      main.test                                [ fail ]
      

      Slave log (var/log/mysqld.2.err):

      11.5.0 e4afa610539ae01164485554e2de839bea9de816 (Optimized, Slave)

      2024-06-10 13:53:06 6 [Note] Slave I/O thread: connected to master 'root@127.0.0.1:16000',replication starts at GTID position ''
      2024-06-10 13:53:06 7 [Note] Error reading relay log event: slave SQL thread was killed
      2024-06-10 13:53:06 7 [Note] Slave SQL thread exiting, replication stopped in log 'master-bin.000001' at position 329; GTID position '', master: 127.0.0.1:16000
      2024-06-10 13:53:06 6 [Note] Slave I/O thread exiting, read up to log 'master-bin.000001', position 329; GTID position , master 127.0.0.1:16000
      2024-06-10 13:53:06 10 [Note] Slave I/O thread: Start asynchronous replication to master 'root@127.0.0.1:16000' in log 'master-bin.000001' at position 329
      2024-06-10 13:53:06 11 [Note] Slave SQL thread initialized, starting replication in log 'master-bin.000001' at position 329, relay log './slave-relay-bin.000001' position: 4; GTID position ''
      2024-06-10 13:53:06 10 [Note] Slave I/O thread: connected to master 'root@127.0.0.1:16000',replication starts at GTID position ''
      2024-06-10 13:53:06 19 [ERROR] Slave SQL: Error during XID COMMIT: failed to update GTID state in mysql.gtid_slave_pos: 1062:  Duplicate entry '0-3' for key 'PRIMARY', Error_code: 1062; the event's master log master-bin.000001, end_log_pos 832, Gtid 0-1-3, Internal MariaDB error code: 1942
      2024-06-10 13:53:06 19 [ERROR] Slave (additional info): Duplicate entry '0-3' for key 'PRIMARY' Error_code: 1062
      2024-06-10 13:53:06 19 [Warning] Slave: Duplicate entry '0-3' for key 'PRIMARY' Error_code: 1062
      2024-06-10 13:53:06 19 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'master-bin.000001' position 663; GTID position '0-1-2'
      2024-06-10 13:53:06 11 [Note] Error reading relay log event: slave SQL thread was killed
      2024-06-10 13:53:06 17 [ERROR] Slave (additional info): Commit failed due to failure of an earlier commit on which this one depends Error_code: 1964
      2024-06-10 13:53:06 17 [Warning] Slave: Connection was killed Error_code: 1927
      2024-06-10 13:53:06 17 [Warning] Slave: Connection was killed Error_code: 1927
      2024-06-10 13:53:06 17 [Warning] Slave: Deadlock found when trying to get lock; try restarting transaction Error_code: 1213
      2024-06-10 13:53:06 17 [Warning] Slave: Commit failed due to failure of an earlier commit on which this one depends Error_code: 1964
      2024-06-10 13:53:06 17 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'master-bin.000001' position 663; GTID position '0-1-2'
      2024-06-10 13:53:06 11 [Note] Slave SQL thread exiting, replication stopped in log 'master-bin.000001' at position 663; GTID position '0-1-2', master: 127.0.0.1:16000
      2024-06-10 13:53:07 0 [Note] /test/MD170524-mariadb-11.5.0-linux-x86_64-opt/bin/mariadbd (initiated by: root[root] @ localhost [127.0.0.1]): Normal shutdown
      2024-06-10 13:53:07 10 [Note] Slave I/O thread exiting, read up to log 'master-bin.000001', position 996; GTID position 0-1-4, master 127.0.0.1:16000
      2024-06-10 13:53:07 0 [Note] InnoDB: FTS optimize thread exiting.
      2024-06-10 13:53:07 0 [Note] InnoDB: Starting shutdown...
      2024-06-10 13:53:07 0 [Note] InnoDB: Dumping buffer pool(s) to /test/MD170524-mariadb-11.5.0-linux-x86_64-opt/mariadb-test/var/mysqld.2/data/ib_buffer_pool
      2024-06-10 13:53:07 0 [Note] InnoDB: Restricted to 124 pages due to innodb_buf_pool_dump_pct=25
      2024-06-10 13:53:07 0 [Note] InnoDB: Buffer pool(s) dump completed at 240610 13:53:07
      2024-06-10 13:53:07 0 [Note] InnoDB: Removed temporary tablespace data file: "./ibtmp1"
      2024-06-10 13:53:07 0 [Note] InnoDB: Shutdown completed; log sequence number 52835; transaction id 28
      2024-06-10 13:53:07 0 [Note] /test/MD170524-mariadb-11.5.0-linux-x86_64-opt/bin/mariadbd: Shutdown complete
      

      If the issue does not immediately reproduce in full (it may pass, or just show the 1062 only, but not 1964), try --repeat 10; it is lightly sporadic.

      Confirmed present in 10.5-11.6.

      Attachments

        Issue Links

          Activity

            People

              Elkin Andrei Elkin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.