Bug #110872 | Unable to create indexes concurrently on the same table | ||
---|---|---|---|
Submitted: | 30 Apr 2023 2:06 | Modified: | 3 May 2023 22:58 |
Reporter: | Mark Callaghan | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[30 Apr 2023 2:06]
Mark Callaghan
[30 Apr 2023 3:21]
Mark Callaghan
A stack trace for one of the connections blocked on the table metadata lock ... #0 0x00007fdbab297301 in __futex_abstimed_wait_cancelable64 () from /usr/local/fbcode/platform010/lib/libc.so.6 (gdb) where #0 0x00007fdbab297301 in __futex_abstimed_wait_cancelable64 () from /usr/local/fbcode/platform010/lib/libc.so.6 #1 0x00007fdbab29a05d in pthread_cond_timedwait@@GLIBC_2.3.2 () from /usr/local/fbcode/platform010/lib/libc.so.6 #2 0x0000000001fec5af in native_cond_timedwait (cond=0x7fa6f6305480, mutex=0x7fa6f6305450, abstime=0x7fdb9ddf9750) at /data/users/mcallaghan/mysql-8.0.32/include/thr_cond.h:99 #3 my_cond_timedwait (cond=0x7fa6f6305480, mp=0x7fa6f6305450, abstime=0x7fdb9ddf9750) at /data/users/mcallaghan/mysql-8.0.32/include/thr_cond.h:148 #4 inline_mysql_cond_timedwait (that=0x7fa6f6305480, mutex=0x7fa6f6305450, abstime=0x7fdb9ddf9750, src_file=<optimized out>, src_line=1820) at /data/users/mcallaghan/mysql-8.0.32/include/mysql/psi/mysql_cond.h:242 #5 MDL_wait::timed_wait (this=0x7fa6f6305450, owner=0x7fa6f63050c0, abs_timeout=0x7fdb9ddf9750, set_status_on_timeout=true, wait_state_name=<optimized out>) at /data/users/mcallaghan/mysql-8.0.32/sql/mdl.cc:1819 #6 0x0000000001ff02c3 in MDL_context::acquire_lock (this=0x7fa6f6305450, mdl_request=0x7fa6f63115b8, lock_wait_timeout=<optimized out>) at /data/users/mcallaghan/mysql-8.0.32/sql/mdl.cc:3524 #7 0x0000000001ff1793 in MDL_context::acquire_locks (this=0x7fa6f63054a8, mdl_requests=<optimized out>, lock_wait_timeout=31536000) at /data/users/mcallaghan/mysql-8.0.32/sql/mdl.cc:3656 #8 0x00000000023ca276 in lock_table_names (thd=<optimized out>, tables_start=<optimized out>, tables_end=0x0, lock_wait_timeout=31536000, flags=0, schema_reqs=0x0) at /data/users/mcallaghan/mysql-8.0.32/sql/sql_base.cc:5487 #9 0x00000000023cd2e5 in open_tables (thd=<optimized out>, start=<optimized out>, counter=<optimized out>, flags=<optimized out>, prelocking_strategy=<optimized out>) at /data/users/mcallaghan/mysql-8.0.32/sql/sql_base.cc:5826 #10 0x000000000262265e in mysql_alter_table (thd=<optimized out>, new_db=0x7fa6f6311830 "ib", new_name=0x0, create_info=<optimized out>, table_list=<optimized out>, alter_info=0x7fdb9ddfcaa8) at /data/users/mcallaghan/mysql-8.0.32/sql/sql_table.cc:16313 #11 0x00000000023ba404 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x7fa6f63050c0) at /data/users/mcallaghan/mysql-8.0.32/sql/sql_alter.cc:349 #12 0x0000000002549f4b in mysql_execute_command (thd=<optimized out>, first_level=false) at /data/users/mcallaghan/mysql-8.0.32/sql/sql_parse.cc:4688 #13 0x0000000002546814 in dispatch_sql_command (thd=0x7fa6f63050c0, parser_state=<optimized out>) at /data/users/mcallaghan/mysql-8.0.32/sql/sql_parse.cc:5322 #14 0x0000000002544390 in dispatch_command (thd=<optimized out>, com_data=0x7fdb9ddfec00, command=COM_QUERY) at /data/users/mcallaghan/mysql-8.0.32/sql/sql_parse.cc:2036 #15 0x0000000002545603 in do_command (thd=0x7fa6f63050c0) at /data/users/mcallaghan/mysql-8.0.32/sql/sql_parse.cc:1439 #16 0x00000000027670c4 in handle_connection (arg=<optimized out>) at /data/users/mcallaghan/mysql-8.0.32/sql/conn_handler/connection_handler_per_thread.cc:302 #17 0x0000000003b31f50 in pfs_spawn_thread (arg=0x3194add0) at /data/users/mcallaghan/mysql-8.0.32/storage/perfschema/pfs.cc:2986 #18 0x00007fdbab29ac0f in start_thread () from /usr/local/fbcode/platform010/lib/libc.so.6 #19 0x00007fdbab32d1dc in clone3 () from /usr/local/fbcode/platform010/lib/libc.so.6
[2 May 2023 13:20]
MySQL Verification Team
Hi Mr. Callaghan, Thank you for your bug report. After several attempts we have been able to repeat the behaviour on 8.0.33. Thank you very much on your report. Verified as reported.
[3 May 2023 22:58]
Mark Callaghan
Elsewhere, Sunny Bains mentioned that the current behavior is expected -- as in, any connection creating an index holds an exclusive table metadata lock. I don't doubt that, but hope the docs can be more clear about it.
[4 May 2023 11:32]
MySQL Verification Team
Hi, This could be both a documentation report and a new feature request.