[MDEV-19356] Assertion 'space->free_limit == 0 || space->free_limit == free_limit' Created: 2019-04-29  Updated: 2019-04-29  Resolved: 2019-04-29

Status: Closed
Project: MariaDB Server
Component/s: mariabackup, Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.2.24, 10.3.15, 10.4.5

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: corruption

Issue Links:
Blocks
blocks MDEV-19346 Assertion `recv_sys->mlog_checkpoint_... Closed
Relates
relates to MDEV-16526 Overhaul the InnoDB page flushing Closed

 Description   

The following assertion could fail during InnoDB crash recovery or mariabackup --prepare if data files with unflushed changes were closed by fil_system->LRU and later reopened due to pending I/O:

10.2 bb4f4b3a1b6c9287fcef6a6d290fd228e8a181f1

mariabackup: /mariadb/10.2/storage/innobase/fil/fil0fil.cc:582: bool fil_node_t::read_page0(bool): Assertion `space->free_limit == 0 || space->free_limit == free_limit' failed.

It is possible that this has been broken ever since MariaDB 10.2.2, which incorporated the InnoDB changes from MySQL 5.7.9. The fil_space_t fields are a recent addition.

The problem is that the function fil_node_t::read_page0() is replacing the up-to-date metadata with an old version of page 0 that is being reread from the file. A more up-to-date page 0 still exists in the buffer pool, not flushed yet.

This crash was initially reported in MDEV-19346 with a nondeterministic test case, but it should be unrelated to the original topic of MDEV-19346.

In MDEV-16526, perhaps we could make it so that before files are closed, an attempt to write back any unflushed changes will be performed.


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