• Marko Mäkelä's avatar
    MDEV-25113: Introduce a page cleaner mode before 'furious flush' · 6441bc61
    Marko Mäkelä authored
    MDEV-23855 changed the way how the page cleaner is signaled by
    user threads. If a threshold is exceeded, a mini-transaction commit
    would invoke buf_flush_ahead() in order to initiate page flushing
    before all writers would eventually grind to halt in
    log_free_check(), waiting for the checkpoint age to reduce.
    
    However, buf_flush_ahead() would always initiate 'furious flushing',
    making the buf_flush_page_cleaner thread write innodb_io_capacity_max
    pages per batch, and sleeping no time between batches, until the
    limit LSN is reached. Because this could saturate the I/O subsystem,
    system throughput could significantly reduce during these
    'furious flushing' spikes.
    
    With this change, we introduce a gentler version of flush-ahead,
    which would write innodb_io_capacity_max pages per second until
    the 'soft limit' is reached.
    
    buf_flush_ahead(): Add a parameter to specify whether furious flushing
    is requested.
    
    buf_flush_async_lsn: Similar to buf_flush_sync_lsn, a limit for
    the less intrusive flushing.
    
    buf_flush_page_cleaner(): Keep working until buf_flush_async_lsn
    has been reached.
    
    log_close(): Suppress a warning message in the event that a new log
    is being created during startup, when old logs did not exist.
    Return what type of page cleaning will be needed.
    
    mtr_t::finish_write(): Also when m_log.is_small(), invoke log_close().
    Return what type of page cleaning will be needed.
    
    mtr_t::commit(): Invoke buf_flush_ahead() based on the return value of
    mtr_t::finish_write().
    6441bc61
buf0flu.cc 77.6 KB