• Marko Mäkelä's avatar
    MDEV-32820 Race condition between trx_purge_free_segment() and trx_undo_create() · de31ca6a
    Marko Mäkelä authored
    trx_purge_free_segment(): If fseg_free_step_not_header() needs to be
    called multiple times, acquire an exclusive latch on the
    rollback segment header page after restarting the mini-transaction
    so that the rest of this function cannot execute concurrently
    with trx_undo_create() on the same rollback segment.
    
    This fixes a regression that was introduced in
    commit c14a3943 (MDEV-30753).
    
    Note: The buffer-fixes that we are holding across the mini-transaction
    restart will prevent the pages from being evicted from the buffer pool.
    They may be accessed by other threads or written back to data files
    while we are not holding exclusive latches.
    
    Reviewed by: Vladislav Lesin
    de31ca6a
trx0purge.cc 36.3 KB