• Marko Mäkelä's avatar
    MDEV-25062: Reduce trx_rseg_t::mutex contention · 6e12ebd4
    Marko Mäkelä authored
    redo_rseg_mutex, noredo_rseg_mutex: Remove the PERFORMANCE_SCHEMA keys.
    The rollback segment mutex will be uninstrumented.
    
    trx_sys_t: Remove pointer indirection for rseg_array, temp_rseg.
    Align each element to the cache line.
    
    trx_sys_t::rseg_id(): Replaces trx_rseg_t::id.
    
    trx_rseg_t::ref: Replaces needs_purge, trx_ref_count, skip_allocation
    in a single std::atomic<uint32_t>.
    
    trx_rseg_t::latch: Replaces trx_rseg_t::mutex.
    
    trx_rseg_t::history_size: Replaces trx_sys_t::rseg_history_len
    
    trx_sys_t::history_size_approx(): Replaces trx_sys.rseg_history_len
    in those places where the exact count does not matter. We must not
    acquire any trx_rseg_t::latch while holding index page latches, because
    normally the trx_rseg_t::latch is acquired before any page latches.
    
    trx_sys_t::history_exists(): Replaces trx_sys.rseg_history_len!=0
    with an approximation.
    
    We remove some unnecessary trx_rseg_t::latch acquisition around
    trx_undo_set_state_at_prepare() and trx_undo_set_state_at_finish().
    Those operations will only access fields that remain constant
    after trx_rseg_t::init().
    6e12ebd4
srv0srv.cc 61.8 KB