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

Assertion `marked_for_read()' fails on slave upon RBR with unique blobs and binlog_row_image=MINIMAL

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.4, 11.8, 12.2
    • 11.4, 11.8, 12.3
    • Replication
    • None

    Description

      --source include/have_binlog_format_row.inc
      --source include/master-slave.inc
       
      --connection slave
      SET @row_image_save = @@global.binlog_row_image;
      SET GLOBAL binlog_row_image=MINIMAL;
      --source include/stop_slave.inc
      --source include/start_slave.inc
       
      --connection master
      SET binlog_row_image=MINIMAL;
      CREATE TABLE t (pk int primary key, a text, b text, unique(b));
      INSERT INTO t VALUES (1,'foo', 'bar');
      UPDATE t SET a = 'baz';
       
      --sync_slave_with_master
      SET GLOBAL binlog_row_image = @row_image_save;
       
      --connection master
      DROP TABLE t;
      --source include/rpl_end.inc
      

      main 5bcc115d773caac07d4afd42252e08f3905452b0

      mariadbd: /data/bld/main-asan-ubsan/sql/field.cc:9000: virtual void Field_blob::hash_not_null(Hasher*): Assertion `marked_for_read()' failed.
      260202 20:39:29 [ERROR] /share8t/bld/main-asan-ubsan/sql/mariadbd got signal 6 ;
       
      #10 0x00007fac7e453eb2 in __GI___assert_fail (assertion=0x5608246ef6e0 "marked_for_read()", file=0x5608246e7bc0 "/data/bld/main-asan-ubsan/sql/field.cc", line=9000, function=0x5608246f32a0 "virtual void Field_blob::hash_not_null(Hasher*)") at ./assert/assert.c:101
      #11 0x00005608218c79b3 in Field_blob::hash_not_null (this=0x625000341560, hasher=0x7fac6a778030) at /data/bld/main-asan-ubsan/sql/field.cc:9000
      #12 0x00005608214ce357 in Item_field::hash_not_null (this=<optimized out>, hasher=0x7fac6a778030) at /data/bld/main-asan-ubsan/sql/item.h:3906
      #13 0x0000560821d5d90b in Item_func_hash::val_int (this=0x625000341b50) at /data/bld/main-asan-ubsan/sql/item_func.cc:1804
      #14 0x0000560821af03f9 in Item::save_int_in_field (this=this@entry=0x625000341b50, field=field@entry=0x625000341690, no_conversions=no_conversions@entry=false) at /data/bld/main-asan-ubsan/sql/item.cc:7274
      #15 0x0000560821223936 in Type_handler_int_result::Item_save_in_field (this=<optimized out>, item=0x625000341b50, field=0x625000341690, no_conversions=<optimized out>) at /data/bld/main-asan-ubsan/sql/sql_type.cc:4448
      #16 0x0000560821a79880 in Item::save_in_field (this=0x625000341b50, field=0x625000341690, no_conversions=<optimized out>) at /data/bld/main-asan-ubsan/sql/item.cc:7294
      #17 0x0000560820c50104 in TABLE::update_virtual_fields (this=this@entry=0x6190000f0f98, h=h@entry=0x625000340948, update_mode=update_mode@entry=VCOL_UPDATE_FOR_READ) at /data/bld/main-asan-ubsan/sql/table.cc:9364
      #18 0x00005608219d52dc in handler::ha_index_read_map (this=this@entry=0x625000340948, buf=<optimized out>, key=<optimized out>, keypart_map=keypart_map@entry=3, find_flag=find_flag@entry=HA_READ_KEY_EXACT) at /data/bld/main-asan-ubsan/sql/handler.cc:4140
      #19 0x000056082245a2af in Rows_log_event::find_row (this=this@entry=0x613000100818, rgi=rgi@entry=0x61d000320080) at /data/bld/main-asan-ubsan/sql/log_event_server.cc:8289
      #20 0x000056082245d09f in Update_rows_log_event::do_exec_row (this=0x613000100818, rgi=<optimized out>) at /data/bld/main-asan-ubsan/sql/log_event_server.cc:8632
      #21 0x000056082243da43 in Rows_log_event::do_apply_event (this=<optimized out>, rgi=0x61d000320080) at /data/bld/main-asan-ubsan/sql/log_event_server.cc:5467
      #22 0x00005608223c25b1 in Log_event::apply_event (this=this@entry=0x613000100818, rgi=rgi@entry=0x61d000320080) at /data/bld/main-asan-ubsan/sql/log_event.cc:4247
      #23 0x000056081ff5e302 in apply_event_and_update_pos_apply (ev=ev@entry=0x613000100818, thd=thd@entry=0x62c000260218, rgi=rgi@entry=0x61d000320080, reason=reason@entry=0) at /data/bld/main-asan-ubsan/sql/slave.cc:3684
      #24 0x000056081ff83c76 in apply_event_and_update_pos (ev=ev@entry=0x613000100818, thd=thd@entry=0x62c000260218, rgi=rgi@entry=0x61d000320080) at /data/bld/main-asan-ubsan/sql/slave.cc:3861
      #25 0x000056081ff871c8 in exec_relay_log_event (thd=<optimized out>, rli=rli@entry=0x62a0000322d0, serial_rgi=serial_rgi@entry=0x61d000320080) at /data/bld/main-asan-ubsan/sql/slave.cc:4303
      #26 0x000056081ff90625 in handle_slave_sql (arg=0x62a000030200) at /data/bld/main-asan-ubsan/sql/slave.cc:5535
      #27 0x0000560822a25dc1 in pfs_spawn_thread (arg=0x617000074d98) at /data/bld/main-asan-ubsan/storage/perfschema/pfs.cc:2198
      #28 0x00007fac7e4a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #29 0x00007fac7e52885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
       
      Query (0x60f000031d4b): UPDATE t SET a = 'baz'
      

      No obvious immediate problem on a non-debug build.

      The failure started happening after this merge in 11.4.9:

      commit 4ffa1ff4a7cb40f26fa79df748800c9de76e72cd
      Merge: be0e3b2f0d9 d0afe4b985a
      Author: Marko Mäkelä
      Date:   Thu Oct 9 13:37:45 2025 +0300
       
          Merge 10.11 into 11.4
      

      specifically, apparently after this commit

      commit fc8742e4ad51bb58615cfaf8c82840e6471c5b4d
      Author: Kristian Nielsen
      Date:   Sat Sep 6 22:46:14 2025 +0200
       
          MDEV-31678: UPDATE_ROWS_EVENT not setting updating columns in read_set
      

      However, I can't reproduce the failure on 10.6 or 10.11.

      Attachments

        Issue Links

          Activity

            People

              knielsen Kristian Nielsen
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.