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

Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table_list->db, table_list->table_name, MDL_SHARED)' failed or unexpected ER_NO_SUCH_TABLE upon FLUSH after RENAME

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Won't Fix
    • 5.5(EOL)
    • N/A
    • Locking
    • None

    Description

      CREATE TABLE t1 (a INT);
      CREATE TRIGGER tr BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t1 SELECT * FROM t1;
      LOCK TABLE t1 WRITE;
      ALTER TABLE t1 RENAME TO t2;
      FLUSH TABLES;
       
      # Cleanup
      UNLOCK TABLES;
      DROP TABLE IF EXISTS t1, t2;
      

      5.5 debug e43bc02e7b275

      mysqld: /data/src/5.5/sql/sql_base.cc:587: TABLE_SHARE* get_table_share(THD*, TABLE_LIST*, char*, uint, uint, int*, my_hash_value_type): Assertion `thd->mdl_context.is_lock_owner(MDL_key::TABLE, table_list->db, table_list->table_name, MDL_SHARED)' failed.
      180922  4:29:45 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fe616912ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000000000059e2be in get_table_share (thd=0x7fe612664060, table_list=0x7fe6115ad660, key=0x7fe618385840 "test", key_length=8, db_flags=8192, error=0x7fe618385bdc, hash_value=1096967734) at /data/src/5.5/sql/sql_base.cc:584
      #9  0x000000000059e6bf in get_table_share_with_discover (thd=0x7fe612664060, table_list=0x7fe6115ad660, key=0x7fe618385840 "test", key_length=8, db_flags=8192, error=0x7fe618385bdc, hash_value=1096967734) at /data/src/5.5/sql/sql_base.cc:692
      #10 0x00000000005a3247 in open_table (thd=0x7fe612664060, table_list=0x7fe6115ad660, mem_root=0x7fe612668618, ot_ctx=0x7fe618385c60) at /data/src/5.5/sql/sql_base.cc:3043
      #11 0x00000000005a4388 in Locked_tables_list::reopen_tables (this=0x7fe612667238, thd=0x7fe612664060) at /data/src/5.5/sql/sql_base.cc:3636
      #12 0x000000000059f830 in close_cached_tables (thd=0x7fe612664060, tables=0x0, wait_for_refresh=true, timeout=31536000) at /data/src/5.5/sql/sql_base.cc:1188
      #13 0x00000000007293f1 in reload_acl_and_cache (thd=0x7fe612664060, options=4, tables=0x0, write_to_binlog=0x7fe6183862cc) at /data/src/5.5/sql/sql_reload.cc:274
      #14 0x0000000000604e7f in mysql_execute_command (thd=0x7fe612664060) at /data/src/5.5/sql/sql_parse.cc:3716
      #15 0x000000000060a59a in mysql_parse (thd=0x7fe612664060, rawbuf=0x7fe611548078 "FLUSH TABLES", length=12, parser_state=0x7fe618386640) at /data/src/5.5/sql/sql_parse.cc:5923
      #16 0x00000000005fe2af in dispatch_command (command=COM_QUERY, thd=0x7fe612664060, packet=0x7fe61635b061 "FLUSH TABLES", packet_length=12) at /data/src/5.5/sql/sql_parse.cc:1066
      #17 0x00000000005fd4a1 in do_command (thd=0x7fe612664060) at /data/src/5.5/sql/sql_parse.cc:793
      #18 0x0000000000700a21 in do_handle_one_connection (thd_arg=0x7fe612664060) at /data/src/5.5/sql/sql_connect.cc:1268
      #19 0x00000000007007ae in handle_one_connection (arg=0x7fe612664060) at /data/src/5.5/sql/sql_connect.cc:1184
      #20 0x0000000000a0ff43 in pfs_spawn_thread (arg=0x7fe6133933a0) at /data/src/5.5/storage/perfschema/pfs.cc:1015
      #21 0x00007fe617fb9494 in start_thread (arg=0x7fe618387700) at pthread_create.c:333
      #22 0x00007fe6169cf93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      5.5 non-debug e43bc02e7b275

      mysqltest: At line 5: query 'FLUSH TABLES' failed: 1146: Table 'test.t1' doesn't exist
      

      Till recently, the same test case caused a different assertion failure (but the same non-debug error) on 10.x:

      mysqld: /data/src/10.1/sql/sql_error.cc:378: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `! is_set()' failed.
      180922  4:28:59 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007ff068685ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000055b0b7e8ea0c in Diagnostics_area::set_ok_status (this=0x7ff0614d9040, affected_rows=0, last_insert_id=0, message=0x0) at /data/src/10.1/sql/sql_error.cc:378
      #9  0x000055b0b7e4725b in my_ok (thd=0x7ff0614d4070, affected_rows=0, id=0, message=0x0) at /data/src/10.1/sql/sql_class.h:4183
      #10 0x000055b0b7ebe4c0 in mysql_execute_command (thd=0x7ff0614d4070) at /data/src/10.1/sql/sql_parse.cc:4928
      #11 0x000055b0b7ec585d in mysql_parse (thd=0x7ff0614d4070, rawbuf=0x7ff05f843088 "FLUSH TABLES", length=12, parser_state=0x7ff06a7095e0) at /data/src/10.1/sql/sql_parse.cc:7465
      #12 0x000055b0b7eb40cf in dispatch_command (command=COM_QUERY, thd=0x7ff0614d4070, packet=0x7ff063ff9071 "FLUSH TABLES", packet_length=12) at /data/src/10.1/sql/sql_parse.cc:1495
      #13 0x000055b0b7eb2e54 in do_command (thd=0x7ff0614d4070) at /data/src/10.1/sql/sql_parse.cc:1124
      #14 0x000055b0b7fed827 in do_handle_one_connection (thd_arg=0x7ff0614d4070) at /data/src/10.1/sql/sql_connect.cc:1330
      #15 0x000055b0b7fed58b in handle_one_connection (arg=0x7ff0614d4070) at /data/src/10.1/sql/sql_connect.cc:1242
      #16 0x000055b0b83abe1c in pfs_spawn_thread (arg=0x7ff067c39ef0) at /data/src/10.1/storage/perfschema/pfs.cc:1861
      #17 0x00007ff06a389494 in start_thread (arg=0x7ff06a70ab00) at pthread_create.c:333
      #18 0x00007ff06874293f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      However, it appears to have been fixed in 10.0 by the patch for MDEV-14410:

      commit 327b2717219aaa8f9033895a2351a6ccd4655116
      Author: Sergey Vojtovich <svoj@mariadb.org>
      Date:   Fri Sep 7 14:50:10 2018 +0400
       
          MDEV-14410 - Assertion `table->pos_in_locked_tables == __null ||
                       table->pos_in_locked_tables->table == table'
                       failed in mark_used_tables_as_free_for_reuse
      

      At least in 10.0 both debug and non-debug version of the problem disappeared after this patch. As of now, it hasn't yet been merged into higher 10.x, but I hope it will fix them as well. If that's the case, given that the failure only remains in 5.5 and doesn't look extremely critical, if you decide to close it as "Won't fix", it's fine by me.

      Attachments

        Issue Links

          Activity

            People

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