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

Parallel replication failing to roll back and retry

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11.13
    • 10.11, 11.4, 11.8
    • Replication
    • None
    • Debian bookworm; MariaDB-provided packages

    Description

      Hi,

      I recently created a new table that keeps track of events in real time. It involves rows being inserted, updated, and then deleted very quickly.

      When these events are relayed over replication with slave_parallel_threads=0, slave_parallel_workers=0, and slave_parallel_mode=optimistic, no problems have been observed.

      But I have two slave machines that read these events with slave_parallel_threads=8, slave_parallel_workers=8, slave_parallel_mode=aggressive. It seems like every couple of days, one or the other of them complains about being told to update a record that doesn't exist.

      My theory is that because of parallel replication, it actually is deleting the row before it processes the update. My understanding is that in this situation, it's supposed to roll back the delete, perform the update, then delete. Something seems to be going wrong there.

      Below is the excerpt of the binlog for a row that this happened to (with the database and table name redacted). The slave complained:

      Could not execute Delete_rows_v1 event on table DB_NAME.TABLE_NAME; Can't find record in 'TABLE_NAME', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.1331096, end_log_pos 14850806

      #250716 10:06:07 server id 54  end_log_pos 4822485 CRC32 0x79d89c48     Write_rows: table id 596 flags: STMT_END_F
      ### INSERT INTO `DB_NAME`.`TABLE_NAME`
      ### SET
      ###   @1=151399
      ###   @2=665
      ###   @3='<D2>\x19<DC>]DpJ<AD><D1><FD><BF>Q<BB>'
      ###   @4=1752678367
      ###   @5=1752678427.155
      ###   @6=1752678367
      ###   @7=0
      # Number of rows: 1
      # at 4822485
       
      #250716 10:06:07 server id 54  end_log_pos 5171205 CRC32 0x8ded0012     Update_rows: table id 596 flags: STMT_END_F
      ### UPDATE `DB_NAME`.`TABLE_NAME`
      ### WHERE
      ###   @1=151399
      ###   @2=665
      ###   @3='<D2>\x19<DC>]DpJ<AD><D1><FD><BF>Q<BB>'
      ###   @4=1752678367
      ###   @5=1752678427.155
      ###   @6=1752678367
      ###   @7=0
      ### SET
      ###   @1=151399
      ###   @2=665
      ###   @3='<D2>\x19<DC>]DpJ<AD><D1><FD><BF>Q<BB>'
      ###   @4=1752678367
      ###   @5=1752678427.473
      ###   @6=1752678367
      ###   @7=0
      # Number of rows: 1
      # at 5171205
       
      #250716 10:06:15 server id 54  end_log_pos 14850431 CRC32 0x838507d8    Update_rows: table id 596 flags: STMT_END_F
      ### UPDATE `DB_NAME`.`TABLE_NAME`
      ### WHERE
      ###   @1=151399
      ###   @2=665
      ###   @3='<D2>\x19<DC>]DpJ<AD><D1><FD><BF>Q<BB>'
      ###   @4=1752678367
      ###   @5=1752678427.473
      ###   @6=1752678367
      ###   @7=0
      ### SET
      ###   @1=151399
      ###   @2=665
      ###   @3='<D2>\x19<DC>]DpJ<AD><D1><FD><BF>Q<BB>'
      ###   @4=1752678367
      ###   @5=1752678388.910
      ###   @6=1752678367
      ###   @7=1
      # Number of rows: 1
      # at 14850431
       
      #250716 10:06:15 server id 54  end_log_pos 14850806 CRC32 0x3f72f51b    Delete_rows: table id 596 flags: STMT_END_F
      ### DELETE FROM `DB_NAME`.`TABLE_NAME`
      ### WHERE
      ###   @1=151399
      ###   @2=665
      ###   @3='<D2>\x19<DC>]DpJ<AD><D1><FD><BF>Q<BB>'
      ###   @4=1752678367
      ###   @5=1752678388.910
      ###   @6=1752678367
      ###   @7=1
      # Number of rows: 1
      # at 14850806
      
      

      Attachments

        Activity

          People

            knielsen Kristian Nielsen
            xan@biblionix.com Xan Charbonnet
            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.