[MDEV-12227] Defer writes to the InnoDB temporary tablespace Created: 2017-03-10  Updated: 2022-05-31  Resolved: 2020-12-09

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: 10.5.9, 10.6.0

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

Issue Links:
Blocks
is blocked by MDEV-12226 Avoid writes of freed (garbage) pages... Closed
is blocked by MDEV-15528 Avoid writing freed InnoDB pages Closed
is blocked by MDEV-23399 10.5 performance regression with IO-b... Closed
PartOf
is part of MDEV-16526 Overhaul the InnoDB page flushing Closed
Problem/Incident
causes MDEV-24659 Assertion `!fsp_is_system_temporary(b... Closed
Relates
relates to MDEV-12367 Upgrade from previous versions to 10.... Closed
relates to MDEV-26782 InnoDB temporary tablespace: reclaimi... Closed
relates to MDEV-27716 mtr_t::commit() unnecessarily acquire... Closed
relates to MDEV-28699 Shrink temporary tablespaces without ... Closed
relates to MDEV-23754 Replace buf_pool.flush_list with a pr... Closed

 Description   

The flushing of the InnoDB temporary tablespace is unnecessarily tied to the write-ahead redo logging and the flushing of the persistent tablespaces.
We should avoid any writes to the temporary tablespace, unless the pages are being evicted from the buffer pool and going to be reused.

I think that we should simply omit any pages of temporary tables from buf_pool.flush_list. This would allow us to remove the loop in buf_flush_wait_flushed(), among other things. The refactored LRU flushing of MDEV-23399 would have to be refined further to initiate writes of pages of temporary tables. And any code that invokes a page flush before invalidating or resizing the buffer pool will have to be adjusted. On shutdown, we can obviously discard any writes of temporary pages, but when shrinking the buffer pool we must preserve such data.

There is no need to care about the LSN in the temporary tablespace, because the changes are never going to be logged or recovered.



 Comments   
Comment by Marko Mäkelä [ 2020-12-08 ]

I think that this is best done in 10.5. Having any temporary tablespace pages in buf_pool.flush_list is unnecessarily complicating the page cleaner logic.

Generated at Thu Feb 08 07:56:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.