• Thirunarayanan Balathandayuthapani's avatar
    MDEV-24695 Encryption modifies a freed page · 6e80a34d
    Thirunarayanan Balathandayuthapani authored
    During recovery, InnoDB fails if it tries to apply a FREE_PAGE
    and WRITE record to the page. InnoDB encryption thread accesses
    the freed page and writes redo log for it.
    
    This is similar to commit deadec4e (MDEV-24569)
    InnoDB is missing buf_page_free() while freeing the segment.
    To avoid accessing of freed page in buffer pool, InnoDB should
    mark the pages as FREED while freeing the segment. Also to
    avoid reading of freed page, InnoDB should check the
    allocation bitmap page.
    
    fseg_free_step(): Mark the page in buffer pool as FREED
    
    fseg_free_step_not_header(): Mark the page in buffer pool as FREED
    
    buf_dump(): Ignore the freed pages while dumping the buffer pool content
    
    fil_crypt_get_page_throttle_func(): Skip the rotation for FREED page
    to avoid the assert failure during recovery
    
    fil_crypt_rotate_page(): Skip the rotation for the freed page
    
    Reviewed-by: Marko Mäkelä
    6e80a34d
fsp0fsp.cc 87.5 KB