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

Assertion `!return_error || thd->is_error() || thd->killed' failed in mysql_delete

    XMLWordPrintable

Details

    Description

      I don't know what role RocksDB plays here. It apparently has its own understanding of locking and lock timeouts, or why else the DELETE ends with a deadlock almost immediately. So maybe it's just a trigger of an otherwise unrelated problem. Same goes for backup stages.

      The test case is non-deterministic, run with big enough repeat=N. It usually fails for me within 10-15 attempts, but it can vary on different machines and builds. Run with --mysqld=--plugin-load-add=ha_rocksdb, for --repeat it is faster than doing INSTALL inside the test.

      CREATE TABLE t (a INT, b INT, KEY(b), KEY(a)) ENGINE=RocksDB;
      INSERT  INTO t VALUES (1,2),(3,4),(5,6),(7,8),(9,10);
       
      --connect (con1,localhost,root,,test)
      BACKUP STAGE START;
      BACKUP STAGE BLOCK_COMMIT;
      BACKUP STAGE END;
      START TRANSACTION;
      UPDATE t SET a = 2;
       
      --connection default
      --error 0,ER_LOCK_WAIT_TIMEOUT
      DELETE FROM t WHERE b > 4 OR a > 2;
       
      # Cleanup
      --connection con1
      ROLLBACK;
      --disconnect con1
      --connection default
      DROP TABLE t;
      

      10.4 8911823f

      mysqld: /data/src/10.4/sql/sql_delete.cc:984: bool mysql_delete(THD*, TABLE_LIST*, COND*, SQL_I_List<st_order>*, ha_rows, ulonglong, select_result*): Assertion `!return_error || thd->is_error() || thd->killed' failed.
      220719  1:30:32 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fe3b869d662 in __GI___assert_fail (assertion=0x562d2aa13510 "!return_error || thd->is_error() || thd->killed", file=0x562d2aa13288 "/data/src/10.4/sql/sql_delete.cc", line=984, function=0x562d2aa13358 "bool mysql_delete(THD*, TABLE_LIST*, COND*, SQL_I_List<st_order>*, ha_rows, ulonglong, select_result*)") at assert.c:101
      No locals.
      #8  0x0000562d2a0452a1 in mysql_delete (thd=0x7fe37c000d90, table_list=0x7fe37c014898, conds=0x7fe37c015738, order_list=0x7fe37c005760, limit=18446744073709551615, options=0, result=0x0) at /data/src/10.4/sql/sql_delete.cc:984
              will_batch = false
              error = 0
              loc_error = 32739
              table = 0x7fe370027c20
              select = 0x7fe37c015a18
              file_sort = 0x0
              info = {table = 0x0, unlock_row = 0x17c000cb0, read_record_func = 0x7fe3b0344580, thd = 0x562d2a75dc79 <_db_return_+209>, select = 0x7fe3b0344370, ref_length = 2956215728, reclength = 32739, rec_cache_size = 6, error_offset = 0, ref_pos = 0x7fe37c000cd0 "\206@T\025\375\177", rec_buf = 0x7fe3b0344390 "\320C4\260\343\177", cache = 0x0, cache_pos = 0x7fe3b0344550 "\320\f", cache_end = 0x7fe37c042e90 "\340\265\031|\343\177", read_positions = 0x7fe3b03443d0 "\360C4\260\343\177", addon_field = 0xb311b053, io_cache = 0x562d2a83611b, print_error = false, unpack = 0x7fe3b03443d0, copy_field = 0x100002a7373bc, copy_field_end = 0x7fe3b03443f0}
              using_limit = false
              transactional_table = 176
              safe_update = false
              const_cond = false
              const_cond_result = false
              return_error = true
              deleted = 0
              reverse = false
              has_triggers = false
              order = 0x0
              select_lex = 0x7fe37c0054c8
              killed_status = NOT_KILLED
              query_type = THD::ROW_QUERY_TYPE
              binlog_is_row = false
              with_select = false
              explain = 0x7fe37c015d88
              query_plan = {<Update_plan> = {_vptr.Update_plan = 0x562d2b0a0170 <vtable for Delete_plan+16>, impossible_where = false, no_partitions = false, updating_a_view = false, mem_root = 0x7fe37c006768, table = 0x7fe370027c20, select = 0x7fe37c015a18, index = 64, scanned_rows = 7, select_lex = 0x7fe37c0054c8, possible_keys = {buffer = {3}}, using_filesort = false, using_io_buffer = false}, deleting_all_rows = false}
              deltempfile = 0x0
              delete_record = false
              delete_while_scanning = true
              portion_of_time_through_update = 52
              _db_stack_frame_ = {func = 0x562d2a82f930 "mysql_execute_command", file = 0x562d2a82ecc8 "/data/src/10.4/sql/sql_parse.cc", level = 2147483653, line = -1, prev = 0x7fe3b0344c80}
              delete_history = false
              __PRETTY_FUNCTION__ = "bool mysql_delete(THD*, TABLE_LIST*, COND*, SQL_I_List<st_order>*, ha_rows, ulonglong, select_result*)"
      #9  0x0000562d29b3f58e in mysql_execute_command (thd=0x7fe37c000d90) at /data/src/10.4/sql/sql_parse.cc:4797
              sel_result = 0x0
              save_protocol = 0x562d2a73ded6 <safe_mutex_unlock+543>
              replaced_protocol = false
              res = 0
              up_result = 0
              lex = 0x7fe37c004c00
              select_lex = 0x7fe37c0054c8
              first_table = 0x7fe37c014898
              all_tables = 0x7fe37c014898
              unit = 0x7fe37c004cc0
              have_table_map_for_update = false
              rpl_filter = 0x562d29f9907d <inline_mysql_mutex_unlock(mysql_mutex_t*, char const*, uint)+107>
              _db_stack_frame_ = {func = 0x562d2a830bb8 "mysql_parse", file = 0x562d2a82ecc8 "/data/src/10.4/sql/sql_parse.cc", level = 2147483652, line = -1, prev = 0x7fe3b0345250}
              __PRETTY_FUNCTION__ = "int mysql_execute_command(THD*)"
              ots = {ctx = 0x7fe37c0048e0, traceable = false}
              trace_command = {<Json_writer_struct> = {_vptr.Json_writer_struct = 0x562d2afa8510 <vtable for Json_writer_object+16>, my_writer = 0x0, context = {writer = 0x0}, closed = false}, <No data fields>}
              trace_command_steps = {<Json_writer_struct> = {_vptr.Json_writer_struct = 0x562d2afa84f0 <vtable for Json_writer_array+16>, my_writer = 0x0, context = {writer = 0x0}, closed = false}, <No data fields>}
              orig_binlog_format = BINLOG_FORMAT_MIXED
              orig_current_stmt_binlog_format = BINLOG_FORMAT_STMT
      #10 0x0000562d29b49efa in mysql_parse (thd=0x7fe37c000d90, rawbuf=0x7fe37c0147a8 "DELETE FROM t WHERE b > 4 OR a > 2", length=34, parser_state=0x7fe3b0345410, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7995
              found_semicolon = 0x0
              error = 32739
              lex = 0x7fe37c004c00
              err = false
              _db_stack_frame_ = {func = 0x562d2a82f13a "dispatch_command", file = 0x562d2a82ecc8 "/data/src/10.4/sql/sql_parse.cc", level = 2147483651, line = -1, prev = 0x7fe3b03453f0}
              __PRETTY_FUNCTION__ = "void mysql_parse(THD*, char*, uint, Parser_state*, bool, bool)"
      #11 0x0000562d29b3639a in dispatch_command (command=COM_QUERY, thd=0x7fe37c000d90, packet=0x7fe37c00ac01 "DELETE FROM t WHERE b > 4 OR a > 2", packet_length=34, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
              packet_end = 0x7fe37c0147ca ""
              parser_state = {m_lip = {lookahead_token = -1, lookahead_yylval = 0x0, m_thd = 0x7fe37c000d90, m_ptr = 0x7fe37c0147cb "\004", m_tok_start = 0x7fe37c0147cb "\004", m_tok_end = 0x7fe37c0147cb "\004", m_end_of_query = 0x7fe37c0147ca "", m_tok_start_prev = 0x7fe37c0147ca "", m_buf = 0x7fe37c0147a8 "DELETE FROM t WHERE b > 4 OR a > 2", m_buf_length = 34, m_echo = true, m_echo_saved = 12, m_cpp_buf = 0x7fe37c014828 "DELETE FROM t WHERE b > 4 OR a > 2", m_cpp_ptr = 0x7fe37c01484a "", m_cpp_tok_start = 0x7fe37c01484a "", m_cpp_tok_start_prev = 0x7fe37c01484a "", m_cpp_tok_end = 0x7fe37c01484a "", m_body_utf8 = 0x0, m_body_utf8_ptr = 0x562d2a75ea07 <DoTrace+150> "\203\370\005\177\063\205\300\017\210\255", m_cpp_utf8_processed_ptr = 0x0, next_state = MY_LEX_END, found_semicolon = 0x0, ignore_space = false, stmt_prepare_mode = false, multi_statements = true, yylineno = 1, m_digest = 0x0, in_comment = NO_COMMENT, in_comment_saved = (PRESERVE_COMMENT | unknown: 0x562c), m_cpp_text_start = 0x7fe37c014849 "2", m_cpp_text_end = 0x7fe37c01484a "", m_underscore_cs = 0x0}, m_yacc = {yacc_yyss = 0x0, yacc_yyvs = 0x0, m_set_signal_info = {m_item = {0x0 <repeats 12 times>}}, m_lock_type = TL_READ_DEFAULT, m_mdl_type = MDL_SHARED_READ}, m_digest_psi = 0x7fe37c0046e0}
              net = 0x7fe37c0010b8
              error = false
              do_end_of_statement = true
              _db_stack_frame_ = {func = 0x562d2a82eec5 "do_command", file = 0x562d2a82ecc8 "/data/src/10.4/sql/sql_parse.cc", level = 2147483650, line = -1, prev = 0x7fe3b0345cb0}
              drop_more_results = false
              __PRETTY_FUNCTION__ = "bool dispatch_command(enum_server_command, THD*, char*, uint, bool, bool)"
              __FUNCTION__ = "dispatch_command"
              res = <optimized out>
      #12 0x0000562d29b34c4d in do_command (thd=0x7fe37c000d90) at /data/src/10.4/sql/sql_parse.cc:1378
              return_value = false
              packet = 0x7fe37c00ac00 "\003DELETE FROM t WHERE b > 4 OR a > 2"
              packet_length = 35
              net = 0x7fe37c0010b8
              command = COM_QUERY
              _db_stack_frame_ = {func = 0x562d2abea368 "?func", file = 0x562d2abea36e "?file", level = 2147483649, line = -1, prev = 0x0}
              __PRETTY_FUNCTION__ = "bool do_command(THD*)"
              __FUNCTION__ = "do_command"
      #13 0x0000562d29cc3fbd in do_handle_one_connection (connect=0x562d2dc20450) at /data/src/10.4/sql/sql_connect.cc:1420
              create_user = true
              thr_create_utime = 4605542556939
              thd = 0x7fe37c000d90
              __PRETTY_FUNCTION__ = "void do_handle_one_connection(CONNECT*)"
      #14 0x0000562d29cc3c65 in handle_one_connection (arg=0x562d2dc20450) at /data/src/10.4/sql/sql_connect.cc:1316
              connect = 0x562d2dc20450
      #15 0x0000562d2a1e0f9d in pfs_spawn_thread (arg=0x562d2daf4d00) at /data/src/10.4/storage/perfschema/pfs.cc:1869
              typed_arg = 0x562d2daf4d00
              user_arg = 0x562d2dc20450
              user_start_routine = 0x562d29cc3c35 <handle_one_connection(void*)>
              pfs = 0x7fe3b6996a00
              klass = 0x562d2d789c00
      #16 0x00007fe3b8b69ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
              ret = <optimized out>
              pd = <optimized out>
              unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140615890528000, 3185263565158680890, 140724961285550, 140724961285551, 140615890525824, 311296, -3174135868541171398, -3174152376330417862}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
              not_first_call = 0
      #17 0x00007fe3b8766def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            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.