[MDEV-18343] InnoDB: DEADLOCK of threads detected: Mutex RW_LOCK_LIST / Mutex DICT_SYS upon CREATE TABLE .. SELECT * FROM INFORMATION_SCHEMA.`INNODB_MUTEXES` Created: 2019-01-22 Updated: 2020-01-28 Resolved: 2020-01-28 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.1.3, 10.2.0, 10.3.0, 10.4.0 |
| Fix Version/s: | 10.4.3, 10.2.22, 10.3.13, 10.1.39 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
All threads' stack trace is attached. It's not reproducible right away, but maybe the stack traces will be enough. If not, please return it to me. Notes on the origin of the report
|
| Comments |
| Comment by Marko Mäkelä [ 2019-01-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I tried and failed to repeat this with the following:
That said, code review suggests that the bug is very possible. The key could be the ORDER BY or some buffering which can cause calls to Field::store() or similar to fail.
If this macro causes a return from i_s_innodb_mutexes_fill_table(), then a call to mutex_exit(&rw_lock_list_mutex) would be skipped. The function sync_arr_fill_sys_semphore_waits_table that was added at the same time to implement INFORMATION_SCHEMA.INNODB_SEMAPHORE_WAITS does not appear to suffer from a deadlock, but instead it appears to suffer from race conditions, because the access to the global data structure is not being protected by anything. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Elena Stepanova [ 2019-01-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Here is another variation, hopefully the same problem. This one happened on server shutdown.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-02-05 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
threads_full.2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2019-08-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This is possibly a duplicate of | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2020-01-28 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I think that this is rather obviously a deadlock of I tried again, and finally figured out how to make the schema_table_store_record() fail:
invoked as
with the following patch to reintroduce
It will crash the debug build:
With the minimal patch (to only ensure that there will be output), there is no crash:
Without this patch, the CREATE…SELECT would succeed despite the fault injection, because ha_maria::write_row() would not be called. |