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

Assertion failure in pagecache_read / _ma_flush_pending_blocks upon ENABLE KEYS

    XMLWordPrintable

Details

    Description

      The test case is attached as r10.test.
      It is simple and consists of
      CREATE TABLE
      ALTER .. DISABLE KEYS
      several INSERTs
      ALTER .. ENABLE KEYS

      But INSERTs are quite big, and apparently the issue depends on the exact data being inserted.

      The failure is happening deterministically for me, on all existing versions, several different machines.

      10.4 e146940a

      mysqld: /data/src/10.4/storage/maria/ma_pagecache.c:3417: pagecache_read: Assertion `block->type == PAGECACHE_EMPTY_PAGE || block->type == type || type == PAGECACHE_LSN_PAGE || type == PAGECACHE_READ_UNKNOWN_PAGE || block->type == PAGECACHE_READ_UNKNOWN_PAGE' failed.
      230711  0:53:24 [ERROR] mysqld got signal 6 ;
       
      #8  0x00007f8cae445395 in __assert_fail_base (fmt=0x7f8cae5b9a70 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x560ede905cf0 "block->type == PAGECACHE_EMPTY_PAGE || block->type == type || type == PAGECACHE_LSN_PAGE || type == PAGECACHE_READ_UNKNOWN_PAGE || block->type == PAGECACHE_READ_UNKNOWN_PAGE", file=file@entry=0x560ede9045b8 "/data/src/10.4/storage/maria/ma_pagecache.c", line=line@entry=3417, function=function@entry=0x560ede906b58 <__PRETTY_FUNCTION__.12> "pagecache_read") at ./assert/assert.c:92
      #9  0x00007f8cae453df2 in __GI___assert_fail (assertion=0x560ede905cf0 "block->type == PAGECACHE_EMPTY_PAGE || block->type == type || type == PAGECACHE_LSN_PAGE || type == PAGECACHE_READ_UNKNOWN_PAGE || block->type == PAGECACHE_READ_UNKNOWN_PAGE", file=0x560ede9045b8 "/data/src/10.4/storage/maria/ma_pagecache.c", line=3417, function=0x560ede906b58 <__PRETTY_FUNCTION__.12> "pagecache_read") at ./assert/assert.c:101
      #10 0x0000560edde5993c in pagecache_read (pagecache=0x560edf212fc0 <maria_pagecache_var>, file=0x7f8c981444e0, pageno=4, level=3, buff=0x0, type=PAGECACHE_PLAIN_PAGE, lock=PAGECACHE_LOCK_WRITE, page_link=0x7f8ca83e8800) at /data/src/10.4/storage/maria/ma_pagecache.c:3417
      #11 0x0000560edde83e24 in _ma_new (info=0x7f8c980537c0, level=3, page_link=0x7f8ca83e87c8) at /data/src/10.4/storage/maria/ma_page.c:431
      #12 0x0000560edded47ae in _ma_flush_pending_blocks (sort_param=0x7f8ca83e9070) at /data/src/10.4/storage/maria/ma_check.c:5976
      #13 0x0000560edded9591 in _ma_create_index_by_sort (info=0x7f8ca83e9070, no_messages=1 '\001', sortbuff_size=131072) at /data/src/10.4/storage/maria/ma_sort.c:265
      #14 0x0000560eddecdd4f in maria_repair_by_sort (param=0x7f8c981bddd8, info=0x36a2dc, name=0x7f8ca83ea6a0 "./test/t", rep_quick=1 '\001') at /data/src/10.4/storage/maria/ma_check.c:3924
      #15 0x0000560edde26b64 in ha_maria::repair (this=0x7f8c98042798, thd=0x7f8c98000da0, param=0x7f8c981bddd8, do_optimize=false) at /data/src/10.4/storage/maria/ha_maria.cc:1658
      #16 0x0000560edde27a4d in ha_maria::enable_indexes (this=0x7f8c98042798, mode=2) at /data/src/10.4/storage/maria/ha_maria.cc:2022
      #17 0x0000560eddbd7c9f in handler::ha_enable_indexes (this=0x7f8c98042798, mode=2) at /data/src/10.4/sql/handler.cc:4627
      #18 0x0000560edd968e0e in alter_table_manage_keys (table=0x7f8c980a5d00, indexes_were_disabled=1, keys_onoff=Alter_info::ENABLE) at /data/src/10.4/sql/sql_table.cc:7624
      #19 0x0000560edd96ec44 in simple_rename_or_index_change (thd=0x7f8c98000da0, table_list=0x7f8c980148d0, keys_onoff=Alter_info::ENABLE, alter_ctx=0x7f8ca83ec540) at /data/src/10.4/sql/sql_table.cc:9513
      #20 0x0000560edd97072a in mysql_alter_table (thd=0x7f8c98000da0, new_db=0x7f8c980055a8, new_name=0x7f8c98005a00, create_info=0x7f8ca83ed150, table_list=0x7f8c980148d0, recreate_info=0x7f8ca83ed050, alter_info=0x7f8ca83ed090, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10081
      #21 0x0000560edda12492 in Sql_cmd_alter_table::execute (this=0x7f8c98014fc8, thd=0x7f8c98000da0) at /data/src/10.4/sql/sql_alter.cc:531
      #22 0x0000560edd8781a7 in mysql_execute_command (thd=0x7f8c98000da0) at /data/src/10.4/sql/sql_parse.cc:6216
      #23 0x0000560edd87d627 in mysql_parse (thd=0x7f8c98000da0, rawbuf=0x7f8c980147f8 "ALTER TABLE t ENABLE KEYS", length=25, parser_state=0x7f8ca83ee3c0, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8008
      #24 0x0000560edd868ff8 in dispatch_command (command=COM_QUERY, thd=0x7f8c98000da0, packet=0x7f8c9800ac51 "ALTER TABLE t ENABLE KEYS", packet_length=25, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
      #25 0x0000560edd86785f in do_command (thd=0x7f8c98000da0) at /data/src/10.4/sql/sql_parse.cc:1378
      #26 0x0000560edda085e4 in do_handle_one_connection (connect=0x560ee041d960) at /data/src/10.4/sql/sql_connect.cc:1420
      #27 0x0000560edda0834c in handle_one_connection (arg=0x560ee041d960) at /data/src/10.4/sql/sql_connect.cc:1324
      #28 0x0000560eddf5ac6e in pfs_spawn_thread (arg=0x560ee036ece0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #29 0x00007f8cae4a7fd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #30 0x00007f8cae5285bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      No obvious immediate problem on a non-debug build.

      Attachments

        Activity

          People

            monty Michael Widenius
            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.