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

RocksDB GTT: table creation succeeds, INSERT fails with ER_ILLEGAL_HA_CREATE_OPTION, TRUNCATE asserts

    XMLWordPrintable

Details

    • Can result in hang or crash

    Description

      INSTALL SONAME 'ha_rocksdb';
      CREATE GLOBAL TEMPORARY TABLE t (c INT) ENGINE=RocksDB ON COMMIT DELETE ROWS;
      LOCK TABLES t WRITE;
      INSERT t VALUES (0);
      TRUNCATE t;
      

      Leads to:

      MDEV-35915 CS 12.2.0 228260ead7d9343e81a6d73bc0eb7ec96718d917 (Debug, Clang 21.1.3-20250923) Build 27/12/2025

      12.2.0-opt>INSERT t VALUES (0);
      ERROR 1478 (HY000): Table storage engine 'ROCKSDB' does not support the create option 'TEMPORARY'
      12.2.0-dbg>TRUNCATE t;
      ERROR 2026 (HY000): TLS/SSL error: The TLS connection was non-properly terminated.
      

      MDEV-35915 CS 12.2.0 228260ead7d9343e81a6d73bc0eb7ec96718d917 (Debug, Clang 21.1.3-20250923) Build 27/12/2025

      mariadbd: /test/bb-12.2-nikita-global-tmp_dbg/sql/table_cache.cc:986: void tdc_release_share(TABLE_SHARE *): Assertion `share->tdc->ref_count' failed.
      

      MDEV-35915 CS 12.2.0 228260ead7d9343e81a6d73bc0eb7ec96718d917 (Debug, Clang 21.1.3-20250923) Build 27/12/2025

      Core was generated by `/test/MDEV-35915_v9_MD271225-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd --no-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3799692)]
      (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  0x0000718d0484526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000718d048288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000718d0482881b in __assert_fail_base (fmt=0x718d049d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x562b3e36e45b "share->tdc->ref_count", file=file@entry=0x562b3e2d2480 "/test/bb-12.2-nikita-global-tmp_dbg/sql/table_cache.cc", line=line@entry=986, function=function@entry=0x562b3e299d22 "void tdc_release_share(TABLE_SHARE *)") at ./assert/assert.c:94
      #6  0x0000718d0483b507 in __assert_fail (assertion=0x562b3e36e45b "share->tdc->ref_count", file=0x562b3e2d2480 "/test/bb-12.2-nikita-global-tmp_dbg/sql/table_cache.cc", line=986, function=0x562b3e299d22 "void tdc_release_share(TABLE_SHARE *)")at ./assert/assert.c:103
      #7  0x0000562b3f28daa5 in tdc_release_share (share=0x718bb02a7ae0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/table_cache.cc:986
      #8  0x0000562b3f28bb23 in intern_close_table (table=0x718bb02aa2e8)at /test/bb-12.2-nikita-global-tmp_dbg/sql/table_cache.cc:231
      #9  0x0000562b3f28bf49 in tc_remove_table (table=0x718bb02aa2e8)at /test/bb-12.2-nikita-global-tmp_dbg/sql/table_cache.cc:268
      #10 0x0000562b3f28c42f in tc_release_table (table=0x718bb02aa2e8)at /test/bb-12.2-nikita-global-tmp_dbg/sql/table_cache.cc:461
      #11 0x0000562b3edee6af in close_thread_table (thd=0x718bb0000d58, table_ptr=0x718bb0000ed0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:1088
      #12 0x0000562b3eded51d in close_all_tables_for_name (thd=0x718bb0000d58, share=0x718bb02a7ae0, extra=HA_EXTRA_NOT_USED, skip_table=0x0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:794
      #13 0x0000562b3f18e7a0 in Sql_cmd_truncate_table::lock_table (this=0x718bb001a670, thd=0x718bb0000d58, table_ref=0x718bb0019f38, hton_can_recreate=0x718d007301cf, global_tmp_table=0x718d0073019f)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_truncate.cc:428
      #14 0x0000562b3f18ec36 in Sql_cmd_truncate_table::truncate_table (this=0x718bb001a670, thd=0x718bb0000d58, table_ref=0x718bb0019f38)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_truncate.cc:516
      #15 0x0000562b3f18efa7 in Sql_cmd_truncate_table::execute (this=0x718bb001a670, thd=0x718bb0000d58)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_truncate.cc:620
      #16 0x0000562b3ef5999f in mysql_execute_command (thd=0x718bb0000d58, is_called_from_prepared_stmt=false)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:5878
      #17 0x0000562b3ef4ac18 in mysql_parse (thd=0x718bb0000d58, rawbuf=0x718bb0019e80 "TRUNCATE t", length=10, parser_state=0x718d00731a10)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:7911
      #18 0x0000562b3ef483f9 in dispatch_command (command=COM_QUERY, thd=0x718bb0000d58, packet=0x718bb000b1f9 "TRUNCATE t", packet_length=10, blocking=true) at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:1898
      #19 0x0000562b3ef4b69a in do_command (thd=0x718bb0000d58, blocking=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:1437
      #20 0x0000562b3f13e04e in do_handle_one_connection (connect=0x562b42e00298, put_in_cache=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_connect.cc:1414
      #21 0x0000562b3f13de31 in handle_one_connection (arg=0x562b42e88648)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_connect.cc:1326
      #22 0x0000718d0489ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #23 0x0000718d04929c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      And alike to MDEV-38442 there is slightly different stack on UBASAN builds:

      MDEV-35915 CS 12.2.0 228260ead7d9343e81a6d73bc0eb7ec96718d917 (Debug, UBASAN, Clang 21.1.3-20250923) Build 27/12/2025

      mariadbd: /test/bb-12.2-nikita-global-tmp_dbg_san/sql/table_cache.cc:986: void tdc_release_share(TABLE_SHARE *): Assertion `share->tdc->ref_count' failed.
      

      MDEV-35915 CS 12.2.0 228260ead7d9343e81a6d73bc0eb7ec96718d917 (Debug, UBASAN, Clang 21.1.3-20250923) Build 27/12/2025

      Core was generated by `/test/MDEV-35915_v9_UBASAN_MD271225-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadb'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 3840763)]
      (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=6)at ./nptl/pthread_kill.c:89
      #3  0x000059ccf379fdc0 in handle_fatal_signal (sig=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/signal_handler.cc:298
      #4  <signal handler called>
      #5  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #6  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #7  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #8  0x000072022844526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #9  0x00007202284288ff in __GI_abort () at ./stdlib/abort.c:79
      #10 0x000072022842881b in __assert_fail_base (fmt=0x7202285d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x59ccf2556ec0 <str> "share->tdc->ref_count", file=file@entry=0x59ccf25560a0 "/test/bb-12.2-nikita-global-tmp_dbg_san/sql/table_cache.cc", line=line@entry=986, function=function@entry=0x59ccf2556f00 <__PRETTY_FUNCTION__._Z17tdc_release_shareP11TABLE_SHARE> "void tdc_release_share(TABLE_SHARE *)")at ./assert/assert.c:94
      #11 0x000072022843b507 in __assert_fail (assertion=0x59ccf2556ec0 <str> "share->tdc->ref_count", file=0x59ccf25560a0 "/test/bb-12.2-nikita-global-tmp_dbg_san/sql/table_cache.cc", line=986, function=0x59ccf2556f00 <__PRETTY_FUNCTION__._Z17tdc_release_shareP11TABLE_SHARE> "void tdc_release_share(TABLE_SHARE *)") at ./assert/assert.c:103
      #12 0x000059ccf4c6ac42 in tdc_release_share (share=0x705227521938)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/table_cache.cc:986
      #13 0x000059ccf4c631ab in intern_close_table (table=0x6f92274bd898)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/table_cache.cc:231
      #14 0x000059ccf3af6240 in close_all_tables_for_name (thd=<optimized out>, share=<optimized out>, extra=HA_EXTRA_NOT_USED, skip_table=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_base.cc:794
      #15 0x000059ccf48c8e06 in Sql_cmd_truncate_table::lock_table (this=this@entry=0x6e01393c3270, thd=0x70b227585218, table_ref=table_ref@entry=0x70d227592520, hton_can_recreate=hton_can_recreate@entry=0x6e01393c3220, global_tmp_table=global_tmp_table@entry=0x6e01393c3270)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_truncate.cc:428
      #16 0x000059ccf48ca7dd in Sql_cmd_truncate_table::truncate_table (this=<optimized out>, thd=<optimized out>, table_ref=0x70d227592520)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_truncate.cc:516
      #17 0x000059ccf48cbc9d in Sql_cmd_truncate_table::execute (this=0x70d227592c60, thd=0x70b227585218)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_truncate.cc:620
      #18 0x000059ccf401387e in mysql_execute_command (thd=0x70b227585218, is_called_from_prepared_stmt=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:5878
      #19 0x000059ccf3ff69a9 in mysql_parse (thd=thd@entry=0x70b227585218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x6e013993f7c0)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:7911
      #20 0x000059ccf3ff0162 in dispatch_command (command=<optimized out>, thd=0x70b227585218, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:1898
      #21 0x000059ccf3ff8ddb in do_command (thd=thd@entry=0x70b227585218, blocking=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_parse.cc:1437
      #22 0x000059ccf47fd3dd in do_handle_one_connection (connect=<optimized out>, connect@entry=0x6e8227425638, put_in_cache=<optimized out>)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_connect.cc:1414
      #23 0x000059ccf47fcee6 in handle_one_connection (arg=0x6e8227425638)at /test/bb-12.2-nikita-global-tmp_dbg_san/sql/sql_connect.cc:1326
      #24 0x000059ccf2fb5a8b in asan_thread_start(void*) ()
      #25 0x000072022849ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #26 0x0000720228529c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              Roel Roel Van de Paar
              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.