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

Assertion `s <= READ_FIX' failed in buf_page_t::set_state

    XMLWordPrintable

Details

    Description

      The test case is non-deterministic. It currently fails for me every time on a debug build, but the iteration of DELETE when it fails differs between the runs. I suppose it's possible that it may not fail at all on some machines or builds.

      --source include/have_innodb.inc
      --source include/have_sequence.inc
       
      SET @buffering= @@innodb_change_buffering;
      SET GLOBAL innodb_change_buffering= deletes;
       
      CREATE TABLE t1 (
        a varchar(1024),
        b varchar(1024),
        c varchar(1024),
        d varchar(1024),
        e varchar(1024),
        f varchar(1024),
        g varchar(1024),
        h varchar(1024),
        key (a),
        key (b),
        key (c),
        key (d)
      ) ENGINE=InnoDB;
       
      INSERT INTO t1 SELECT REPEAT('x',10), REPEAT('x',13), REPEAT('x',427), REPEAT('x',244), REPEAT('x',9), REPEAT('x',112), REPEAT('x',814), REPEAT('x',633) FROM seq_1_to_1024;
       
      CREATE TABLE t2 (
        a varchar(1024),
        b varchar(1024),
        c varchar(1024),
        d varchar(1024),
        e varchar(1024),
        f varchar(1024),
        g varchar(1024),
        h varchar(1024),
        i varchar(1024),
        j varchar(1024),
        k varchar(1024),
        l varchar(1024),
        m varchar(1024),
        key (a),
        key (b),
        key (c),
        key (d),
        key (e),
        key (f)
      ) ENGINE=InnoDB;
       
      INSERT INTO t2 SELECT REPEAT('x',512), REPEAT('x',512), REPEAT('x',512), REPEAT('x',512), REPEAT('x',512), REPEAT('x',512), REPEAT('x',512), REPEAT('x',512), REPEAT('x',512), REPEAT('x',512), REPEAT('x',512), REPEAT('x',512), REPEAT('x',512) FROM seq_1_to_16384;
       
      --let $run=1024
      while ($run)
      {
        eval DELETE FROM t1 LIMIT 1 /* $run */;
        --dec $run
      }
       
      # Cleanup
      DROP TABLE t1, t2;
      SET GLOBAL innodb_change_buffering= @buffering;
      

      10.6 27b0030b debug

      mariadbd: /data/src/10.6/storage/innobase/include/buf0buf.h:2012: void buf_page_t::set_state(uint32_t): Assertion `s <= READ_FIX' failed.
      220410  0:39:30 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f9dd779e662 in __GI___assert_fail (assertion=0x55c5017869f9 "s <= READ_FIX", file=0x55c501785ca8 "/data/src/10.6/storage/innobase/include/buf0buf.h", line=2012, function=0x55c501786938 "void buf_page_t::set_state(uint32_t)") at assert.c:101
      #8  0x000055c5010d9ddc in buf_page_t::set_state (this=0x7f9dd0dd19f0, s=2147483649) at /data/src/10.6/storage/innobase/include/buf0buf.h:2012
      #9  0x000055c5010fdbe8 in buf_page_init_for_read (mode=132, page_id=..., zip_size=0, unzip=false) at /data/src/10.6/storage/innobase/buf/buf0rea.cc:153
      #10 0x000055c5010fe36b in buf_read_page_low (err=0x7f9dd0b32524, space=0x7f9d80236c68, sync=true, mode=132, page_id=..., zip_size=0, unzip=false) at /data/src/10.6/storage/innobase/buf/buf0rea.cc:299
      #11 0x000055c5010fed45 in buf_read_page (page_id=..., zip_size=0) at /data/src/10.6/storage/innobase/buf/buf0rea.cc:467
      #12 0x000055c5010d0425 in buf_page_get_low (page_id=..., zip_size=0, rw_latch=2, guess=0x0, mode=10, mtr=0x7f9dd0b33ce0, err=0x7f9dd0b32a28, allow_ibuf_merge=true) at /data/src/10.6/storage/innobase/buf/buf0buf.cc:2613
      #13 0x000055c5010d2023 in buf_page_get_gen (page_id=..., zip_size=0, rw_latch=2, guess=0x0, mode=10, mtr=0x7f9dd0b33ce0, err=0x7f9dd0b32a28, allow_ibuf_merge=true) at /data/src/10.6/storage/innobase/buf/buf0buf.cc:3046
      #14 0x000055c5010988e5 in btr_cur_search_to_nth_level_func (index=0x7f9d801ad248, level=0, tuple=0x7f9d80b94838, mode=PAGE_CUR_LE, latch_mode=2, cursor=0x7f9dd0b33a70, ahi_latch=0x0, mtr=0x7f9dd0b33ce0, autoinc=0) at /data/src/10.6/storage/innobase/btr/btr0cur.cc:1602
      #15 0x000055c500fd3ac0 in btr_pcur_open_low (index=0x7f9d801ad248, level=0, tuple=0x7f9d80b94838, mode=PAGE_CUR_LE, latch_mode=4098, cursor=0x7f9dd0b33a70, autoinc=0, mtr=0x7f9dd0b33ce0) at /data/src/10.6/storage/innobase/include/btr0pcur.inl:369
      #16 0x000055c500fd7c33 in row_search_index_entry (index=0x7f9d801ad248, entry=0x7f9d80b94838, mode=4098, pcur=0x7f9dd0b33a70, mtr=0x7f9dd0b33ce0) at /data/src/10.6/storage/innobase/row/row0row.cc:1311
      #17 0x000055c500ffd70f in row_upd_sec_index_entry (node=0x7f9d80074ea8, thr=0x7f9d800752c0) at /data/src/10.6/storage/innobase/row/row0upd.cc:2007
      #18 0x000055c500ffe28c in row_upd_sec_step (node=0x7f9d80074ea8, thr=0x7f9d800752c0) at /data/src/10.6/storage/innobase/row/row0upd.cc:2199
      #19 0x000055c501000e3a in row_upd (node=0x7f9d80074ea8, thr=0x7f9d800752c0) at /data/src/10.6/storage/innobase/row/row0upd.cc:2936
      #20 0x000055c501001270 in row_upd_step (thr=0x7f9d800752c0) at /data/src/10.6/storage/innobase/row/row0upd.cc:3051
      #21 0x000055c500fabd03 in row_update_for_mysql (prebuilt=0x7f9d802232a8) at /data/src/10.6/storage/innobase/row/row0mysql.cc:1700
      #22 0x000055c500dec50c in ha_innobase::delete_row (this=0x7f9d801b1710, record=0x7f9d8022f360 "") at /data/src/10.6/storage/innobase/handler/ha_innodb.cc:8777
      #23 0x000055c5009e945b in handler::ha_delete_row (this=0x7f9d801b1710, buf=0x7f9d8022f360 "") at /data/src/10.6/sql/handler.cc:7677
      #24 0x000055c500bbe65f in TABLE::delete_row (this=0x7f9d801b0e18) at /data/src/10.6/sql/sql_delete.cc:281
      #25 0x000055c500bbb542 in mysql_delete (thd=0x7f9d80000db8, table_list=0x7f9d800156a8, conds=0x0, order_list=0x7f9d80005c00, limit=1, options=0, result=0x0) at /data/src/10.6/sql/sql_delete.cc:830
      #26 0x000055c5006456b0 in mysql_execute_command (thd=0x7f9d80000db8, is_called_from_prepared_stmt=false) at /data/src/10.6/sql/sql_parse.cc:4822
      #27 0x000055c500650036 in mysql_parse (thd=0x7f9d80000db8, rawbuf=0x7f9d800155c0 "DELETE FROM t1 LIMIT 1 /* 875 */", length=32, parser_state=0x7f9dd0b35500) at /data/src/10.6/sql/sql_parse.cc:8045
      #28 0x000055c50063c671 in dispatch_command (command=COM_QUERY, thd=0x7f9d80000db8, packet=0x7f9d8000b879 "DELETE FROM t1 LIMIT 1 /* 875 */", packet_length=32, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1912
      #29 0x000055c50063af9e in do_command (thd=0x7f9d80000db8, blocking=true) at /data/src/10.6/sql/sql_parse.cc:1409
      #30 0x000055c5007f49ca in do_handle_one_connection (connect=0x55c5035b2938, put_in_cache=true) at /data/src/10.6/sql/sql_connect.cc:1418
      #31 0x000055c5007f4669 in handle_one_connection (arg=0x55c5035b2858) at /data/src/10.6/sql/sql_connect.cc:1312
      #32 0x000055c500d0f00c in pfs_spawn_thread (arg=0x55c5035b2228) at /data/src/10.6/storage/perfschema/pfs.cc:2201
      #33 0x00007f9dd7c6aea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #34 0x00007f9dd7867def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      The failure apparently started happening on 10.6 after this commit:

      commit 8684af76e34641331695860fc13eb9fc2ff94215
      Author: Marko Mäkelä
      Date:   Thu Mar 24 16:09:04 2022 +0200
       
          MDEV-28137 Some memory transactions are unnecessarily complex
      

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.