[MDEV-27058] Buffer page descriptors are too large Created: 2021-11-16  Updated: 2023-08-01  Resolved: 2021-11-18

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.6, 10.7, 10.8
Fix Version/s: 10.6.6, 10.7.2

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

Issue Links:
Blocks
blocks MDEV-26827 Make page flushing even faster Closed
is blocked by MDEV-18724 Replace buf_block_t::mutex with more ... Closed
Problem/Incident
causes MDEV-27414 Server may hang when innodb_undo_log_... Closed
causes MDEV-27476 heap-use-after-free in buf_pool_t::is... Closed
causes MDEV-27924 page_zip_copy_recs() corrupts ROW_FOR... Closed
causes MDEV-27983 InnoDB hangs on multiple concurrent r... Closed
causes MDEV-28484 InnoDB encryption key rotation is not... Closed
causes MDEV-29190 10.6.8 (+uring compiled in but not us... Closed
causes MDEV-29996 Duplicated call to buf_page_t::set_ib... Closed
causes MDEV-31390 Assertion id.is_corrupted() failed in... Closed
Relates
relates to MDEV-30134 buf_page_t::unfix(): Assertion `!((f ... Closed
relates to MDEV-31343 Another server hang with innodb_undo_... Closed
relates to MDEV-31816 buf_LRU_free_page() does not preserve... Closed
relates to MDEV-22367 Remove write support for ROW_FORMAT=C... Closed
relates to MDEV-23158 False negatives from buf_pool.is_unco... Closed
relates to MDEV-24142 rw_lock_t has unnecessarily complex w... Closed
relates to MDEV-31767 InnoDB tables are being flagged as co... Closed

 Description   

MDEV-24142 reduced the size of buffer pool page descriptors, but the descriptors could still be smaller. Furthermore, ROW_FORMAT=COMPRESSED pages use convoluted locking rules, because no page latch would be available for blocks whose uncompressed page has been discarded.

In particular:

  • The slot for the write buffer of page_compressed or encrypted tables can be moved to IORequest, because it is only needed during asynchronous page write requests.
  • The frame pointer can be moved to buf_page_t. It will only be non-null for the ‘fat’ block descriptor buf_block_t.
  • The lock can be moved to the ‘thin’ buf_page_t; it is only 8 bytes on Linux, OpenBSD, Windows (and other systems, to be implemented in MDEV-26476).
  • The io_fix, buf_fix_count, state can be merged into a single std::atomic<uint32_t> field of page_zip_des_t, using memory that would otherwise be wasted to alignment on 64-bit systems. This field can be modified exclusively by IA-32/AMD64 friedly store(), fetch_add(), or fetch_sub().

Moving lock and frame to buf_page_t will increase its storage size, but this is more than compensated by the removal of slot, io_fix, buf_fix_count.


Generated at Thu Feb 08 09:50:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.