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

Table corruption, server hang or assorted assertion failures upon concurrent REPLACE DELAYED via PS

    XMLWordPrintable

Details

    Description

      IMPORTANT: The test cases are non-deterministic and for reproducing purposes only, don't put them into the regression suite.
      Repeating the same test cases can cause different effects, some of them are described below. The list may be incomplete.

      Binary log in the test case may be unimportant; I can't determine with certainty whether it has any effect, because the results vary so much.

      Test case 1: Aria

      --source include/have_log_bin.inc
      --source include/have_sequence.inc
       
      CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=Aria;
      CREATE VIEW v AS SELECT * FROM t;
       
      --connect (con1,localhost,root,,test)
      --connection con1
      --let $conid= `select connection_id()`
      --delimiter $
      --send
        LOOP REPLACE v SELECT seq FROM seq_1_to_20; END LOOP $
      --delimiter ;
       
      --connection default
      --let $run= 100
      while ($run)
      {
        EXECUTE IMMEDIATE 'REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20';
        --dec $run
      }
       
      # Cleanup
      --eval KILL $conid
      DROP VIEW v;
      DROP TABLE t;
      

      10.2 4ca4d606 debug, also happens on 10.3

      mysqld: /data/src/10.2/storage/maria/ma_bitmap.c:2748: _ma_bitmap_release_unused: Assertion `current_bitmap_value == bitmap_get_page_bits(info, bitmap, block->page)' failed.
      210319 17:11:38 [ERROR] mysqld got signal 6 ;
       
      #6  0x00007f9212d1e729 in __assert_fail_base (fmt=0x7f9212eb4588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5575ccad6db0 "current_bitmap_value == bitmap_get_page_bits(info, bitmap, block->page)", file=0x5575ccad63b8 "/data/src/10.2/storage/maria/ma_bitmap.c", line=2748, function=<optimized out>) at assert.c:92
      #7  0x00007f9212d2ff36 in __GI___assert_fail (assertion=0x5575ccad6db0 "current_bitmap_value == bitmap_get_page_bits(info, bitmap, block->page)", file=0x5575ccad63b8 "/data/src/10.2/storage/maria/ma_bitmap.c", line=2748, function=0x5575ccad7240 <__PRETTY_FUNCTION__.18820> "_ma_bitmap_release_unused") at assert.c:101
      #8  0x00005575cc6831fa in _ma_bitmap_release_unused (info=0x7f91f0025cb0, blocks=0x7f91f0025d18) at /data/src/10.2/storage/maria/ma_bitmap.c:2748
      #9  0x00005575cc6738d4 in write_block_record (info=0x7f91f0025cb0, old_record=0x7f91f00250f8 "\377\b", record=0x7f91f00250f0 "\377\b", row=0x7f91f0025dd8, bitmap_blocks=0x7f91f0025d18, head_block_is_read=1 '\001', row_pos=0x7f920ce3cef0, undo_lsn=1, old_record_checksum=0) at /data/src/10.2/storage/maria/ma_blockrec.c:3427
      #10 0x00005575cc674679 in _ma_update_block_record2 (info=0x7f91f0025cb0, record_pos=261, oldrec=0x7f91f00250f8 "\377\b", record=0x7f91f00250f0 "\377\b", undo_lsn=1) at /data/src/10.2/storage/maria/ma_blockrec.c:3804
      #11 0x00005575cc675036 in _ma_update_block_record (info=0x7f91f0025cb0, record_pos=261, orig_rec=0x7f91f00250f8 "\377\b", new_rec=0x7f91f00250f0 "\377\b") at /data/src/10.2/storage/maria/ma_blockrec.c:4019
      #12 0x00005575cc684b7a in maria_update (info=0x7f91f0025cb0, oldrec=0x7f91f00250f8 "\377\b", newrec=0x7f91f00250f0 "\377\b") at /data/src/10.2/storage/maria/ma_update.c:159
      #13 0x00005575cc61116c in ha_maria::update_row (this=0x7f91f0025548, old_data=0x7f91f00250f8 "\377\b", new_data=0x7f91f00250f0 "\377\b") at /data/src/10.2/storage/maria/ha_maria.cc:2341
      #14 0x00005575cc081658 in handler::ha_update_row (this=0x7f91f0025548, old_data=0x7f91f00250f8 "\377\b", new_data=0x7f91f00250f0 "\377\b") at /data/src/10.2/sql/handler.cc:6150
      #15 0x00005575cbdcbeed in write_record (thd=0x7f91f0000d90, table=0x7f91f00244e0, info=0x7f91f001f830) at /data/src/10.2/sql/sql_insert.cc:1883
      #16 0x00005575cbdd16b0 in select_insert::send_data (this=0x7f91f001f7f0, values=...) at /data/src/10.2/sql/sql_insert.cc:3832
      #17 0x00005575cbe633da in end_send (join=0x7f91f001f898, join_tab=0x7f91f0020d00, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:20035
      #18 0x00005575cbe60dea in evaluate_join_record (join=0x7f91f001f898, join_tab=0x7f91f0020950, error=0) at /data/src/10.2/sql/sql_select.cc:19083
      #19 0x00005575cbe60884 in sub_select (join=0x7f91f001f898, join_tab=0x7f91f0020950, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:18902
      #20 0x00005575cbe5fc32 in do_select (join=0x7f91f001f898, procedure=0x0) at /data/src/10.2/sql/sql_select.cc:18407
      #21 0x00005575cbe3987b in JOIN::exec_inner (this=0x7f91f001f898) at /data/src/10.2/sql/sql_select.cc:3642
      #22 0x00005575cbe38d22 in JOIN::exec (this=0x7f91f001f898) at /data/src/10.2/sql/sql_select.cc:3437
      #23 0x00005575cbe39efc in mysql_select (thd=0x7f91f0000d90, tables=0x7f91f00198e0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489926912, result=0x7f91f001f7f0, unit=0x7f91f001ae38, select_lex=0x7f91f001b578) at /data/src/10.2/sql/sql_select.cc:3840
      #24 0x00005575cbe2e05e in handle_select (thd=0x7f91f0000d90, lex=0x7f91f001ad78, result=0x7f91f001f7f0, setup_tables_done_option=1073741824) at /data/src/10.2/sql/sql_select.cc:361
      #25 0x00005575cbdf1645 in mysql_execute_command (thd=0x7f91f0000d90) at /data/src/10.2/sql/sql_parse.cc:4336
      #26 0x00005575cbd40774 in sp_instr_stmt::exec_core (this=0x7f91f0019f10, thd=0x7f91f0000d90, nextp=0x7f920ce3e63c) at /data/src/10.2/sql/sp_head.cc:3332
      #27 0x00005575cbd3fdd5 in sp_lex_keeper::reset_lex_and_exec_core (this=0x7f91f0019f50, thd=0x7f91f0000d90, nextp=0x7f920ce3e63c, open_tables=false, instr=0x7f91f0019f10) at /data/src/10.2/sql/sp_head.cc:3095
      #28 0x00005575cbd40419 in sp_instr_stmt::execute (this=0x7f91f0019f10, thd=0x7f91f0000d90, nextp=0x7f920ce3e63c) at /data/src/10.2/sql/sp_head.cc:3248
      #29 0x00005575cbd3b3ed in sp_head::execute (this=0x7f91f0018598, thd=0x7f91f0000d90, merge_da_on_success=true) at /data/src/10.2/sql/sp_head.cc:1326
      #30 0x00005575cbd3d60b in sp_head::execute_procedure (this=0x7f91f0018598, thd=0x7f91f0000d90, args=0x7f91f00056d0) at /data/src/10.2/sql/sp_head.cc:2202
      #31 0x00005575cbded59b in do_execute_sp (thd=0x7f91f0000d90, sp=0x7f91f0018598) at /data/src/10.2/sql/sql_parse.cc:2981
      #32 0x00005575cbdf6023 in mysql_execute_command (thd=0x7f91f0000d90) at /data/src/10.2/sql/sql_parse.cc:5635
      #33 0x00005575cbdfc43b in mysql_parse (thd=0x7f91f0000d90, rawbuf=0x7f91f0011338 "LOOP REPLACE v SELECT seq FROM seq_1_to_20; END LOOP", length=52, parser_state=0x7f920ce3f5f0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7794
      #34 0x00005575cbdea664 in dispatch_command (command=COM_QUERY, thd=0x7f91f0000d90, packet=0x7f91f0008b51 "LOOP REPLACE v SELECT seq FROM seq_1_to_20; END LOOP ", packet_length=53, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
      #35 0x00005575cbde915f in do_command (thd=0x7f91f0000d90) at /data/src/10.2/sql/sql_parse.cc:1381
      #36 0x00005575cbf43c94 in do_handle_one_connection (connect=0x5575cdfdaba0) at /data/src/10.2/sql/sql_connect.cc:1336
      #37 0x00005575cbf439f9 in handle_one_connection (arg=0x5575cdfdaba0) at /data/src/10.2/sql/sql_connect.cc:1241
      #38 0x00005575cc76cfe2 in pfs_spawn_thread (arg=0x5575ce01c8e0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #39 0x00007f9213241609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #40 0x00007f9212e1b293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.2 4ca4d606 debug

      mysqld: /data/src/10.2/storage/maria/ma_bitmap.c:3007: _ma_check_bitmap: Assertion `(bitmap->map + (bitmap->used_size+5)/6*6) >= first_empty' failed.
      210319 17:14:46 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f12c2820f36 in __GI___assert_fail (assertion=0x55fa992e3ea8 "(bitmap->map + (bitmap->used_size+5)/6*6) >= first_empty", file=0x55fa992e33b8 "/data/src/10.2/storage/maria/ma_bitmap.c", line=3007, function=0x55fa992e4280 <__PRETTY_FUNCTION__.18884> "_ma_check_bitmap") at assert.c:101
      #8  0x000055fa98e90a4e in _ma_check_bitmap (bitmap=0x7f12a0039f38) at /data/src/10.2/storage/maria/ma_bitmap.c:3007
      #9  0x000055fa98e8d056 in _ma_change_bitmap_page (info=0x7f12a008f4f0, bitmap=0x7f12a0039f38, page=0) at /data/src/10.2/storage/maria/ma_bitmap.c:1126
      #10 0x000055fa98e8d210 in move_to_next_bitmap (info=0x7f12a008f4f0, bitmap=0x7f12a0039f38) at /data/src/10.2/storage/maria/ma_bitmap.c:1182
      #11 0x000055fa98e8e3bb in find_head (info=0x7f12a008f4f0, length=34, position=3) at /data/src/10.2/storage/maria/ma_bitmap.c:1710
      #12 0x000055fa98e8ee79 in _ma_bitmap_find_place (info=0x7f12a008f4f0, row=0x7f12a008f558, blocks=0x7f12a008f558) at /data/src/10.2/storage/maria/ma_bitmap.c:2117
      #13 0x000055fa98e80c59 in allocate_and_write_block_record (info=0x7f12a008f4f0, record=0x7f12a00a1fd0 "\377\001", row=0x7f12a008f558, undo_lsn=1) at /data/src/10.2/storage/maria/ma_blockrec.c:3532
      #14 0x000055fa98e80f67 in _ma_write_init_block_record (info=0x7f12a008f4f0, record=0x7f12a00a1fd0 "\377\001") at /data/src/10.2/storage/maria/ma_blockrec.c:3603
      #15 0x000055fa98e92778 in maria_write (info=0x7f12a008f4f0, record=0x7f12a00a1fd0 "\377\001") at /data/src/10.2/storage/maria/ma_write.c:157
      #16 0x000055fa98e1aca3 in ha_maria::write_row (this=0x7f12a0038c98, buf=0x7f12a00a1fd0 "\377\001") at /data/src/10.2/storage/maria/ha_maria.cc:1293
      #17 0x000055fa9888e369 in handler::ha_write_row (this=0x7f12a0038c98, buf=0x7f12a00a1fd0 "\377\001") at /data/src/10.2/sql/handler.cc:6118
      #18 0x000055fa985d8421 in write_record (thd=0x7f12a0000d90, table=0x7f12a0038090, info=0x7f12a00131a8) at /data/src/10.2/sql/sql_insert.cc:1667
      #19 0x000055fa985de6b0 in select_insert::send_data (this=0x7f12a0013168, values=...) at /data/src/10.2/sql/sql_insert.cc:3832
      #20 0x000055fa986703da in end_send (join=0x7f12a0013210, join_tab=0x7f12a0014678, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:20035
      #21 0x000055fa9866ddea in evaluate_join_record (join=0x7f12a0013210, join_tab=0x7f12a00142c8, error=0) at /data/src/10.2/sql/sql_select.cc:19083
      #22 0x000055fa9866d6d1 in sub_select (join=0x7f12a0013210, join_tab=0x7f12a00142c8, end_of_records=false) at /data/src/10.2/sql/sql_select.cc:18863
      #23 0x000055fa9866cc32 in do_select (join=0x7f12a0013210, procedure=0x0) at /data/src/10.2/sql/sql_select.cc:18407
      #24 0x000055fa9864687b in JOIN::exec_inner (this=0x7f12a0013210) at /data/src/10.2/sql/sql_select.cc:3642
      #25 0x000055fa98645d22 in JOIN::exec (this=0x7f12a0013210) at /data/src/10.2/sql/sql_select.cc:3437
      #26 0x000055fa98646efc in mysql_select (thd=0x7f12a0000d90, tables=0x7f12a007f900, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489925888, result=0x7f12a0013168, unit=0x7f12a007dae8, select_lex=0x7f12a007e228) at /data/src/10.2/sql/sql_select.cc:3840
      #27 0x000055fa9863b05e in handle_select (thd=0x7f12a0000d90, lex=0x7f12a007da28, result=0x7f12a0013168, setup_tables_done_option=1073741824) at /data/src/10.2/sql/sql_select.cc:361
      #28 0x000055fa985fe645 in mysql_execute_command (thd=0x7f12a0000d90) at /data/src/10.2/sql/sql_parse.cc:4336
      #29 0x000055fa98627b47 in Prepared_statement::execute (this=0x7f12a009e810, expanded_query=0x7f12bc92f870, open_cursor=false) at /data/src/10.2/sql/sql_prepare.cc:5053
      #30 0x000055fa98626050 in Prepared_statement::execute_loop (this=0x7f12a009e810, expanded_query=0x7f12bc92f870, open_cursor=false, packet=0x0, packet_end=0x0) at /data/src/10.2/sql/sql_prepare.cc:4482
      #31 0x000055fa986280ac in Prepared_statement::execute_immediate (this=0x7f12a009e810, query=0x7f12a00128f0 "REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20", query_len=50) at /data/src/10.2/sql/sql_prepare.cc:5177
      #32 0x000055fa98622a00 in mysql_sql_stmt_execute_immediate (thd=0x7f12a0000d90) at /data/src/10.2/sql/sql_prepare.cc:3020
      #33 0x000055fa985fc210 in mysql_execute_command (thd=0x7f12a0000d90) at /data/src/10.2/sql/sql_parse.cc:3591
      #34 0x000055fa9860943b in mysql_parse (thd=0x7f12a0000d90, rawbuf=0x7f12a00127f8 "EXECUTE IMMEDIATE 'REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20'", length=70, parser_state=0x7f12bc9305f0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7794
      #35 0x000055fa985f7664 in dispatch_command (command=COM_QUERY, thd=0x7f12a0000d90, packet=0x7f12a0008c51 "EXECUTE IMMEDIATE 'REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20'", packet_length=70, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
      #36 0x000055fa985f615f in do_command (thd=0x7f12a0000d90) at /data/src/10.2/sql/sql_parse.cc:1381
      #37 0x000055fa98750c94 in do_handle_one_connection (connect=0x55fa9bc01620) at /data/src/10.2/sql/sql_connect.cc:1336
      #38 0x000055fa987509f9 in handle_one_connection (arg=0x55fa9bc01620) at /data/src/10.2/sql/sql_connect.cc:1241
      #39 0x000055fa98f79fe2 in pfs_spawn_thread (arg=0x55fa9bbe48c0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #40 0x00007f12c2d32609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #41 0x00007f12c290c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.2 4ca4d606 debug

      mysqld: /data/src/10.2/storage/maria/ma_check.c:6464: maria_disable_indexes_for_rebuild: Assertion `share->state.state.records == 0 && (!rows || rows >= 100)' failed.
      210319 17:43:55 [ERROR] mysqld got signal 6 ;
       
      Thread 1 (Thread 0x7f115eb44700 (LWP 987270)):
      #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x00005572b5766eeb in my_write_core (sig=6) at /data/src/10.2/mysys/stacktrace.c:382
      #2  0x00005572b500d6dd in handle_fatal_signal (sig=6) at /data/src/10.2/sql/signal_handler.cc:343
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x00007f1164a6d859 in __GI_abort () at abort.c:79
      #6  0x00007f1164a6d729 in __assert_fail_base (fmt=0x7f1164c03588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5572b5a77170 "share->state.state.records == 0 && (!rows || rows >= 100)", file=0x5572b5a74aa8 "/data/src/10.2/storage/maria/ma_check.c", line=6464, function=<optimized out>) at assert.c:92
      #7  0x00007f1164a7ef36 in __GI___assert_fail (assertion=0x5572b5a77170 "share->state.state.records == 0 && (!rows || rows >= 100)", file=0x5572b5a74aa8 "/data/src/10.2/storage/maria/ma_check.c", line=6464, function=0x5572b5a774a0 <__PRETTY_FUNCTION__.19959> "maria_disable_indexes_for_rebuild") at assert.c:101
      #8  0x00005572b5647910 in maria_disable_indexes_for_rebuild (info=0x7f1144026260, rows=0, all_keys=0 '\000') at /data/src/10.2/storage/maria/ma_check.c:6464
      #9  0x00005572b55aca23 in ha_maria::start_bulk_insert (this=0x7f1144025af8, rows=0, flags=0) at /data/src/10.2/storage/maria/ha_maria.cc:2188
      #10 0x00005572b4d70827 in handler::ha_start_bulk_insert (this=0x7f1144025af8, rows=0, flags=0) at /data/src/10.2/sql/handler.h:2919
      #11 0x00005572b4d6ce98 in select_insert::prepare (this=0x7f114401f8f0, values=..., u=0x7f114401af38) at /data/src/10.2/sql/sql_insert.cc:3708
      #12 0x00005572b4dcc66b in JOIN::prepare (this=0x7f114401f998, tables_init=0x7f11440199e0, wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7f114401b678, unit_arg=0x7f114401af38) at /data/src/10.2/sql/sql_select.cc:1053
      #13 0x00005572b4dd5e4a in mysql_select (thd=0x7f1144000d90, tables=0x7f11440199e0, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489926912, result=0x7f114401f8f0, unit=0x7f114401af38, select_lex=0x7f114401b678) at /data/src/10.2/sql/sql_select.cc:3818
      #14 0x00005572b4dca05e in handle_select (thd=0x7f1144000d90, lex=0x7f114401ae78, result=0x7f114401f8f0, setup_tables_done_option=1073741824) at /data/src/10.2/sql/sql_select.cc:361
      #15 0x00005572b4d8d645 in mysql_execute_command (thd=0x7f1144000d90) at /data/src/10.2/sql/sql_parse.cc:4336
      #16 0x00005572b4cdc774 in sp_instr_stmt::exec_core (this=0x7f114401a010, thd=0x7f1144000d90, nextp=0x7f115eb4263c) at /data/src/10.2/sql/sp_head.cc:3332
      #17 0x00005572b4cdbdd5 in sp_lex_keeper::reset_lex_and_exec_core (this=0x7f114401a050, thd=0x7f1144000d90, nextp=0x7f115eb4263c, open_tables=false, instr=0x7f114401a010) at /data/src/10.2/sql/sp_head.cc:3095
      #18 0x00005572b4cdc419 in sp_instr_stmt::execute (this=0x7f114401a010, thd=0x7f1144000d90, nextp=0x7f115eb4263c) at /data/src/10.2/sql/sp_head.cc:3248
      #19 0x00005572b4cd73ed in sp_head::execute (this=0x7f1144018698, thd=0x7f1144000d90, merge_da_on_success=true) at /data/src/10.2/sql/sp_head.cc:1326
      #20 0x00005572b4cd960b in sp_head::execute_procedure (this=0x7f1144018698, thd=0x7f1144000d90, args=0x7f11440056d0) at /data/src/10.2/sql/sp_head.cc:2202
      #21 0x00005572b4d8959b in do_execute_sp (thd=0x7f1144000d90, sp=0x7f1144018698) at /data/src/10.2/sql/sql_parse.cc:2981
      #22 0x00005572b4d92023 in mysql_execute_command (thd=0x7f1144000d90) at /data/src/10.2/sql/sql_parse.cc:5635
      #23 0x00005572b4d9843b in mysql_parse (thd=0x7f1144000d90, rawbuf=0x7f1144011438 "LOOP REPLACE v SELECT seq FROM seq_1_to_20; END LOOP", length=52, parser_state=0x7f115eb435f0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7794
      #24 0x00005572b4d86664 in dispatch_command (command=COM_QUERY, thd=0x7f1144000d90, packet=0x7f1144008c51 "LOOP REPLACE v SELECT seq FROM seq_1_to_20; END LOOP ", packet_length=53, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
      #25 0x00005572b4d8515f in do_command (thd=0x7f1144000d90) at /data/src/10.2/sql/sql_parse.cc:1381
      #26 0x00005572b4edfc94 in do_handle_one_connection (connect=0x5572b6e41eb0) at /data/src/10.2/sql/sql_connect.cc:1336
      #27 0x00005572b4edf9f9 in handle_one_connection (arg=0x5572b6e41eb0) at /data/src/10.2/sql/sql_connect.cc:1241
      #28 0x00005572b5708fe2 in pfs_spawn_thread (arg=0x5572b6e83ad0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #29 0x00007f1164f90609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #30 0x00007f1164b6a293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Also observed on 10.2, don't have the stack trace or revno handy

      get_head_or_tail_page: Assertion `(uint) (res->buff[7] & 7) == page_type' failed.
      

      10.2 4ca4d606 non-debug, also happens on 10.3, 10.4

      EXECUTE IMMEDIATE 'REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20'' failed: 1030: Got error 122 "Internal (unspecified) error in handler" from storage engine Aria
      

      10.2 4ca4d606 non-debug - Hang

      Thread 8 (Thread 0x7f01688ec700 (LWP 983198)):
      #0  futex_abstimed_wait_cancelable (private=<optimized out>, abstime=0x7f01688e8190, clockid=<optimized out>, expected=0, futex_word=0x7f0150000b94) at ../sysdeps/nptl/futex-internal.h:320
      #1  __pthread_cond_wait_common (abstime=0x7f01688e8190, clockid=<optimized out>, mutex=0x7f014c175538, cond=0x7f0150000b68) at pthread_cond_wait.c:520
      #2  __pthread_cond_timedwait (cond=cond@entry=0x7f0150000b68, mutex=mutex@entry=0x7f014c175538, abstime=abstime@entry=0x7f01688e8190) at pthread_cond_wait.c:656
      #3  0x000055a05aa51baf in inline_mysql_cond_timedwait (src_file=0x55a05abf4110 "/data/src/10.2/mysys/thr_lock.c", src_line=575, abstime=0x7f01688e8190, mutex=0x7f014c175538, that=0x7f0150000b68) at /data/src/10.2/include/mysql/psi/mysql_thread.h:1182
      #4  wait_for_lock (wait=wait@entry=0x7f014c175588, data=data@entry=0x7f01500233f0, in_wait_list=in_wait_list@entry=0 '\000', lock_wait_timeout=lock_wait_timeout@entry=86400) at /data/src/10.2/mysys/thr_lock.c:575
      #5  0x000055a05aa52799 in thr_lock (lock_wait_timeout=86400, owner=0x7f01500024d0, data=0x7f01500233f0) at /data/src/10.2/mysys/thr_lock.c:1013
      #6  thr_multi_lock (data=<optimized out>, count=<optimized out>, owner=owner@entry=0x7f01500024d0, lock_wait_timeout=lock_wait_timeout@entry=86400) at /data/src/10.2/mysys/thr_lock.c:1294
      #7  0x000055a05a5e6257 in mysql_lock_tables (thd=thd@entry=0x7f0150000c48, sql_lock=sql_lock@entry=0x7f015001cf40, flags=flags@entry=0) at /data/src/10.2/sql/lock.cc:351
      #8  0x000055a05a5e6cfa in mysql_lock_tables (thd=thd@entry=0x7f0150000c48, tables=0x7f015001cf30, count=count@entry=2, flags=flags@entry=0) at /data/src/10.2/sql/lock.cc:303
      #9  0x000055a05a2fda9a in lock_tables (thd=thd@entry=0x7f0150000c48, tables=0x7f0150016f80, count=<optimized out>, flags=flags@entry=0) at /data/src/10.2/sql/sql_base.cc:5108
      #10 0x000055a05a2ff25a in open_and_lock_tables (thd=thd@entry=0x7f0150000c48, options=..., tables=<optimized out>, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x7f01688e85f0) at /data/src/10.2/sql/sql_base.cc:4889
      #11 0x000055a05a34577b in open_and_lock_tables (flags=0, derived=true, tables=<optimized out>, thd=0x7f0150000c48) at /data/src/10.2/sql/sql_base.h:507
      #12 mysql_execute_command (thd=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:4301
      #13 0x000055a05a2cc2f9 in sp_instr_stmt::exec_core (this=0x7f0150017d68, thd=<optimized out>, nextp=0x7f01688e9b7c) at /data/src/10.2/sql/sp_head.cc:3332
      #14 0x000055a05a2d315e in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x7f0150017da8, thd=thd@entry=0x7f0150000c48, nextp=nextp@entry=0x7f01688e9b7c, open_tables=open_tables@entry=false, instr=instr@entry=0x7f0150017d68) at /data/src/10.2/sql/sp_head.cc:3095
      #15 0x000055a05a2d36a4 in sp_instr_stmt::execute (this=0x7f0150017d68, thd=0x7f0150000c48, nextp=0x7f01688e9b7c) at /data/src/10.2/sql/sp_head.cc:3248
      #16 0x000055a05a2cf0ac in sp_head::execute (this=0x7f01500163f0, thd=0x7f0150000c48, merge_da_on_success=<optimized out>) at /data/src/10.2/sql/sp_head.cc:1326
      #17 0x000055a05a2d0a2d in sp_head::execute_procedure (this=0x7f01500163f0, thd=thd@entry=0x7f0150000c48, args=0x7f01500053c8) at /data/src/10.2/sql/sp_head.cc:2202
      #18 0x000055a05a33bece in do_execute_sp (thd=0x7f0150000c48, sp=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:2981
      #19 0x000055a05a346113 in mysql_execute_command (thd=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:5635
      #20 0x000055a05a34c51b in mysql_parse (thd=thd@entry=0x7f0150000c48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f01688eb5b0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:7794
      #21 0x000055a05a34f72d in dispatch_command (command=COM_QUERY, thd=0x7f0150000c48, packet=<optimized out>, packet_length=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.2/sql/sql_class.h:1109
      #22 0x000055a05a350977 in do_command (thd=0x7f0150000c48) at /data/src/10.2/sql/sql_parse.cc:1381
      #23 0x000055a05a429986 in do_handle_one_connection (connect=connect@entry=0x55a05c2fd508) at /data/src/10.2/sql/sql_connect.cc:1336
      #24 0x000055a05a429aff in handle_one_connection (arg=arg@entry=0x55a05c2fd508) at /data/src/10.2/sql/sql_connect.cc:1241
      #25 0x000055a05a9c4e86 in pfs_spawn_thread (arg=0x55a05c2b1098) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #26 0x00007f016ed3a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #27 0x00007f016e92f293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
       
      Thread 7 (Thread 0x7f0168937700 (LWP 983195)):
      #0  futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x7f014c1757b0) at ../sysdeps/nptl/futex-internal.h:183
      #1  __pthread_cond_wait_common (abstime=0x0, clockid=0, mutex=0x7f014c175758, cond=0x7f014c175788) at pthread_cond_wait.c:508
      #2  __pthread_cond_wait (cond=cond@entry=0x7f014c175788, mutex=mutex@entry=0x7f014c175758) at pthread_cond_wait.c:638
      #3  0x000055a05a925863 in inline_mysql_cond_wait (src_file=0x55a05abdbb90 "/data/src/10.2/storage/maria/ma_bitmap.c", src_line=2673, mutex=0x7f014c175758, that=0x7f014c175788) at /data/src/10.2/include/mysql/psi/mysql_thread.h:1145
      #4  _ma_bitmap_flushable (info=info@entry=0x7f014c093b18, non_flushable_inc=non_flushable_inc@entry=1) at /data/src/10.2/storage/maria/ma_bitmap.c:2673
      #5  0x000055a05a91d217 in _ma_update_block_record2 (undo_lsn=1, record=0x7f014c09cce8 "\377\r", oldrec=<optimized out>, record_pos=266, info=0x7f014c093b18) at /data/src/10.2/storage/maria/ma_blockrec.c:3736
      #6  _ma_update_block_record (info=0x7f014c093b18, record_pos=266, orig_rec=0x7f014c09ccf0 "\377\r", new_rec=0x7f014c09cce8 "\377\r") at /data/src/10.2/storage/maria/ma_blockrec.c:4019
      #7  0x000055a05a9269ef in maria_update (info=<optimized out>, oldrec=0x7f014c09ccf0 "\377\r", newrec=<optimized out>) at /data/src/10.2/storage/maria/ma_update.c:159
      #8  0x000055a05a500704 in handler::ha_update_row (this=0x7f014c09b330, old_data=0x7f014c09ccf0 "\377\r", new_data=0x7f014c09cce8 "\377\r") at /data/src/10.2/sql/handler.cc:6150
      #9  0x000055a05a3267cd in write_record (thd=0x7f014c000c48, table=0x7f014c174228, info=info@entry=0x7f014c00fd90) at /data/src/10.2/sql/sql_insert.cc:1883
      #10 0x000055a05a326b93 in select_insert::send_data (values=..., this=0x7f014c00fd50) at /data/src/10.2/sql/sql_insert.cc:3832
      #11 select_insert::send_data (this=0x7f014c00fd50, values=...) at /data/src/10.2/sql/sql_insert.cc:3799
      #12 0x000055a05a3926c5 in end_send (join=0x7f014c00fdf8, join_tab=0x7f014c011260, end_of_records=<optimized out>) at /data/src/10.2/sql/sql_select.cc:20035
      #13 0x000055a05a37340f in evaluate_join_record (join=join@entry=0x7f014c00fdf8, join_tab=join_tab@entry=0x7f014c010eb0, error=<optimized out>) at /data/src/10.2/sql/sql_select.cc:19083
      #14 0x000055a05a37d1b5 in sub_select (end_of_records=false, join_tab=0x7f014c010eb0, join=0x7f014c00fdf8) at /data/src/10.2/sql/sql_select.cc:18902
      #15 sub_select (join=0x7f014c00fdf8, join_tab=0x7f014c010eb0, end_of_records=<optimized out>) at /data/src/10.2/sql/sql_select.cc:18798
      #16 0x000055a05a3a5dc7 in do_select (procedure=<optimized out>, join=0x7f014c00fdf8) at /data/src/10.2/sql/sql_select.cc:18407
      #17 JOIN::exec_inner (this=this@entry=0x7f014c00fdf8) at /data/src/10.2/sql/sql_select.cc:3642
      #18 0x000055a05a3a6067 in JOIN::exec (this=this@entry=0x7f014c00fdf8) at /data/src/10.2/sql/sql_select.cc:3437
      #19 0x000055a05a3a61aa in mysql_select (thd=0x7f014c000c48, tables=0x7f014c035eb8, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x7f014c00fd50, unit=0x7f014c0340a0, select_lex=0x7f014c0347e0) at /data/src/10.2/sql/sql_select.cc:3840
      #20 0x000055a05a3a6b47 in handle_select (thd=thd@entry=0x7f014c000c48, lex=lex@entry=0x7f014c033fe0, result=result@entry=0x7f014c00fd50, setup_tables_done_option=setup_tables_done_option@entry=1073741824) at /data/src/10.2/sql/sql_select.cc:361
      #21 0x000055a05a34b8b9 in mysql_execute_command (thd=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:4336
      #22 0x000055a05a3616a6 in Prepared_statement::execute (this=0x7f014c09c0c8, expanded_query=<optimized out>, open_cursor=false) at /data/src/10.2/sql/sql_prepare.cc:5053
      #23 0x000055a05a3618ad in Prepared_statement::execute_loop (packet=<optimized out>, packet_end=<optimized out>, open_cursor=<optimized out>, expanded_query=0x7f0168934d50, this=0x7f014c09c0c8) at /data/src/10.2/sql/sql_prepare.cc:4482
      #24 Prepared_statement::execute_loop (this=0x7f014c09c0c8, expanded_query=0x7f0168934d50, open_cursor=<optimized out>, packet=<optimized out>, packet_end=<optimized out>) at /data/src/10.2/sql/sql_prepare.cc:4428
      #25 0x000055a05a361f43 in Prepared_statement::execute_immediate (this=0x7f014c09c0c8, query=<optimized out>, query_len=<optimized out>) at /data/src/10.2/sql/sql_prepare.cc:5177
      #26 0x000055a05a3620f3 in mysql_sql_stmt_execute_immediate (thd=thd@entry=0x7f014c000c48) at /data/src/10.2/sql/sql_prepare.cc:3020
      #27 0x000055a05a3463eb in mysql_execute_command (thd=<optimized out>) at /data/src/10.2/sql/sql_parse.cc:3591
      #28 0x000055a05a34c51b in mysql_parse (thd=thd@entry=0x7f014c000c48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f01689365b0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/src/10.2/sql/sql_parse.cc:7794
      #29 0x000055a05a34f72d in dispatch_command (command=COM_QUERY, thd=0x7f014c000c48, packet=<optimized out>, packet_length=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.2/sql/sql_class.h:1109
      #30 0x000055a05a350977 in do_command (thd=0x7f014c000c48) at /data/src/10.2/sql/sql_parse.cc:1381
      #31 0x000055a05a429986 in do_handle_one_connection (connect=connect@entry=0x55a05c1e7128) at /data/src/10.2/sql/sql_connect.cc:1336
      #32 0x000055a05a429aff in handle_one_connection (arg=arg@entry=0x55a05c1e7128) at /data/src/10.2/sql/sql_connect.cc:1241
      #33 0x000055a05a9c4e86 in pfs_spawn_thread (arg=0x55a05c2b0968) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #34 0x00007f016ed3a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #35 0x00007f016e92f293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.4 12672542 debug, also happens on 10.5

      mysqld: /data/src/10.4/storage/maria/ma_write.c:415: maria_write: Assertion `save_errno' failed.
      210319 17:32:30 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f0277535f36 in __GI___assert_fail (assertion=0x55e2f25078f7 "save_errno", file=0x55e2f25077c0 "/data/src/10.4/storage/maria/ma_write.c", line=415, function=0x55e2f2507f98 <__PRETTY_FUNCTION__.18566> "maria_write") at assert.c:101
      #8  0x000055e2f1f567bf in maria_write (info=0x7f0254187100, record=0x7f0254186750 "\377\001") at /data/src/10.4/storage/maria/ma_write.c:415
      #9  0x000055e2f1ed13bd in ha_maria::write_row (this=0x7f0254181a98, buf=0x7f0254186750 "\377\001") at /data/src/10.4/storage/maria/ha_maria.cc:1252
      #10 0x000055e2f181ad2c in handler::ha_write_row (this=0x7f0254181a98, buf=0x7f0254186750 "\377\001") at /data/src/10.4/sql/handler.cc:6755
      #11 0x000055e2f14516c9 in write_record (thd=0x7f0254000d90, table=0x7f0254046290, info=0x7f02540152d0) at /data/src/10.4/sql/sql_insert.cc:1736
      #12 0x000055e2f14582a3 in select_insert::send_data (this=0x7f0254015288, values=...) at /data/src/10.4/sql/sql_insert.cc:3956
      #13 0x000055e2f151fdc3 in end_send (join=0x7f0254015338, join_tab=0x7f0254016848, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:21689
      #14 0x000055e2f151d38c in evaluate_join_record (join=0x7f0254015338, join_tab=0x7f02540164a0, error=0) at /data/src/10.4/sql/sql_select.cc:20720
      #15 0x000055e2f151cc68 in sub_select (join=0x7f0254015338, join_tab=0x7f02540164a0, end_of_records=false) at /data/src/10.4/sql/sql_select.cc:20500
      #16 0x000055e2f151c12e in do_select (join=0x7f0254015338, procedure=0x0) at /data/src/10.4/sql/sql_select.cc:20038
      #17 0x000055e2f14f0ce1 in JOIN::exec_inner (this=0x7f0254015338) at /data/src/10.4/sql/sql_select.cc:4487
      #18 0x000055e2f14efe10 in JOIN::exec (this=0x7f0254015338) at /data/src/10.4/sql/sql_select.cc:4269
      #19 0x000055e2f14f157c in mysql_select (thd=0x7f0254000d90, tables=0x7f02540c8098, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489925888, result=0x7f0254015288, unit=0x7f02540c5828, select_lex=0x7f02540c7aa0) at /data/src/10.4/sql/sql_select.cc:4707
      #20 0x000055e2f14e0ee3 in handle_select (thd=0x7f0254000d90, lex=0x7f02540c5768, result=0x7f0254015288, setup_tables_done_option=1073741824) at /data/src/10.4/sql/sql_select.cc:410
      #21 0x000055e2f149ef91 in mysql_execute_command (thd=0x7f0254000d90) at /data/src/10.4/sql/sql_parse.cc:4711
      #22 0x000055e2f14cadc4 in Prepared_statement::execute (this=0x7f025418ebb0, expanded_query=0x7f02714baa00, open_cursor=false) at /data/src/10.4/sql/sql_prepare.cc:4996
      #23 0x000055e2f14c90cf in Prepared_statement::execute_loop (this=0x7f025418ebb0, expanded_query=0x7f02714baa00, open_cursor=false, packet=0x0, packet_end=0x0) at /data/src/10.4/sql/sql_prepare.cc:4465
      #24 0x000055e2f14cb3c0 in Prepared_statement::execute_immediate (this=0x7f025418ebb0, query=0x7f0254014970 "REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20", query_len=50) at /data/src/10.4/sql/sql_prepare.cc:5120
      #25 0x000055e2f14c5500 in mysql_sql_stmt_execute_immediate (thd=0x7f0254000d90) at /data/src/10.4/sql/sql_prepare.cc:3006
      #26 0x000055e2f149c6de in mysql_execute_command (thd=0x7f0254000d90) at /data/src/10.4/sql/sql_parse.cc:3968
      #27 0x000055e2f14a9fb5 in mysql_parse (thd=0x7f0254000d90, rawbuf=0x7f0254014888 "EXECUTE IMMEDIATE 'REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20'", length=70, parser_state=0x7f02714bb550, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7989
      #28 0x000055e2f1496211 in dispatch_command (command=COM_QUERY, thd=0x7f0254000d90, packet=0x7f025400ace1 "EXECUTE IMMEDIATE 'REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20'", packet_length=70, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1855
      #29 0x000055e2f1494a79 in do_command (thd=0x7f0254000d90) at /data/src/10.4/sql/sql_parse.cc:1373
      #30 0x000055e2f16246c9 in do_handle_one_connection (connect=0x55e2f4bd1190) at /data/src/10.4/sql/sql_connect.cc:1412
      #31 0x000055e2f1624412 in handle_one_connection (arg=0x55e2f4bd1190) at /data/src/10.4/sql/sql_connect.cc:1316
      #32 0x000055e2f204b41e in pfs_spawn_thread (arg=0x55e2f4b26800) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #33 0x00007f0277db6609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #34 0x00007f0277621293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.4 12672542 non-debug, also happens on 10.5

      'EXECUTE IMMEDIATE 'REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20'' failed: 1032: Can't find record in 't'
      

      Same test case, but with MyISAM

      Test case 2: MyISAM

      --source include/have_log_bin.inc
      --source include/have_sequence.inc
       
      CREATE TABLE t (pk INT PRIMARY KEY) ENGINE=MyISAM;
      CREATE VIEW v AS SELECT * FROM t;
       
      --connect (con1,localhost,root,,test)
      --connection con1
      --let $conid= `select connection_id()`
      --delimiter $
      --send
        LOOP REPLACE v SELECT seq FROM seq_1_to_20; END LOOP $
      --delimiter ;
       
      --connection default
      --let $run= 100
      while ($run)
      {
        EXECUTE IMMEDIATE 'REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20';
        --dec $run
      }
       
      # Cleanup
      --eval KILL $conid
      DROP VIEW v;
      DROP TABLE t;
      

      10.2 4ca4d606, also on 10.3

      EXECUTE IMMEDIATE 'REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20'' failed: 1062: Duplicate entry '1' for key 'PRIMARY'
      

      10.5 190a8312, also on 10.4

      EXECUTE IMMEDIATE 'REPLACE DELAYED INTO v SELECT seq FROM seq_1_to_20'' failed: 126: Index for table './test/t.MYI' is corrupt; try to repair it
      

      Attachments

        Activity

          People

            shulga Dmitry Shulga
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.