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

Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)' failed

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6
    • 10.6
    • Locking
    • None
    • Can result in hang or crash

    Description

      CREATE TABLE t (s INT);
      LOCK TABLE t WRITE;
      ALTER TABLE t DISCARD TABLESPACE;
      

      Leads to:

      CS 10.6.24 8dae7150b28a568491385d8166ed92944e0cc7ed (Debug, Clang) Build 21/08/2025

      mariadbd: /test/10.6_dbg/sql/table_cache.cc:1282: void TDC_element::flush(THD *, bool): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)' failed.
      

      CS 10.6.24 8dae7150b28a568491385d8166ed92944e0cc7ed (Debug, Clang) Build 21/08/2025

      Core was generated by `/test/MD210825-mariadb-10.6.24-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
      Program terminated with signal SIGABRT, Aborted.
      Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3234272)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000079a38f84527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000079a38f8288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000079a38f82881b in __assert_fail_base (fmt=0x79a38f9d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55b06a5d3dfd "thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)", file=file@entry=0x55b06a5d3be0 "/test/10.6_dbg/sql/table_cache.cc", line=line@entry=1282, function=function@entry=0x55b06a5d3f3b "void TDC_element::flush(THD *, bool)") at ./assert/assert.c:96
      #6  0x000079a38f83b517 in __assert_fail (assertion=0x55b06a5d3dfd "thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)", file=0x55b06a5d3be0 "/test/10.6_dbg/sql/table_cache.cc", line=1282, function=0x55b06a5d3f3b "void TDC_element::flush(THD *, bool)")at ./assert/assert.c:105
      #7  0x000055b0698c8c96 in TDC_element::flush (this=0x79a2a401f4b8, thd=0x79a2a4000d58, mark_flushed=true)at /test/10.6_dbg/sql/table_cache.cc:1280
      #8  0x000055b069709e6f in mysql_discard_or_import_tablespace (thd=0x79a2a4000d58, table_list=0x79a2a4013450, discard=true)at /test/10.6_dbg/sql/sql_table.cc:5778
      #9  0x000055b0697c90b5 in Sql_cmd_discard_import_tablespace::execute (this=0x79a2a4013b58, thd=0x79a2a4000d58)at /test/10.6_dbg/sql/sql_alter.cc:713
      #10 0x000055b06961306b in mysql_execute_command (thd=0x79a2a4000d58, is_called_from_prepared_stmt=false) at /test/10.6_dbg/sql/sql_parse.cc:6167
      #11 0x000055b069600e64 in mysql_parse (thd=0x79a2a4000d58, rawbuf=0x79a2a4013360 "ALTER TABLE t DISCARD TABLESPACE", length=32, parser_state=0x79a368abaa48) at /test/10.6_dbg/sql/sql_parse.cc:8200
      #12 0x000055b0695fe324 in dispatch_command (command=COM_QUERY, thd=0x79a2a4000d58, packet=0x79a2a400ade9 "ALTER TABLE t DISCARD TABLESPACE", packet_length=32, blocking=true) at /test/10.6_dbg/sql/sql_parse.cc:1908
      #13 0x000055b069601a13 in do_command (thd=0x79a2a4000d58, blocking=true)at /test/10.6_dbg/sql/sql_parse.cc:1421
      #14 0x000055b0697be559 in do_handle_one_connection (connect=0x55b089269348, put_in_cache=true) at /test/10.6_dbg/sql/sql_connect.cc:1386
      #15 0x000055b0697be2f2 in handle_one_connection (arg=0x55b0893230f8)at /test/10.6_dbg/sql/sql_connect.cc:1298
      #16 0x000079a38f89caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #17 0x000079a38f929c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed
      CS  10.6   dbg  210825  8dae7150b28a568491385d8166ed92944e0cc7ed  thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)|SIGABRT|TDC_element::flush|mysql_discard_or_import_tablespace|Sql_cmd_discard_import_tablespace::execute|mysql_execute_command
      CS  10.6   opt  210825  8dae7150b28a568491385d8166ed92944e0cc7ed  No bug found
      CS  10.11  dbg  080825  d66a74acb84109ca960680f02cd8113012f2f1de  No bug found
      CS  10.11  opt  080825  d66a74acb84109ca960680f02cd8113012f2f1de  No bug found
      CS  11.4   dbg  080825  03b31c0bd99390c1984f19a19f22dd6e77b7692e  No bug found
      CS  11.4   opt  080825  03b31c0bd99390c1984f19a19f22dd6e77b7692e  No bug found
      CS  11.8   dbg  080825  1a446ccc48528e88a3cd6cd1d1ec9e7492d342ca  No bug found
      CS  11.8   opt  080825  1a446ccc48528e88a3cd6cd1d1ec9e7492d342ca  No bug found
      CS  12.0   dbg  080825  aab83aecdca15738d114cf5a2f223f1d12e4e6bd  No bug found
      CS  12.0   opt  080825  aab83aecdca15738d114cf5a2f223f1d12e4e6bd  No bug found
      CS  12.1   dbg  080825  033471a367b4c60b7262e64f43f46b02e95b9d74  No bug found
      CS  12.1   opt  080825  033471a367b4c60b7262e64f43f46b02e95b9d74  No bug found
      CS  12.2   dbg  080825  e02f4d7e311e214ea62ff2e59599849e229f4165  No bug found
      CS  12.2   opt  080825  e02f4d7e311e214ea62ff2e59599849e229f4165  No bug found
      ES  10.5   dbg  080825  70586522eacf09d04d49962072e14325a75d8155  thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)|SIGABRT|TDC_element::flush|mysql_discard_or_import_tablespace|Sql_cmd_discard_import_tablespace::execute|mysql_execute_command
      ES  10.5   opt  080825  70586522eacf09d04d49962072e14325a75d8155  No bug found
      ES  10.6   dbg  080825  9b794f34b48fb7eee490b6da44edc0f33a947447  thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)|SIGABRT|TDC_element::flush|mysql_discard_or_import_tablespace|Sql_cmd_discard_import_tablespace::execute|mysql_execute_command
      ES  10.6   opt  080825  9b794f34b48fb7eee490b6da44edc0f33a947447  No bug found
      ES  11.4   dbg  080825  a1c03ccd54b582e75506687ee19b273ca897f261  thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)|SIGABRT|TDC_element::flush|mysql_discard_or_import_tablespace|Sql_cmd_discard_import_tablespace::execute|mysql_execute_command
      ES  11.4   opt  080825  a1c03ccd54b582e75506687ee19b273ca897f261  No bug found
      ES  11.8   dbg  080825  4cdf75ab6ba37d4e7e208690785e880ed3176f2f  thd->mdl_context.is_lock_owner(MDL_key::TABLE, share->db.str, share->table_name.str, MDL_EXCLUSIVE)|SIGABRT|TDC_element::flush|mysql_discard_or_import_tablespace|Sql_cmd_discard_import_tablespace::execute|mysql_execute_command
      ES  11.8   opt  080825  4cdf75ab6ba37d4e7e208690785e880ed3176f2f  MARIADBD_ERROR|mariadbd: caching_sha2_password: cannot auto-generate keys with WolfSSL
      

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              saahil Saahil Alam
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.