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

insert statement executed multiple times on slave

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Incomplete
    • 10.6.13
    • N/A
    • Replication
    • None
    • Centos7
      slave_parallel_threads = 128
      slave_parallel_mode = conservative

    Description

      After upgrade to version 10.6.13, replication stops with Error 'Duplicate entry'

      show slave status \G
      *************************** 1. row ***************************
                      Slave_IO_State: Waiting for master to send event
                         Master_Host: ********
                         Master_User: repl
                         Master_Port: 3306
                       Connect_Retry: 60
                     Master_Log_File: mysql-bin.000545
                 Read_Master_Log_Pos: 402372410
                      Relay_Log_File: slave-relay.001565
                       Relay_Log_Pos: 316419462
               Relay_Master_Log_File: mysql-bin.000511
                    Slave_IO_Running: Yes
                   Slave_SQL_Running: No
                     Replicate_Do_DB:
                 Replicate_Ignore_DB:
                  Replicate_Do_Table:
              Replicate_Ignore_Table:
             Replicate_Wild_Do_Table:
         Replicate_Wild_Ignore_Table:
                          Last_Errno: 1062
                          Last_Error: Error 'Duplicate entry '88473796' for key 'PRIMARY'' on query.
                       Skip_Counter: 0
                 Exec_Master_Log_Pos: 316419163
       
       
      #Skip:
       
      MariaDB []> stop slave;
      Query OK, 0 rows affected (0.077 sec)
       
      MariaDB [> SET GLOBAL sql_slave_skip_counter = 1;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB []> start slave;
      Query OK, 0 rows affected (0.019 sec)
       
      MariaDB []> show slave status \G
      *************************** 1. row ***************************
                      Slave_IO_State: Waiting for master to send event
                         Master_Host: ********
                         Master_User: repl
                         Master_Port: 3306
                       Connect_Retry: 60
                     Master_Log_File: mysql-bin.000545
                 Read_Master_Log_Pos: 405814390
                      Relay_Log_File: slave-relay.001565
                       Relay_Log_Pos: 316423101
               Relay_Master_Log_File: mysql-bin.000511
                    Slave_IO_Running: Yes
                   Slave_SQL_Running: No
                     Replicate_Do_DB:
                 Replicate_Ignore_DB:
                  Replicate_Do_Table:
              Replicate_Ignore_Table:
             Replicate_Wild_Do_Table:
         Replicate_Wild_Ignore_Table:
                          Last_Errno: 1062
                          Last_Error: Error 'Duplicate entry '88473796' for key 'PRIMARY''
      Skip_Counter: 0
                 Exec_Master_Log_Pos: 316422802
      

      We can see the Exec_Master_Log_Pos update from 316419163 to 316422802 , but it fails on the same insert.

      In binary logs the insert is done only once, at position 316425036

      Here is what we have in the binary logs:

      #230520 11:38:28 server id 1  end_log_pos 316419163 CRC32 0xeae636ef    Xid = 990882515
      COMMIT/*!*/;
      # at 316419163
       
      #230520 11:38:28 server id 1  end_log_pos 316422802 CRC32 0x099dbd6a    Xid = 990882526
      COMMIT/*!*/;
      # at 316422802
       
      # at 316425036
      #230520 11:38:28 server id 1  end_log_pos 316426018 CRC32 0xa4bad5cc    Query   thread_id=2393709       exec_time=0     error_code=0    xid=0
      SET TIMESTAMP=1684575508/*!*/;
      insert into ... values ... 88473796
      

      I will put the binary logs on the FTP server for confidentiality reasons.

      Thanks

      Attachments

        Issue Links

          Activity

            People

              angelique.sklavounos Angelique Sklavounos (Inactive)
              pmoiroux Patrick Moiroux
              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.