[MDEV-30209] Race condition between fil_node_open_file() and renaming files Created: 2022-12-12  Updated: 2022-12-12  Resolved: 2022-12-12

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.6.9, 10.7.5, 10.8.4, 10.9.2, 10.10.1, 10.6.10, 10.7.6, 10.8.5, 10.9.3, 10.6.11, 10.7.7, 10.8.6, 10.9.4, 10.10.2, 10.11.1
Fix Version/s: 10.11.2, 10.6.12, 10.7.8, 10.8.7, 10.9.5, 10.10.3

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: race, regression-10.6, rr-profile-analyzed

Issue Links:
Problem/Incident
is caused by MDEV-28870 InnoDB: Missing FILE_CREATE, FILE_DEL... Closed

 Description   

mleich reported this file testing MDEV-30136:

#5  0x0000556bcc528d01 in ut_dbg_assertion_failed (expr=expr@entry=0x556bcd4792e0 "success", file=file@entry=0x556bcd47d280 "/data/Server/bb-10.11-new-innodb-defaults/storage/innobase/fil/fil0fil.cc", line=line@entry=1385)
    at /data/Server/bb-10.11-new-innodb-defaults/storage/innobase/ut/ut0dbg.cc:60
#6  0x0000556bcc759aca in fil_space_t::reopen_all () at /data/Server/bb-10.11-new-innodb-defaults/storage/innobase/fil/fil0fil.cc:1385
#7  0x0000556bcc759ddc in fil_system_t::set_buffered (this=0x556bceb772c0 <fil_system>, buffered=<optimized out>) at /data/Server/bb-10.11-new-innodb-defaults/storage/innobase/fil/fil0fil.cc:1432
#8  0x0000556bcbfbca0b in innodb_data_file_buffering_update (save=0x6290001094d0) at /data/Server/bb-10.11-new-innodb-defaults/storage/innobase/handler/ha_innodb.cc:18336

This crash occurs in some code that being is introduced in MDEV-30136, for closing and reopening all InnoDB data files to modify their parameters. A file was not found because concurrently, another thread was renaming the file.

A similar failure seems possible in fil_node_open_file() when the file that had been previously closed due to innodb_open_files and fil_space_t::try_to_close(), is being renamed at the same time when it is being opened.

Before MDEV-28870, the rename operation was being protected by fil_system.mutex. Holding fil_system.mutex across the rename operation made the problem go away in MDEV-30136.


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