• Marko Mäkelä's avatar
    MDEV-19586 Replace recv_sys_t::addr_hash with a std::map · 177a571e
    Marko Mäkelä authored
    InnoDB crash recovery buffers redo log records in a hash table.
    The function recv_read_in_area() would pick a random hash bucket
    and then try to submit read requests for a few nearby pages.
    Let us replace the recv_sys.addr_hash with a std::map, which will
    automatically be iterated in sorted order.
    
    recv_sys_t::pages: Replaces recv_sys_t::addr_hash, recv_sys_t::n_addrs.
    
    recv_sys_t::recs: Replaces most of recv_addr_t.
    
    recv_t: Encapsulate a raw singly-linked list of records. This reduces
    overhead compared to std::forward_list. Storage and cache overhead,
    because the next-element pointer also points to the data payload.
    Processing overhead, because recv_sys_t::recs_t::last will point to
    the last record, so that recv_sys_t::add() can append straight to the
    end of the list.
    
    RECV_PROCESSED, RECV_DISCARDED: Remove. When a page is fully processed,
    it will be deleted from recv_sys.pages.
    
    recv_sys_t::trim(): Replaces recv_addr_trim().
    
    recv_sys_t::add(): Use page_id_t for identifying pages.
    
    recv_fold(), recv_hash(), recv_get_fil_addr_struct(): Remove.
    
    recv_read_in_area(): Simplify the iteration.
    177a571e
fil0fil.h 54 KB