[MDEV-13196] Remove handler::store_lock() Created: 2017-06-28  Updated: 2022-08-02

Status: Open
Project: MariaDB Server
Component/s: Locking, Storage Engine - InnoDB
Fix Version/s: 11.0

Type: Task Priority: Major
Reporter: Sergey Vojtovich Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: deadlock

Issue Links:
Relates
relates to MDEV-12070 Introduce thd_query_safe() from MySQL... Closed
relates to MDEV-11896 thd_get_error_context_description rac... Closed
relates to MDEV-13983 Mariadb becomes unresponsive Closed
relates to MDEV-16467 MariaDB crashes because of "long sema... Closed

 Description   

There's potential deadlock between "thread killing another thread that has open InnoDB HANDLER or delayed insert thread performing insert into InnoDB table" and "InnoDB service threads like srv_monitor_thread that calls thd_get_error_context_description".

I doubt MariaDB is affected, because it does try_lock in thd_get_error_context_description, see 6e9a48b67fceab17089ca4cd1406e302386a601b.

But anyway, since InnoDB doesn't use thr_lock anymore, it is probably a good idea to get rid of ha_innobase::store_lock() by moving some code to external_lock. Note: compared to store_lock external_lock can be called for temporary tables too.



 Comments   
Comment by Marko Mäkelä [ 2020-12-17 ]

As far as I can tell, MDEV-11896 changed the potential deadlock to a real deadlock. It was semi-accidentally fixed later, as noted in MDEV-13983.

I think that it would be very welcome to remove ha_innobase::store_lock() and to simplify the locking logic. I wonder why that was not done when MDL was introduced.

Generated at Thu Feb 08 08:03:40 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.