• Marko Mäkelä's avatar
    MDEV-21351 Replace recv_sys.heap with list of buf_block_t · 50324ce6
    Marko Mäkelä authored
    InnoDB crash recovery used a special type of mem_heap_t that
    allocates backing store from the buffer pool. That incurred
    a significant overhead, leading to underutilization of memory,
    and limiting the maximum contiguous allocated size of a log record.
    
    recv_sys_t::blocks: A linked list of buf_block_t that are allocated
    by buf_block_alloc() for redo log records. Replaces recv_sys_t::heap.
    We repurpose buf_block_t::unzip_LRU for linking the elements.
    
    recv_sys_t::max_log_blocks: Renamed from recv_n_pool_free_frames.
    
    recv_sys_t::max_blocks(): Accessor for max_log_blocks.
    
    recv_sys_t::alloc(): Allocate memory from the current recv_sys_t::blocks
    element, or allocate another block.  In debug builds, various free()
    member functions must be invoked, because we repurpose
    buf_page_t::buf_fix_count for tracking allocations.
    
    recv_sys_t::free_corrupted_page(): Renamed from recv_recover_corrupt_page()
    
    recv_sys_t::is_memory_exhausted(): Renamed from recv_sys_heap_check()
    
    recv_sys_t::pages and its elements are allocated directly by the
    system memory allocator.
    
    recv_parse_log_recs(): Remove the parameter available_memory.
    
    We rename some variables 'store_to_hash' to 'store', because
    recv_sys.pages is not actually a hash table.
    
    This is joint work with Thirunarayanan Balathandayuthapani.
    50324ce6
xtrabackup.cc 174 KB