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

Assertion `readbytes != (size_t)-1 || (*__errno_location ()) != 9' failure or corruption errors upon REPAIR on Aria tables

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (a INT, b INT, UNIQUE(b), UNIQUE(a)) ENGINE=Aria;
      INSERT INTO t1 VALUES (1,2);
      REPAIR TABLE t1 EXTENDED QUICK USE_FRM;
       
      CREATE TABLE t2 (c INT) ENGINE=Aria;
      SELECT * FROM t2;
       
      REPLACE INTO t1 VALUES (1,3);
       
      REPAIR TABLE t2, t1 QUICK;
       
      # Cleanup
      DROP TABLE t1, t2;
      

      10.4 ee59ca7ff1620dd74b9bc1449878c5d1acee0f53 debug

      mysqld: /data/bld/10.4-debug/mysys/my_pread.c:72: my_pread: Assertion `readbytes != (size_t)-1 || (*__errno_location ()) != 9' failed.
      240502 16:28:13 [ERROR] mysqld got signal 6 ;
       
      #9  0x00007f81aec53e32 in __GI___assert_fail (assertion=0x555be9c03650 "readbytes != (size_t)-1 || (*__errno_location ()) != 9", file=0x555be9c035a8 "/data/bld/10.4-debug/mysys/my_pread.c", line=72, function=0x555be9c03720 <__PRETTY_FUNCTION__.0> "my_pread") at ./assert/assert.c:101
      #10 0x0000555be96221bc in my_pread (Filedes=63, Buffer=0x7f81a9798080 "\001", Count=8192, offset=8192, MyFlags=36) at /data/bld/10.4-debug/mysys/my_pread.c:72
      #11 0x0000555be8f85bd3 in inline_mysql_file_pread (src_file=0x555be9a4c338 "/data/bld/10.4-debug/storage/maria/ma_pagecache.c", src_line=2723, file=63, buffer=0x7f81a9798080 "\001", count=8192, offset=8192, flags=36) at /data/bld/10.4-debug/include/mysql/psi/mysql_file.h:1224
      #12 0x0000555be8f8ccf1 in read_block (pagecache=0x555bea36af20 <maria_pagecache_var>, block=0x7f81a96f08e0, primary=1 '\001') at /data/bld/10.4-debug/storage/maria/ma_pagecache.c:2723
      #13 0x0000555be8f8ed35 in pagecache_read (pagecache=0x555bea36af20 <maria_pagecache_var>, file=0x7f8198069710, pageno=1, level=0, buff=0x7f81980699f0 "", type=PAGECACHE_PLAIN_PAGE, lock=PAGECACHE_LOCK_LEFT_UNLOCKED, page_link=0x7f81a8beadf0) at /data/bld/10.4-debug/storage/maria/ma_pagecache.c:3401
      #14 0x0000555be8fd3431 in _ma_read_block_record (info=0x7f81980692c0, record=0x7f81980713a0 "\371\001", record_pos=257) at /data/bld/10.4-debug/storage/maria/ma_blockrec.c:5159
      #15 0x0000555be900870c in sort_delete_record (sort_param=0x7f81a8beb8a0) at /data/bld/10.4-debug/storage/maria/ma_check.c:5915
      #16 0x0000555be90076fc in sort_key_write (sort_param=0x7f81a8beb8a0, a=0x7f8198043112 "\001") at /data/bld/10.4-debug/storage/maria/ma_check.c:5609
      #17 0x0000555be900f553 in write_index (info=0x7f81a8beb8a0, sort_keys=0x7f8198043100, count=0) at /data/bld/10.4-debug/storage/maria/ma_sort.c:826
      #18 0x0000555be900d7b0 in _ma_create_index_by_sort (info=0x7f81a8beb8a0, no_messages=1 '\001', sortbuff_size=32768) at /data/bld/10.4-debug/storage/maria/ma_sort.c:240
      #19 0x0000555be90020ad in maria_repair_by_sort (param=0x7f81981dcf18, info=0x1b2df6, name=0x7f81a8becec0 "./test/t1", rep_quick=0 '\000') at /data/bld/10.4-debug/storage/maria/ma_check.c:3924
      #20 0x0000555be8f5c064 in ha_maria::repair (this=0x7f81980616f8, thd=0x7f8198000da0, param=0x7f81981dcf18, do_optimize=false) at /data/bld/10.4-debug/storage/maria/ha_maria.cc:1658
      #21 0x0000555be8f5b4c7 in ha_maria::repair (this=0x7f81980616f8, thd=0x7f8198000da0, check_opt=0x7f8198006018) at /data/bld/10.4-debug/storage/maria/ha_maria.cc:1453
      #22 0x0000555be8d0a933 in handler::ha_repair (this=0x7f81980616f8, thd=0x7f8198000da0, check_opt=0x7f8198006018) at /data/bld/10.4-debug/sql/handler.cc:4487
      #23 0x0000555be8b50c0f in mysql_admin_table (thd=0x7f8198000da0, tables=0x7f81980148c0, check_opt=0x7f8198006018, operator_name=0x555be9888d6d "repair", lock_type=TL_WRITE, org_open_for_modify=true, repair_table_use_frm=false, extra_open_options=32, prepare_func=0x555be8b4e89a <prepare_for_repair(THD*, TABLE_LIST*, HA_CHECK_OPT*)>, operator_func=(int (handler::*)(handler * const, THD *, HA_CHECK_OPT *)) 0x555be8d0a8ee <handler::ha_repair(THD*, st_ha_check_opt*)>, view_operator_func=0x555be8ad1999 <view_repair(THD*, TABLE_LIST*, st_ha_check_opt*)>, is_cmd_replicated=true) at /data/bld/10.4-debug/sql/sql_admin.cc:865
      #24 0x0000555be8b537d8 in Sql_cmd_repair_table::execute (this=0x7f81980156e8, thd=0x7f8198000da0) at /data/bld/10.4-debug/sql/sql_admin.cc:1512
      #25 0x0000555be89a7072 in mysql_execute_command (thd=0x7f8198000da0) at /data/bld/10.4-debug/sql/sql_parse.cc:6301
      #26 0x0000555be89ac539 in mysql_parse (thd=0x7f8198000da0, rawbuf=0x7f81980147f8 "REPAIR TABLE t2, t1 QUICK", length=25, parser_state=0x7f81a8bee3c0, is_com_multi=false, is_next_command=false) at /data/bld/10.4-debug/sql/sql_parse.cc:8097
      #27 0x0000555be8997bb4 in dispatch_command (command=COM_QUERY, thd=0x7f8198000da0, packet=0x7f819800ac51 "", packet_length=25, is_com_multi=false, is_next_command=false) at /data/bld/10.4-debug/sql/sql_parse.cc:1857
      #28 0x0000555be899641b in do_command (thd=0x7f8198000da0) at /data/bld/10.4-debug/sql/sql_parse.cc:1378
      #29 0x0000555be8b3a327 in do_handle_one_connection (connect=0x555beb8e71f0) at /data/bld/10.4-debug/sql/sql_connect.cc:1419
      #30 0x0000555be8b3a08f in handle_one_connection (arg=0x555beb8e71f0) at /data/bld/10.4-debug/sql/sql_connect.cc:1323
      #31 0x0000555be908cdb6 in pfs_spawn_thread (arg=0x555beb8382e0) at /data/bld/10.4-debug/storage/perfschema/pfs.cc:1869
      #32 0x00007f81aeca8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #33 0x00007f81aed2861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      10.4 59e7289b6ce93e52b251466e18a2e0eab8b47c36 non-debug

      REPAIR TABLE t2, t1 QUICK;
      Table	Op	Msg_type	Msg_text
      test.t2	repair	status	OK
      test.t1	repair	warning	Duplicate key  2 for record at 257 against record at 256
      test.t1	repair	error	Quick-recover aborted; Run recovery without switch -q or with switch -qq
      test.t1	repair	error	Create index by sort failed
      test.t1	repair	Note	Retrying repair without quick
      test.t1	repair	Warning	Duplicate key  2 for record at 257 against record at 256
      test.t1	repair	Error	Can't read record to be removed
      test.t1	repair	Error	Create index by sort failed
      test.t1	repair	Note	Retrying repair with keycache
      test.t1	repair	Warning	Duplicate key  2 for record at 257 against new record at 256
      test.t1	repair	Warning	1 records have been removed
      test.t1	repair	status	OK
      DROP TABLE t1, t2;
      

      Attachments

        Issue Links

          Activity

            People

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