• Marko Mäkelä's avatar
    MDEV-25776 Race conditions in buf_pool.page_hash around buf_pool.watch · 6e3bd663
    Marko Mäkelä authored
    Any modification of buf_pool.page_hash is supposed to be protected
    by buf_pool.mutex and page_hash_latch::write_lock(). The buffer pool
    watch mechanism of the InnoDB change buffer was violating that
    ever since commit b1ab211d (MDEV-15053).
    
    buf_pool_t::watch_set(): Extend the critical section of buf_pool.mutex.
    
    buf_pool_t::watch_unset(): Define non-inline, because
    calls are infrequent and this function became larger.
    If we have to detach a sentinel from page_hash,
    do it while holding both the mutex and the exclusive hash latch.
    
    buf_pool_t::watch_remove(): Assert that the mutex is being held.
    
    buf_page_init_for_read(): Remove some work-arounds for
    previously encountered race conditions related to buf_pool.watch.
    6e3bd663
buf0buf.h 79.1 KB