|
In the trace that I just checked, at the time the server process receives SIGABRT from the environment, the only InnoDB thread is the idle page cleaner:
ssh pluto
|
rr replay /data/results/1697741072/LWT_VIOLATION/1/rr/latest-trace
|
Thread 5 (Thread 410046.410832):
|
…
|
#11 __pthread_cond_wait (cond=cond@entry=0x56239fe38cc8 <buf_pool+17416>, mutex=mutex@entry=0x56239fe38be8 <buf_pool+17192>) at pthread_cond_wait.c:638
|
#12 0x000056239f3e5301 in safe_cond_wait (cond=0x56239fe38cc8 <buf_pool+17416>, mp=0x56239fe38bc0 <buf_pool+17152>, file=file@entry=0x56239f7ea5d8 "/data/Server/bb-10.6-MDEV-32050-rerebase/storage/innobase/buf/buf0flu.cc", line=line@entry=2280) at /data/Server/bb-10.6-MDEV-32050-rerebase/mysys/thr_mutex.c:492
|
#13 0x000056239f276735 in buf_flush_page_cleaner () at /data/Server/bb-10.6-MDEV-32050-rerebase/storage/innobase/buf/buf0flu.cc:2280
|
…
|
There are several threads waiting in MDL_wait::timed_wait. The last one is right before the server was killed by the environment:
Thread 3 hit Breakpoint 1, MDL_wait::timed_wait (this=this@entry=0x7f65fc023840, owner=0x7f65fc0237d0, abs_timeout=abs_timeout@entry=0x7f65e40572a0, set_status_on_timeout=set_status_on_timeout@entry=false, wait_state_name=0x56239fe12870 <MDL_key::m_namespace_to_wait_state_name+48>) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/mdl.cc:1174
|
1174 {
|
(rr) bt
|
#0 MDL_wait::timed_wait (this=this@entry=0x7f65fc023840, owner=0x7f65fc0237d0, abs_timeout=abs_timeout@entry=0x7f65e40572a0, set_status_on_timeout=set_status_on_timeout@entry=false, wait_state_name=0x56239fe12870 <MDL_key::m_namespace_to_wait_state_name+48>) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/mdl.cc:1174
|
#1 0x000056239eae3752 in MDL_context::acquire_lock (this=this@entry=0x7f65fc023840, mdl_request=mdl_request@entry=0x7f65fc035760, lock_wait_timeout=<optimized out>) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/mdl.h:482
|
#2 0x000056239e8ff5cd in open_table_get_mdl_lock (thd=thd@entry=0x7f65fc0236e8, ot_ctx=ot_ctx@entry=0x7f65e4057860, mdl_request=mdl_request@entry=0x7f65fc035760, flags=flags@entry=0, mdl_ticket=mdl_ticket@entry=0x7f65e4057558) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/sql_base.h:562
|
#3 0x000056239e905a83 in open_table (thd=thd@entry=0x7f65fc0236e8, table_list=table_list@entry=0x7f65fc0352e0, ot_ctx=ot_ctx@entry=0x7f65e4057860) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/sql_base.cc:1864
|
#4 0x000056239e907616 in open_and_process_table (thd=thd@entry=0x7f65fc0236e8, tables=tables@entry=0x7f65fc0352e0, counter=counter@entry=0x7f65e40578fc, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x7f65e4057a30, has_prelocking_list=has_prelocking_list@entry=false, ot_ctx=0x7f65e4057860) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/sql_base.cc:3862
|
#5 0x000056239e909870 in open_tables (thd=thd@entry=0x7f65fc0236e8, options=..., start=start@entry=0x7f65e40578e8, counter=counter@entry=0x7f65e40578fc, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x7f65e4057a30) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/sql_base.cc:4346
|
#6 0x000056239e90a067 in open_and_lock_tables (thd=thd@entry=0x7f65fc0236e8, options=..., tables=<optimized out>, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x7f65e4057a30) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/sql_base.cc:5319
|
#7 0x000056239ea837b7 in open_and_lock_tables (flags=0, derived=true, tables=<optimized out>, thd=0x7f65fc0236e8) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/sql_base.h:512
|
#8 mysql_create_view (thd=thd@entry=0x7f65fc0236e8, views=views@entry=0x7f65fc033758, mode=VIEW_CREATE_OR_REPLACE) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/sql_view.cc:466
|
#9 0x000056239e98ce80 in mysql_execute_command (thd=thd@entry=0x7f65fc0236e8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/sql_parse.cc:5828
|
#10 0x000056239e974a13 in mysql_parse (thd=thd@entry=0x7f65fc0236e8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x7f65e40583a0) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/sql_parse.cc:8050
|
#11 0x000056239e982f3c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7f65fc0236e8, packet=packet@entry=0x7f65fc01e079 " CREATE OR REPLACE ALGORITHM = UNDEFINED VIEW view_2 AS SELECT /* QUERY_ID: 10715136 */ /* RESULTSET_SAME_DATA_IN_EVERY_ROW */ func_1 ( `col_int_key` ) AS `col_int_key`\nFROM view_1\n /* E_R Thread5 QNO"...,
|
packet_length=packet_length@entry=218, blocking=blocking@entry=true) at /data/Server/bb-10.6-MDEV-32050-rerebase/sql/sql_class.h:1403
|
All MDL waiters are:
| Thread |
statement |
| 3 |
CREATE OR REPLACE ALGORITHM = UNDEFINED VIEW view_2 … FROM view_1 … |
| 20 |
CREATE OR REPLACE ALGORITHM = MERGE VIEW view_2 … FROM view_1 … |
| 21 |
ALTER ALGORITHM = TEMPTABLE VIEW view_1 AS SELECT 2 AS col_int_key FROM view_2 WHERE func_2 ( col_int_key ) < 7 |
| 26 |
CREATE OR REPLACE ALGORITHM = UNDEFINED VIEW view_2 AS SELECT 6 AS col_int_key FROM view_1 |
| 27 |
CREATE OR REPLACE VIEW view_2 AS SELECT … FROM view_1 |
| 29 |
CREATE OR REPLACE VIEW view_1 AS SELECT … FROM view_2 |
| 30 |
CREATE OR REPLACE VIEW view_1 AS SELECT … FROM view_2 |
| 33 |
CREATE OR REPLACE VIEW view_2 AS SELECT … FROM view_1 |
| 37 |
CREATE OR REPLACE VIEW view_1 AS SELECT … FROM view_2 |
Without knowing this code, I would guess that the minimum test case involves two threads. Apparently, there is no deadlock detector for MDL requests or it is not working. It could also be that the timeout logic is not working or timeout errors are being ignored in this code. I would guess that one of the threads is holding MDL on view_1 and waiting for MDL on view_2, while another is doing the opposite.
|