• Marko Mäkelä's avatar
    MDEV-32552 Write-ahead logging is broken for freed pages · b5e43a1d
    Marko Mäkelä authored
    buf_page_free(): Flag the freed page as modified if it is found in
    the buffer pool.
    
    buf_flush_page(): If the page has been freed, ensure that the log
    for it has been durably written, before removing the page
    from buf_pool.flush_list.
    
    FindBlockX: Find also MTR_MEMO_PAGE_X_MODIFY in order to avoid an
    occasional failure of innodb.innodb_defrag_concurrent, which involves
    freeing and reallocating pages in the same mini-transaction.
    
    This fixes a regression that was introduced in
    commit a35b4ae8 (MDEV-15528).
    
    This logic was tested by commenting out the $shutdown_timeout line
    from a test and running the following:
    
    ./mtr --rr innodb.scrub
    rr replay var/log/mysqld.1.rr/mariadbd-0
    
    A breakpoint in the modified buf_flush_page() was hit, and the
    FIL_PAGE_LSN of that page had been last modified during the
    mtr_t::commit() of a mini-transaction where buf_page_free()
    had been executed on that page.
    b5e43a1d
buf0buf.cc 129 KB