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

Slave cannot apply a fragmented row event written with log_bin_compress=ON

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Q1/2027 Replic. Maintenance

    Description

      On a primary with log_bin_compress=ON and
      binlog_row_event_fragment_threshold set below the size of the row
      events it writes, a replica can stop when it applies one of those
      events. The replica's SQL thread stops with
      ER_SLAVE_RELAY_LOG_READ_FAILURE (1594) and the message "Could not parse
      Rows_log_event re-assembled from Partial_rows_log_events". The
      transaction never applies, and restarting the SQL thread meets the same
      event again, so replication resumes only once the event is skipped.
      Whether a given statement trips this depends on the contents of the
      first row in the event, so the same INSERT can replicate against one
      table and stop the replica against another.

      A row event whose row data exceeds binlog_row_event_fragment_threshold
      is not written as a single event. Rows_log_event_fragmenter splits it
      into a group of Partial_rows_log_events. The first fragment carries the
      original event's header, post-header and metadata, the rest carry the
      remaining row data, and the replica concatenates the group and parses
      the result as the original row event. Fragmenting takes the place of
      writing the row event rather than running after it, so the row data in
      the fragments is whatever sits in the event's buffer, which is
      uncompressed.

      --source include/have_binlog_format_row.inc
      --source include/master-slave.inc
       
      call mtr.add_suppression("Found invalid event in binary log");
      call mtr.add_suppression("Could not parse Rows_log_event re-assembled");
       
      --connection master
      set @@global.log_bin_compress= 1;
      set @@global.binlog_row_event_fragment_threshold= 1024;
       
      create table t1 (c1 int, c2 int, c3 varchar(2000),
                       c4 int, c5 int, c6 int, c7 int, c8 int);
       
      # First byte of the row data is the first row's null bitmap, 0x81 here
      insert into t1 values (NULL, 1, repeat('x', 1100), 1, 1, 1, 1, NULL);
       
      --connection slave
      --let $slave_sql_errno= 1594
      --source include/wait_for_slave_sql_error.inc
      

      Attachments

        Issue Links

          Activity

            People

              bnestere Brandon Nesterenko
              bnestere Brandon Nesterenko
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 2d Original Estimate - 2d
                  2d
                  Remaining:
                  Time Spent - 0.5h Remaining Estimate - 2d
                  2d
                  Logged:
                  Time Spent - 0.5h Remaining Estimate - 2d
                  0.5h

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.