[MDEV-32042] Special handling of crash recovery in buf_page_get_gen() may cause overhead Created: 2023-08-30  Updated: 2023-12-07  Resolved: 2023-12-07

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2
Fix Version/s: 11.0.5, 11.1.4, 11.2.3

Type: Bug Priority: Critical
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: cleanup, performance

Issue Links:
Blocks
is blocked by MDEV-29694 Remove the InnoDB change buffer Closed
is blocked by MDEV-29911 InnoDB recovery and mariadb-backup --... Closed
Problem/Incident
is caused by MDEV-21572 buf_page_get_gen() should apply buffe... Closed
Relates
relates to MDEV-32029 Assertion failures in log_sort_flush_... Closed

 Description   

The fix of bug MDEV-21572 introduced a rarely holding condition in a commonly executed function buf_page_get_gen(), which is only needed while crash recovery is in progress.

Before the last recovery batch is completed by invoking recv_sys.apply(true), we have the following accesses to the buffer pool:

  • Reading the TRX_SYS page (page 5 in the system tablespace) to determine the number of undo tablespaces.
  • Reading the DICT_HDR page (page 7 in the system tablespace) to initialize the maximum tablespace identifier, in dict_boot()
  • Before MDEV-29694 (MariaDB Server 11.0), reading at least 3 pages to initialize the change buffer.
  • Loading the definitions of some system tables. This can be deferred after recv_sys.apply(true) has been called.

If we write a separate function that will be used for these 2 special cases of page access, we can simplify the function buf_page_get_gen(). Furthermore, the function buf_flush_LRU_list_batch() may be simplified so that it can enforce the innodb_io_capacity rate limit during recovery, because recv_sys_t::wait_for_pool() (MDEV-29911) would be able to ensure that enough buffer pool is available.



 Comments   
Comment by Matthias Leich [ 2023-12-04 ]

origin/11.0-MDEV-32042 e1fb69d6a535a6825a0f151b532ae0dc071b01bd 2023-12-01T11:42:00+02:00
performed well in RQG testing.

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