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

Assertion failures in tdc_remove_table upon interrupted CREATE TABLE LIKE <sequence>

Details

    Description

      Note: The failure currently happens for me every time, but the test case is still non-deterministic, run with --repeat=N if it doesn't fail right away.

      --connect (con1,localhost,root,,test)
      --let $kill_id= `SELECT CONNECTION_ID()`
       
      CREATE SEQUENCE s;
      --send
        CREATE TABLE t LIKE s;
       
      --connection default
      SELECT 1 FROM mysql.user LIMIT 0;
      eval KILL $kill_id;
       
      --source include/restart_mysqld.inc
       
      # Cleanup
      DROP TABLE t;
      DROP SEQUENCE s;
      

      10.3 396da1a7

      mysqld: /data/src/10.3/sql/table_cache.cc:1102: bool tdc_remove_table(THD*, enum_tdc_remove_table_type, const char*, const char*, bool): Assertion `remove_type == TDC_RT_REMOVE_UNUSED || thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)' failed.
      190902 18:36:53 [ERROR] mysqld got signal 6 ;
       
      #6  0x00007f8fd4a2ee67 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55a4f45399b8 "remove_type == TDC_RT_REMOVE_UNUSED || thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=file@entry=0x55a4f4539328 "/data/src/10.3/sql/table_cache.cc", line=line@entry=1102, function=function@entry=0x55a4f4539dc0 <tdc_remove_table(THD*, enum_tdc_remove_table_type, char const*, char const*, bool)::__PRETTY_FUNCTION__> "bool tdc_remove_table(THD*, enum_tdc_remove_table_type, const char*, const char*, bool)") at assert.c:92
      #7  0x00007f8fd4a2ef12 in __GI___assert_fail (assertion=0x55a4f45399b8 "remove_type == TDC_RT_REMOVE_UNUSED || thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x55a4f4539328 "/data/src/10.3/sql/table_cache.cc", line=1102, function=0x55a4f4539dc0 <tdc_remove_table(THD*, enum_tdc_remove_table_type, char const*, char const*, bool)::__PRETTY_FUNCTION__> "bool tdc_remove_table(THD*, enum_tdc_remove_table_type, const char*, const char*, bool)") at assert.c:101
      #8  0x000055a4f3a7fd9b in tdc_remove_table (thd=0x7f8fb8000b00, remove_type=TDC_RT_REMOVE_ALL, db=0x7f8fb8012228 "test", table_name=0x7f8fb8011ba0 "s", kill_delayed_threads=false) at /data/src/10.3/sql/table_cache.cc:1100
      #9  0x000055a4f390d7f1 in mysql_rm_table_no_locks (thd=0x7f8fb8000b00, tables=0x7f8fb8011548, if_exists=true, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=true, dont_free_locks=true) at /data/src/10.3/sql/sql_table.cc:2477
      #10 0x000055a4f3915934 in mysql_create_table_no_lock (thd=0x7f8fb8000b00, db=0x7f8fb8011560, table_name=0x7f8fb8011570, create_info=0x7f8fcabb1580, alter_info=0x7f8fcabb14c0, is_trans=0x7f8fcabb1411, create_table_mode=0, table_list=0x7f8fb8011548) at /data/src/10.3/sql/sql_table.cc:5107
      #11 0x000055a4f39171b5 in mysql_create_like_table (thd=0x7f8fb8000b00, table=0x7f8fb8011548, src_table=0x7f8fb8011bd8, create_info=0x7f8fcabb2b30) at /data/src/10.3/sql/sql_table.cc:5644
      #12 0x000055a4f3927366 in Sql_cmd_create_table_like::execute (this=0x7f8fb8011528, thd=0x7f8fb8000b00) at /data/src/10.3/sql/sql_table.cc:11167
      #13 0x000055a4f3842212 in mysql_execute_command (thd=0x7f8fb8000b00) at /data/src/10.3/sql/sql_parse.cc:6024
      #14 0x000055a4f3847a63 in mysql_parse (thd=0x7f8fb8000b00, rawbuf=0x7f8fb8011458 "CREATE TABLE t LIKE s", length=21, parser_state=0x7f8fcabb35e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7830
      #15 0x000055a4f3834361 in dispatch_command (command=COM_QUERY, thd=0x7f8fb8000b00, packet=0x7f8fb8008c71 "CREATE TABLE t LIKE s", packet_length=21, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1856
      #16 0x000055a4f3832c88 in do_command (thd=0x7f8fb8000b00) at /data/src/10.3/sql/sql_parse.cc:1401
      #17 0x000055a4f39abc0c in do_handle_one_connection (connect=0x55a4f66357d0) at /data/src/10.3/sql/sql_connect.cc:1403
      #18 0x000055a4f39ab96e in handle_one_connection (arg=0x55a4f66357d0) at /data/src/10.3/sql/sql_connect.cc:1308
      #19 0x000055a4f438d09c in pfs_spawn_thread (arg=0x55a4f6591200) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #20 0x00007f8fd65a34a4 in start_thread (arg=0x7f8fcabb4700) at pthread_create.c:456
      #21 0x00007f8fd4aebd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
       
      Query (0x7f8fb8011458): CREATE TABLE t LIKE s
      Connection ID (thread ID): 5
      Status: KILL_SERVER
      

      Couldn't reproduce on 10.4 or 10.5 on some reason.

      Attachments

        Activity

          alice Alice Sherepa added a comment - - edited

          also on 10.4 and 10.5:

          10.4 c1eaa385ffb44bdf626

          #6  0x00007f18c75e4bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55abb2830cc8 "remove_type == TDC_RT_REMOVE_UNUSED || thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=file@entry=0x55abb2830648 "/10.4/sql/table_cache.cc", line=line@entry=1103, function=function@entry=0x55abb28310e0 <tdc_remove_table(THD*, enum_tdc_remove_table_type, char const*, char const*, bool)::__PRETTY_FUNCTION__> "bool tdc_remove_table(THD*, enum_tdc_remove_table_type, const char*, const char*, bool)") at assert.c:92
          #7  0x00007f18c75e4c82 in __GI___assert_fail (assertion=0x55abb2830cc8 "remove_type == TDC_RT_REMOVE_UNUSED || thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x55abb2830648 "/10.4/sql/table_cache.cc", line=1103, function=0x55abb28310e0 <tdc_remove_table(THD*, enum_tdc_remove_table_type, char const*, char const*, bool)::__PRETTY_FUNCTION__> "bool tdc_remove_table(THD*, enum_tdc_remove_table_type, const char*, const char*, bool)") at assert.c:101
          #8  0x000055abb1ccdf1d in tdc_remove_table (thd=0x7f18a4000a88, remove_type=TDC_RT_REMOVE_ALL, db=0x7f18a4013dd0 "test", table_name=0x7f18a4013da0 "s", kill_delayed_threads=false) at /10.4/sql/table_cache.cc:1101
          #9  0x000055abb1b120eb in mysql_rm_table_no_locks (thd=0x7f18a4000a88, tables=0x7f18a4010f70, if_exists=true, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=true, dont_free_locks=true) at /10.4/sql/sql_table.cc:2474
          #10 0x000055abb1b1a5fd in mysql_create_table_no_lock (thd=0x7f18a4000a88, db=0x7f18a4010f88, table_name=0x7f18a4010f98, create_info=0x7f18c08f4b70, alter_info=0x7f18c08f4a80, is_trans=0x7f18c08f49c5, create_table_mode=0, table_list=0x7f18a4010f70) at /10.4/sql/sql_table.cc:5167
          #11 0x000055abb1b1beaf in mysql_create_like_table (thd=0x7f18a4000a88, table=0x7f18a4010f70, src_table=0x7f18a4014890, create_info=0x7f18c08f61d0) at /10.4/sql/sql_table.cc:5710
          #12 0x000055abb1b2cb6f in Sql_cmd_create_table_like::execute (this=0x7f18a40120b0, thd=0x7f18a4000a88) at /10.4/sql/sql_table.cc:11434
          #13 0x000055abb1a3be10 in mysql_execute_command (thd=0x7f18a4000a88) at /10.4/sql/sql_parse.cc:6102
          #14 0x000055abb1a414ff in mysql_parse (thd=0x7f18a4000a88, rawbuf=0x7f18a401cdc0 "CREATE TABLE t LIKE s", length=21, parser_state=0x7f18c08f6fd0, is_com_multi=false, is_next_command=false) at /10.4/sql/sql_parse.cc:7901
          #15 0x000055abb1a2c584 in dispatch_command (command=COM_QUERY, thd=0x7f18a4000a88, packet=0x7f18a4007bc9 "CREATE TABLE t LIKE s", packet_length=21, is_com_multi=false, is_next_command=false) at /10.4/sql/sql_parse.cc:1842
          #16 0x000055abb1a2abe5 in do_command (thd=0x7f18a4000a88) at /10.4/sql/sql_parse.cc:1360
          #17 0x000055abb1bbb133 in do_handle_one_connection (connect=0x55abb42f57b8) at /10.4/sql/sql_connect.cc:1412
          #18 0x000055abb1bbae5c in handle_one_connection (arg=0x55abb42f57b8) at /10.4/sql/sql_connect.cc:1316
          #19 0x000055abb261a86f in pfs_spawn_thread (arg=0x55abb4232fc8) at /10.4/storage/perfschema/pfs.cc:1869
          #20 0x00007f18c8adb6ba in start_thread (arg=0x7f18c08f8700) at pthread_create.c:333
          #21 0x00007f18c76be41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
          

          alice Alice Sherepa added a comment - - edited also on 10.4 and 10.5: 10.4 c1eaa385ffb44bdf626 #6 0x00007f18c75e4bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x55abb2830cc8 "remove_type == TDC_RT_REMOVE_UNUSED || thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=file@entry=0x55abb2830648 "/10.4/sql/table_cache.cc", line=line@entry=1103, function=function@entry=0x55abb28310e0 <tdc_remove_table(THD*, enum_tdc_remove_table_type, char const*, char const*, bool)::__PRETTY_FUNCTION__> "bool tdc_remove_table(THD*, enum_tdc_remove_table_type, const char*, const char*, bool)") at assert.c:92 #7 0x00007f18c75e4c82 in __GI___assert_fail (assertion=0x55abb2830cc8 "remove_type == TDC_RT_REMOVE_UNUSED || thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x55abb2830648 "/10.4/sql/table_cache.cc", line=1103, function=0x55abb28310e0 <tdc_remove_table(THD*, enum_tdc_remove_table_type, char const*, char const*, bool)::__PRETTY_FUNCTION__> "bool tdc_remove_table(THD*, enum_tdc_remove_table_type, const char*, const char*, bool)") at assert.c:101 #8 0x000055abb1ccdf1d in tdc_remove_table (thd=0x7f18a4000a88, remove_type=TDC_RT_REMOVE_ALL, db=0x7f18a4013dd0 "test", table_name=0x7f18a4013da0 "s", kill_delayed_threads=false) at /10.4/sql/table_cache.cc:1101 #9 0x000055abb1b120eb in mysql_rm_table_no_locks (thd=0x7f18a4000a88, tables=0x7f18a4010f70, if_exists=true, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=true, dont_free_locks=true) at /10.4/sql/sql_table.cc:2474 #10 0x000055abb1b1a5fd in mysql_create_table_no_lock (thd=0x7f18a4000a88, db=0x7f18a4010f88, table_name=0x7f18a4010f98, create_info=0x7f18c08f4b70, alter_info=0x7f18c08f4a80, is_trans=0x7f18c08f49c5, create_table_mode=0, table_list=0x7f18a4010f70) at /10.4/sql/sql_table.cc:5167 #11 0x000055abb1b1beaf in mysql_create_like_table (thd=0x7f18a4000a88, table=0x7f18a4010f70, src_table=0x7f18a4014890, create_info=0x7f18c08f61d0) at /10.4/sql/sql_table.cc:5710 #12 0x000055abb1b2cb6f in Sql_cmd_create_table_like::execute (this=0x7f18a40120b0, thd=0x7f18a4000a88) at /10.4/sql/sql_table.cc:11434 #13 0x000055abb1a3be10 in mysql_execute_command (thd=0x7f18a4000a88) at /10.4/sql/sql_parse.cc:6102 #14 0x000055abb1a414ff in mysql_parse (thd=0x7f18a4000a88, rawbuf=0x7f18a401cdc0 "CREATE TABLE t LIKE s", length=21, parser_state=0x7f18c08f6fd0, is_com_multi=false, is_next_command=false) at /10.4/sql/sql_parse.cc:7901 #15 0x000055abb1a2c584 in dispatch_command (command=COM_QUERY, thd=0x7f18a4000a88, packet=0x7f18a4007bc9 "CREATE TABLE t LIKE s", packet_length=21, is_com_multi=false, is_next_command=false) at /10.4/sql/sql_parse.cc:1842 #16 0x000055abb1a2abe5 in do_command (thd=0x7f18a4000a88) at /10.4/sql/sql_parse.cc:1360 #17 0x000055abb1bbb133 in do_handle_one_connection (connect=0x55abb42f57b8) at /10.4/sql/sql_connect.cc:1412 #18 0x000055abb1bbae5c in handle_one_connection (arg=0x55abb42f57b8) at /10.4/sql/sql_connect.cc:1316 #19 0x000055abb261a86f in pfs_spawn_thread (arg=0x55abb4232fc8) at /10.4/storage/perfschema/pfs.cc:1869 #20 0x00007f18c8adb6ba in start_thread (arg=0x7f18c08f8700) at pthread_create.c:333 #21 0x00007f18c76be41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
          Roel Roel Van de Paar added a comment - - edited

          Seen in 11.3 and 11.4. Highly sporadic (1 in 750-5000). Keep looping till assert is observed.

          DROP TABLE IF EXISTS t;
          DROP SEQUENCE IF EXISTS s;
          SET MAX_STATEMENT_TIME=0.0001;
          CREATE SEQUENCE s;
          CREATE TABLE t LIKE s;
          

          11.3.0 126157061b4376496c034a809ea4943e863d1465 (Debug)

          mariadbd: /test/11.3_dbg/sql/table_cache.cc:1052: void tdc_remove_table(THD*, const char*, const char*): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)' failed.
          

          11.3.0 126157061b4376496c034a809ea4943e863d1465 (Debug)

          Core was generated by `/test/MD311023-mariadb-11.3.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'.
          Program terminated with signal SIGABRT, Aborted.
          #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=23293755659840)
              at ./nptl/pthread_kill.c:44
          [Current thread is 1 (Thread 0x152f80081640 (LWP 3124318))]
          (gdb) bt
          #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=23293755659840) at ./nptl/pthread_kill.c:44
          #1  __pthread_kill_internal (signo=6, threadid=23293755659840) at ./nptl/pthread_kill.c:78
          #2  __GI___pthread_kill (threadid=23293755659840, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
          #3  0x0000152f96642476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
          #4  0x0000152f966287f3 in __GI_abort () at ./stdlib/abort.c:79
          #5  0x0000152f9662871b in __assert_fail_base (fmt=0x152f967dd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55bef64f2460 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x55bef6507f20 "/test/11.3_dbg/sql/table_cache.cc", line=1052, function=<optimized out>) at ./assert/assert.c:92
          #6  0x0000152f96639e96 in __GI___assert_fail (assertion=0x55bef64f2460 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x55bef6507f20 "/test/11.3_dbg/sql/table_cache.cc", line=1052, function=0x55bef6508498 "void tdc_remove_table(THD*, const char*, const char*)") at ./assert/assert.c:101
          #7  0x000055bef5b08086 in tdc_remove_table (thd=thd@entry=0x152f50000d58, db=0x152f500144e8 "test", table_name=0x152f50013da0 "s") at /test/11.3_dbg/sql/table_cache.cc:1052
          #8  0x000055bef5976d2c in mysql_rm_table_no_locks (thd=thd@entry=0x152f50000d58, tables=tables@entry=0x152f50013688, current_db=current_db@entry=0x152f50000df8, ddl_log_state=0x152f8007d430, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=true, dont_free_locks=true) at /test/11.3_dbg/sql/sql_table.cc:1571
          #9  0x000055bef5988e37 in mysql_create_table_no_lock (thd=thd@entry=0x152f50000d58, ddl_log_state_create=ddl_log_state_create@entry=0x152f8007dda0, ddl_log_state_rm=ddl_log_state_rm@entry=0x152f8007ddc0, create_info=create_info@entry=0x152f8007e400, alter_info=alter_info@entry=0x152f8007e010, is_trans=is_trans@entry=0x152f8007dd9b, create_table_mode=0, table_list=0x152f50013688) at /test/11.3_dbg/sql/sql_table.cc:4732
          #10 0x000055bef598b20e in mysql_create_like_table (create_info=0x152f8007e180, src_table=0x152f50013dd8, table=0x152f50013688, thd=0x152f50000d58) at /test/11.3_dbg/sql/sql_table.cc:5400
          #11 Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x152f50000d58) at /test/11.3_dbg/sql/sql_table.cc:12862
          #12 0x000055bef58a4e32 in mysql_execute_command (thd=thd@entry=0x152f50000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.3_dbg/sql/sql_parse.cc:5734
          #13 0x000055bef58a6193 in mysql_parse (thd=thd@entry=0x152f50000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x152f800801e0) at /test/11.3_dbg/sql/sql_parse.cc:7742
          #14 0x000055bef58a8509 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x152f50000d58, packet=packet@entry=0x152f5000b259 "CREATE TABLE t LIKE s", packet_length=packet_length@entry=21, blocking=blocking@entry=true) at /test/11.3_dbg/sql/sql_class.h:251
          #15 0x000055bef58aa625 in do_command (thd=0x152f50000d58, blocking=blocking@entry=true) at /test/11.3_dbg/sql/sql_parse.cc:1406
          #16 0x000055bef5a0f54d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55bef9ef2f98, put_in_cache=put_in_cache@entry=true) at /test/11.3_dbg/sql/sql_connect.cc:1418
          #17 0x000055bef5a0f842 in handle_one_connection (arg=arg@entry=0x55bef9ef2f98) at /test/11.3_dbg/sql/sql_connect.cc:1320
          #18 0x000055bef5e54a28 in pfs_spawn_thread (arg=0x55bef9e737a8) at /test/11.3_dbg/storage/perfschema/pfs.cc:2201
          #19 0x0000152f96694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
          #20 0x0000152f96726660 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
          

          Roel Roel Van de Paar added a comment - - edited Seen in 11.3 and 11.4. Highly sporadic (1 in 750-5000). Keep looping till assert is observed. DROP TABLE IF EXISTS t; DROP SEQUENCE IF EXISTS s; SET MAX_STATEMENT_TIME=0.0001; CREATE SEQUENCE s; CREATE TABLE t LIKE s; 11.3.0 126157061b4376496c034a809ea4943e863d1465 (Debug) mariadbd: /test/11.3_dbg/sql/table_cache.cc:1052: void tdc_remove_table(THD*, const char*, const char*): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)' failed. 11.3.0 126157061b4376496c034a809ea4943e863d1465 (Debug) Core was generated by `/test/MD311023-mariadb-11.3.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=23293755659840) at ./nptl/pthread_kill.c:44 [Current thread is 1 (Thread 0x152f80081640 (LWP 3124318))] (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=23293755659840) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=23293755659840) at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=23293755659840, signo=signo@entry=6) at ./nptl/pthread_kill.c:89 #3 0x0000152f96642476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #4 0x0000152f966287f3 in __GI_abort () at ./stdlib/abort.c:79 #5 0x0000152f9662871b in __assert_fail_base (fmt=0x152f967dd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55bef64f2460 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x55bef6507f20 "/test/11.3_dbg/sql/table_cache.cc", line=1052, function=<optimized out>) at ./assert/assert.c:92 #6 0x0000152f96639e96 in __GI___assert_fail (assertion=0x55bef64f2460 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x55bef6507f20 "/test/11.3_dbg/sql/table_cache.cc", line=1052, function=0x55bef6508498 "void tdc_remove_table(THD*, const char*, const char*)") at ./assert/assert.c:101 #7 0x000055bef5b08086 in tdc_remove_table (thd=thd@entry=0x152f50000d58, db=0x152f500144e8 "test", table_name=0x152f50013da0 "s") at /test/11.3_dbg/sql/table_cache.cc:1052 #8 0x000055bef5976d2c in mysql_rm_table_no_locks (thd=thd@entry=0x152f50000d58, tables=tables@entry=0x152f50013688, current_db=current_db@entry=0x152f50000df8, ddl_log_state=0x152f8007d430, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=true, dont_free_locks=true) at /test/11.3_dbg/sql/sql_table.cc:1571 #9 0x000055bef5988e37 in mysql_create_table_no_lock (thd=thd@entry=0x152f50000d58, ddl_log_state_create=ddl_log_state_create@entry=0x152f8007dda0, ddl_log_state_rm=ddl_log_state_rm@entry=0x152f8007ddc0, create_info=create_info@entry=0x152f8007e400, alter_info=alter_info@entry=0x152f8007e010, is_trans=is_trans@entry=0x152f8007dd9b, create_table_mode=0, table_list=0x152f50013688) at /test/11.3_dbg/sql/sql_table.cc:4732 #10 0x000055bef598b20e in mysql_create_like_table (create_info=0x152f8007e180, src_table=0x152f50013dd8, table=0x152f50013688, thd=0x152f50000d58) at /test/11.3_dbg/sql/sql_table.cc:5400 #11 Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x152f50000d58) at /test/11.3_dbg/sql/sql_table.cc:12862 #12 0x000055bef58a4e32 in mysql_execute_command (thd=thd@entry=0x152f50000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.3_dbg/sql/sql_parse.cc:5734 #13 0x000055bef58a6193 in mysql_parse (thd=thd@entry=0x152f50000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x152f800801e0) at /test/11.3_dbg/sql/sql_parse.cc:7742 #14 0x000055bef58a8509 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x152f50000d58, packet=packet@entry=0x152f5000b259 "CREATE TABLE t LIKE s", packet_length=packet_length@entry=21, blocking=blocking@entry=true) at /test/11.3_dbg/sql/sql_class.h:251 #15 0x000055bef58aa625 in do_command (thd=0x152f50000d58, blocking=blocking@entry=true) at /test/11.3_dbg/sql/sql_parse.cc:1406 #16 0x000055bef5a0f54d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55bef9ef2f98, put_in_cache=put_in_cache@entry=true) at /test/11.3_dbg/sql/sql_connect.cc:1418 #17 0x000055bef5a0f842 in handle_one_connection (arg=arg@entry=0x55bef9ef2f98) at /test/11.3_dbg/sql/sql_connect.cc:1320 #18 0x000055bef5e54a28 in pfs_spawn_thread (arg=0x55bef9e737a8) at /test/11.3_dbg/storage/perfschema/pfs.cc:2201 #19 0x0000152f96694ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442 #20 0x0000152f96726660 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
          wlad Vladislav Vaintroub added a comment - - edited

          Roel You'd need to try something fresh, that contains the patch that fixes original issue. the code from October (which corresponds to the git hash 126157061b4376496c034a809ea4943e863d1465
          you have), does not have that fix.

          This is the patch https://github.com/MariaDB/server/commit/f53321cbdb53c949295732c95f8a01dd3585fb78 , it also has new main.sequence_debug MTR test, so you can easily tell whether it is in or not.

          I reassigned it back to you to confirm it is fixed, provided the patch is in the code you're testing

          wlad Vladislav Vaintroub added a comment - - edited Roel You'd need to try something fresh, that contains the patch that fixes original issue. the code from October (which corresponds to the git hash 126157061b4376496c034a809ea4943e863d1465 you have), does not have that fix. This is the patch https://github.com/MariaDB/server/commit/f53321cbdb53c949295732c95f8a01dd3585fb78 , it also has new main.sequence_debug MTR test, so you can easily tell whether it is in or not. I reassigned it back to you to confirm it is fixed, provided the patch is in the code you're testing
          Roel Roel Van de Paar added a comment - - edited

          Retested with 11.2, 11.3 and 11.4 trunk. 11.2 and 11.3 did not produce the issue ftm.

          Issue seen post-patch in 11.4 after about 4k iterations with the t/c from my last comment:

          11.4.0 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 (Debug)

          mariadbd: /test/11.4_dbg/sql/table_cache.cc:1052: void tdc_remove_table(THD*, const char*, const char*): Assertion `thd->mdl
          _context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)' failed.
          

          11.4.0 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 (Debug)

          Core was generated by `/test/MD271223-mariadb-11.4.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'.
          Program terminated with signal SIGABRT, Aborted.
          #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22750174197312)
              at ./nptl/pthread_kill.c:44
          [Current thread is 1 (Thread 0x14b0f00d3640 (LWP 2082861))]
          (gdb) bt
          #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22750174197312) at ./nptl/pthread_kill.c:44
          #1  __pthread_kill_internal (signo=6, threadid=22750174197312) at ./nptl/pthread_kill.c:78
          #2  __GI___pthread_kill (threadid=22750174197312, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
          #3  0x000014b0f9a42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
          #4  0x000014b0f9a287f3 in __GI_abort () at ./stdlib/abort.c:79
          #5  0x000014b0f9a2871b in __assert_fail_base (fmt=0x14b0f9bdd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x563edc1ae580 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x563edc1c4040 "/test/11.4_dbg/sql/table_cache.cc", line=1052, function=<optimized out>) at ./assert/assert.c:92
          #6  0x000014b0f9a39e96 in __GI___assert_fail (assertion=0x563edc1ae580 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x563edc1c4040 "/test/11.4_dbg/sql/table_cache.cc", line=1052, function=0x563edc1c45b8 "void tdc_remove_table(THD*, const char*, const char*)") at ./assert/assert.c:101
          #7  0x0000563edb7c4414 in tdc_remove_table (thd=thd@entry=0x14b0b0000d58, db=0x14b0b0014458 "test", table_name=0x14b0b0013d10 "s") at /test/11.4_dbg/sql/table_cache.cc:1052
          #8  0x0000563edb6330b4 in mysql_rm_table_no_locks (thd=thd@entry=0x14b0b0000d58, tables=tables@entry=0x14b0b00135f8, current_db=current_db@entry=0x14b0b0000df8, ddl_log_state=0x14b0f00cf430, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=true, dont_free_locks=true) at /test/11.4_dbg/sql/sql_table.cc:1571
          #9  0x0000563edb6451bf in mysql_create_table_no_lock (thd=thd@entry=0x14b0b0000d58, ddl_log_state_create=ddl_log_state_create@entry=0x14b0f00cfda0, ddl_log_state_rm=ddl_log_state_rm@entry=0x14b0f00cfdc0, create_info=create_info@entry=0x14b0f00d0400, alter_info=alter_info@entry=0x14b0f00d0010, is_trans=is_trans@entry=0x14b0f00cfd9b, create_table_mode=0, table_list=0x14b0b00135f8) at /test/11.4_dbg/sql/sql_table.cc:4732
          #10 0x0000563edb647596 in mysql_create_like_table (create_info=0x14b0f00d0180, src_table=0x14b0b0013d48, table=0x14b0b00135f8, thd=0x14b0b0000d58) at /test/11.4_dbg/sql/sql_table.cc:5400
          #11 Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x14b0b0000d58) at /test/11.4_dbg/sql/sql_table.cc:12862
          #12 0x0000563edb561130 in mysql_execute_command (thd=thd@entry=0x14b0b0000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.4_dbg/sql/sql_parse.cc:5738
          #13 0x0000563edb5624bb in mysql_parse (thd=thd@entry=0x14b0b0000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b0f00d21e0) at /test/11.4_dbg/sql/sql_parse.cc:7748
          #14 0x0000563edb564831 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b0b0000d58, packet=packet@entry=0x14b0b000b1c9 "CREATE TABLE t LIKE s", packet_length=packet_length@entry=21, blocking=blocking@entry=true) at /test/11.4_dbg/sql/sql_class.h:253
          #15 0x0000563edb566956 in do_command (thd=0x14b0b0000d58, blocking=blocking@entry=true) at /test/11.4_dbg/sql/sql_parse.cc:1406
          #16 0x0000563edb6cb8b7 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x563edf2c45b8, put_in_cache=put_in_cache@entry=true) at /test/11.4_dbg/sql/sql_connect.cc:1418
          #17 0x0000563edb6cbbac in handle_one_connection (arg=arg@entry=0x563edf2c45b8) at /test/11.4_dbg/sql/sql_connect.cc:1320
          #18 0x0000563edbb1073a in pfs_spawn_thread (arg=0x563edf298d98) at /test/11.4_dbg/storage/perfschema/pfs.cc:2201
          #19 0x000014b0f9a94ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
          #20 0x000014b0f9b26660 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
          

          Roel Roel Van de Paar added a comment - - edited Retested with 11.2, 11.3 and 11.4 trunk. 11.2 and 11.3 did not produce the issue ftm. Issue seen post-patch in 11.4 after about 4k iterations with the t/c from my last comment: 11.4.0 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 (Debug) mariadbd: /test/11.4_dbg/sql/table_cache.cc:1052: void tdc_remove_table(THD*, const char*, const char*): Assertion `thd->mdl _context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)' failed. 11.4.0 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 (Debug) Core was generated by `/test/MD271223-mariadb-11.4.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=22750174197312) at ./nptl/pthread_kill.c:44 [Current thread is 1 (Thread 0x14b0f00d3640 (LWP 2082861))] (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=22750174197312) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=22750174197312) at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=22750174197312, signo=signo@entry=6) at ./nptl/pthread_kill.c:89 #3 0x000014b0f9a42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #4 0x000014b0f9a287f3 in __GI_abort () at ./stdlib/abort.c:79 #5 0x000014b0f9a2871b in __assert_fail_base (fmt=0x14b0f9bdd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x563edc1ae580 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x563edc1c4040 "/test/11.4_dbg/sql/table_cache.cc", line=1052, function=<optimized out>) at ./assert/assert.c:92 #6 0x000014b0f9a39e96 in __GI___assert_fail (assertion=0x563edc1ae580 "thd->mdl_context.is_lock_owner(MDL_key::TABLE, db, table_name, MDL_EXCLUSIVE)", file=0x563edc1c4040 "/test/11.4_dbg/sql/table_cache.cc", line=1052, function=0x563edc1c45b8 "void tdc_remove_table(THD*, const char*, const char*)") at ./assert/assert.c:101 #7 0x0000563edb7c4414 in tdc_remove_table (thd=thd@entry=0x14b0b0000d58, db=0x14b0b0014458 "test", table_name=0x14b0b0013d10 "s") at /test/11.4_dbg/sql/table_cache.cc:1052 #8 0x0000563edb6330b4 in mysql_rm_table_no_locks (thd=thd@entry=0x14b0b0000d58, tables=tables@entry=0x14b0b00135f8, current_db=current_db@entry=0x14b0b0000df8, ddl_log_state=0x14b0f00cf430, ddl_log_state@entry=0x0, if_exists=if_exists@entry=true, drop_temporary=false, drop_view=false, drop_sequence=true, dont_log_query=true, dont_free_locks=true) at /test/11.4_dbg/sql/sql_table.cc:1571 #9 0x0000563edb6451bf in mysql_create_table_no_lock (thd=thd@entry=0x14b0b0000d58, ddl_log_state_create=ddl_log_state_create@entry=0x14b0f00cfda0, ddl_log_state_rm=ddl_log_state_rm@entry=0x14b0f00cfdc0, create_info=create_info@entry=0x14b0f00d0400, alter_info=alter_info@entry=0x14b0f00d0010, is_trans=is_trans@entry=0x14b0f00cfd9b, create_table_mode=0, table_list=0x14b0b00135f8) at /test/11.4_dbg/sql/sql_table.cc:4732 #10 0x0000563edb647596 in mysql_create_like_table (create_info=0x14b0f00d0180, src_table=0x14b0b0013d48, table=0x14b0b00135f8, thd=0x14b0b0000d58) at /test/11.4_dbg/sql/sql_table.cc:5400 #11 Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x14b0b0000d58) at /test/11.4_dbg/sql/sql_table.cc:12862 #12 0x0000563edb561130 in mysql_execute_command (thd=thd@entry=0x14b0b0000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.4_dbg/sql/sql_parse.cc:5738 #13 0x0000563edb5624bb in mysql_parse (thd=thd@entry=0x14b0b0000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b0f00d21e0) at /test/11.4_dbg/sql/sql_parse.cc:7748 #14 0x0000563edb564831 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b0b0000d58, packet=packet@entry=0x14b0b000b1c9 "CREATE TABLE t LIKE s", packet_length=packet_length@entry=21, blocking=blocking@entry=true) at /test/11.4_dbg/sql/sql_class.h:253 #15 0x0000563edb566956 in do_command (thd=0x14b0b0000d58, blocking=blocking@entry=true) at /test/11.4_dbg/sql/sql_parse.cc:1406 #16 0x0000563edb6cb8b7 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x563edf2c45b8, put_in_cache=put_in_cache@entry=true) at /test/11.4_dbg/sql/sql_connect.cc:1418 #17 0x0000563edb6cbbac in handle_one_connection (arg=arg@entry=0x563edf2c45b8) at /test/11.4_dbg/sql/sql_connect.cc:1320 #18 0x0000563edbb1073a in pfs_spawn_thread (arg=0x563edf298d98) at /test/11.4_dbg/storage/perfschema/pfs.cc:2201 #19 0x000014b0f9a94ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442 #20 0x000014b0f9b26660 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

          There is also another sporadic issue, seen on 11.2, 11.3 and 11.4:
          The original testcase by Elena above, when executed as:

          MTR_MEM=/dev/shm ./mysql-test-run --repeat=99999 --parallel=1 --mem --force test
          

          Will on all versions tested at random/sporadic times fail like this:

          11.3.2 63fb478f88e0061d149f5cdd3c4d21d4a35c7bd9

          ...
            w1 [ 13 fail ]
                  Test ended at 2023-12-27 14:32:14
           
          CURRENT_TEST: main.test
          mysqltest: At line 15: query 'DROP TABLE t' failed: ER_BAD_TABLE_ERROR (1051): Unknown table 'test.t'
          

          And 11.4 also readily asserts as described.

          Roel Roel Van de Paar added a comment - There is also another sporadic issue, seen on 11.2, 11.3 and 11.4: The original testcase by Elena above, when executed as: MTR_MEM= /dev/shm . /mysql-test-run --repeat=99999 --parallel=1 --mem --force test Will on all versions tested at random/sporadic times fail like this: 11.3.2 63fb478f88e0061d149f5cdd3c4d21d4a35c7bd9 ... w1 [ 13 fail ] Test ended at 2023-12-27 14:32:14   CURRENT_TEST: main.test mysqltest: At line 15: query 'DROP TABLE t' failed: ER_BAD_TABLE_ERROR (1051): Unknown table 'test.t' And 11.4 also readily asserts as described.
          wlad Vladislav Vaintroub added a comment - - edited

          Nope , Roel, 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 is not post-patch. It is pre-patch.
          How do I know? mysql-test/main/sequence_debug.test is missing, if I "git reset --hard 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17" .

          There is no other sporadic issue as described by Elena in the original bug report. There is a bug in the original test case. If CREATE TABLE t LIKE s fails, one can't expect 't' to be here, and DROP to be successful. On the contrary, DROP TABLE must fail with ER_BAD_TABLE_ERROR in this case.

          In fact, sequence_debug MTR test, which I mention above, and mentioned before, specifically tests that DROP TABLE t after failed CREATE TABLE t LIKE s
          would return ER_BAD_TABLE_ERROR , see https://github.com/MariaDB/server/blob/f53321cbdb53c949295732c95f8a01dd3585fb78/mysql-test/main/sequence_debug.test

          wlad Vladislav Vaintroub added a comment - - edited Nope , Roel , 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17 is not post-patch. It is pre-patch. How do I know? mysql-test/main/sequence_debug.test is missing, if I "git reset --hard 9bd95e914f3f12d0d9d93e7a1f2c49e6e8841f17" . There is no other sporadic issue as described by Elena in the original bug report. There is a bug in the original test case. If CREATE TABLE t LIKE s fails, one can't expect 't' to be here, and DROP to be successful. On the contrary, DROP TABLE must fail with ER_BAD_TABLE_ERROR in this case. In fact, sequence_debug MTR test, which I mention above, and mentioned before, specifically tests that DROP TABLE t after failed CREATE TABLE t LIKE s would return ER_BAD_TABLE_ERROR , see https://github.com/MariaDB/server/blob/f53321cbdb53c949295732c95f8a01dd3585fb78/mysql-test/main/sequence_debug.test

          Thank you wlad. It was a shortcoming in my MTR knowledge (--send).

          For 11.4, I am not sure what is happening; while the test (mariadb-test/main/sequence_debug.test) is indeed not there, the patch does show in the 11.4 branch?
          https://github.com/MariaDB/server/commits/11.4?after=3fad2b115569864d8c1b7ea90ce92aa895cfef08+480&branch=11.4

          Roel Roel Van de Paar added a comment - Thank you wlad . It was a shortcoming in my MTR knowledge (--send). For 11.4, I am not sure what is happening; while the test (mariadb-test/main/sequence_debug.test) is indeed not there, the patch does show in the 11.4 branch? https://github.com/MariaDB/server/commits/11.4?after=3fad2b115569864d8c1b7ea90ce92aa895cfef08+480&branch=11.4

          People

            wlad Vladislav Vaintroub
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.