• Marko Mäkelä's avatar
    MDEV-34212 InnoDB transaction recovery is incorrect · 727b5493
    Marko Mäkelä authored
    trx_undo_mem_create_at_db_start(): Invoke recv_sys_t::recover()
    instead of buf_page_get_gen(), so that all undo log pages will be
    recovered correctly. Failure to do this could prevent InnoDB from
    starting up due to "Data structure corruption", or it could
    potentially lead to a situation where InnoDB starts up but some
    transactions were recovered incorrectly.
    
    recv_sys_t::recover(): Only acquire a buffer-fix on the pages,
    not a shared latch. This is adequate protection, because this function
    is only being invoked during early startup when no "users" are modifying
    buffer pool pages. The only writes are due to server bootstrap
    (the data files being created) or crash recovery (changes from
    ib_logfile0 being applied).
    
    buf_page_get_gen(): Assert that the function is not invoked while crash
    recovery is in progress, and that the special mode BUF_GET_RECOVER is
    only invoked during crash recovery or server bootstrap.
    
    All this should really have been part of
    commit 850d6173 (MDEV-32042).
    727b5493
buf0buf.cc 115 KB