[MDEV-33360] fil_node_t::handle had better not be protected by fil_system.mutex Created: 2024-02-02  Updated: 2024-02-02

Status: Confirmed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4
Fix Version/s: 10.6, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Vladislav Lesin
Resolution: Unresolved Votes: 1
Labels: performance

Issue Links:
Relates
relates to MDEV-32027 Opening all .ibd files on InnoDB star... Closed
relates to MDEV-33357 ALTER TABLE ... IMPORT TABLESPACE cau... Open

 Description   

Currently, opening and closing InnoDB data files is protected by fil_system.mutex. Based on MDEV-32027, opening files may incur some overhead. Scalability could be better if opening and closing file handles was protected by the something in the fil_space_t of the affected tablespace, rather than by the InnoDB-wide fil_system.mutex.

Initially I thought that we could use fil_space_t::latch, but it seems to be better to introduce a separate srw_mutex for protecting the file handles, because fil_space_t::latch can be held in operations that are allocating or freeing pages inside a tablespace. Such operations could involve page I/O, which in turn could require opening and closing data files.


Generated at Thu Feb 08 10:38:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.