• Marko Mäkelä's avatar
    MDEV-24348 InnoDB shutdown hang with innodb_flush_sync=0 · aa0e3805
    Marko Mäkelä authored
    This hang was caused by MDEV-23855, and we failed to fix it in
    MDEV-24109 (commit 4cbfdeca).
    
    When buf_flush_ahead() is invoked soon before server shutdown
    and the non-default setting innodb_flush_sync=OFF is in effect
    and the buffer pool contains dirty pages of temporary tables,
    the page cleaner thread may remain in an infinite loop
    without completing its work, thus causing the shutdown to hang.
    
    buf_flush_page_cleaner(): If the buffer pool contains no
    unmodified persistent pages, ensure that buf_flush_sync_lsn= 0
    will be assigned, so that shutdown will proceed.
    
    The test case is not deterministic. On my system, it reproduced
    the hang with 95% probability when running multiple instances
    of the test in parallel, and 4% when running single-threaded.
    
    Thanks to Eugene Kosov for debugging and testing this.
    aa0e3805
buf0flu.cc 71.7 KB