Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4(EOL), 10.5, 10.6, 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL)
Description
A simplified version of a test mentioned in a comment in MDEV-29854[1], tested at 11.0 0199a5d0f634051f23d4c7f7ce7651c7f93c818f. Probably also existing in other versions.
--echo #
|
--echo # MDEV-XXXXX Hang when locking both spider table and remote table in the same statement
|
--echo #
|
--disable_query_log
|
--disable_result_log
|
--source ../../t/test_init.inc
|
--enable_result_log
|
--enable_query_log
|
evalp CREATE SERVER srv FOREIGN DATA WRAPPER mysql |
OPTIONS (SOCKET "$MASTER_1_MYSOCK", DATABASE 'test',user 'root'); |
|
create table t (c int); |
create table t2 (c int) ENGINE=Spider |
COMMENT='WRAPPER "mysql", srv "srv",TABLE "t"'; |
LOCK TABLES t WRITE,t2 WRITE;
|
drop table t, t2; |
|
drop server srv; |
--disable_query_log
|
--disable_result_log
|
--source ../../t/test_deinit.inc
|
--enable_result_log
|
--enable_query_log
|
--echo #
|
--echo # end of test mdev_XXXXX
|
--echo # |
The metadata lock of t is acquired when opening tables. Then in lock_external() it iterates over all tables to lock. After locking t, when trying to lock t2, spider sends a query to the data node to lock t again. Somehow the MDL lock of t is not released yet, so the triggered open_table() hangs at waiting for MDL until lock_wait_timeout (default 1h) has passed.
Not sure whether it counts as a spider bug or a sql layer bug.
For comparison, if we simply lock tables with the same name / alias in one statement, the parser would pick out the issue and throw a 1066 ER_NONUNIQ_TABLE
Attachments
Issue Links
- is duplicated by
-
MDEV-34588 Assertion `thd == _current_thd() || ((&(&thd->LOCK_thd_data)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&thd->LOCK_thd_data)->m_mutex)->thread))' failed in thd_get_ha_data and thread hangs
- Closed
- relates to
-
MDEV-29854 SIGSEGV in spider_string::length on LOCK TABLES
- Closed
- split from
-
MDEV-29854 SIGSEGV in spider_string::length on LOCK TABLES
- Closed