Split LRU flushes to a separate thread
Implement a new XtraDB utility thread that performs LRU flushes and evictions to refill the free lists.
Currently, this is done by the page cleaner thread together with the flush list flushes. The motivation for a separate thread is the following:
- The cleaner thread sleep time has to take into account both LRU and flush list needs, by using the shorter sleep time of the times requested by both. This means that the code paths for the other one is called at times needlessly.
- LRU/flush list flushes in the cleaner are serialized, which may cause transient stalls (up to LRU/flush list flush timeout values, which are 1 second by default) for user threads in the cases of empty free lists and large checkpoint age at the same time.
- Implementation of [1] adjusted flush list page flush suitability condition to skip latched pages. This means that flush list flushes may fail to advance checkpoint age because the oldest dirty page might be latched. They will still flush other pages, and eventually will flush the oldest page too. This behaviour increases query thread latency variability and causes sawtooth checkpoint age pattern. Splitting out LRU flushes to their own thread allows to revert to the old flush list page flush condition, solving both of these problems.
- Since the free list use pattern is not uniform across buffer pool instances, longer term, we might want to investigate separate LRU threads for each instance. This is a step towards that direction.
- Make [1] available for innodb_read_only mode, where the cleaner thread is not running.
Reuse innodb_
[1] https:/
Blueprint information
- Status:
- Complete
- Approver:
- Stewart Smith
- Priority:
- High
- Drafter:
- Laurynas Biveinis
- Direction:
- Approved
- Assignee:
- Laurynas Biveinis
- Definition:
- Approved
- Series goal:
- Accepted for 5.6
- Implementation:
- Implemented
- Milestone target:
- 5.6.16-64.0
- Started by
- Laurynas Biveinis
- Completed by
- Laurynas Biveinis