• Thirunarayanan Balathandayuthapani's avatar
    MDEV-32968 InnoDB fails to restore tablespace first page from doublewrite... · caad34df
    Thirunarayanan Balathandayuthapani authored
    MDEV-32968  InnoDB fails to restore tablespace first page from doublewrite buffer when page is empty
    
    - InnoDB fails to find the space id from the page0 of
    the tablespace. In that case, InnoDB can use
    doublewrite buffer to recover the page0 and write
    into the file.
    
    - buf_dblwr_t::init_or_load_pages(): Loads only the pages
    which are valid.(page lsn >= checkpoint). To do that,
    InnoDB has to open the redo log before system
    tablespace, read the latest checkpoint information.
    
    recv_dblwr_t::find_first_page():
    1) Iterate the doublewrite buffer pages and find the 0th page
    2) Read the tablespace flags, space id from the 0th page.
    3) Read the 1st, 2nd and 3rd page from tablespace file and
    compare the space id with the space id which is stored
    in doublewrite buffer.
    4) If it matches then we can write into the file.
    5) Return space which matches the pages from the file.
    
    SysTablespace::read_lsn_and_check_flags(): Remove the
    retry logic for validating the first page. After
    restoring the first page from doublewrite buffer,
    assign tablespace flags by reading the first page.
    
    recv_recovery_read_max_checkpoint(): Reads the maximum
    checkpoint information from log file
    
    recv_recovery_from_checkpoint_start(): Avoid reading
    the checkpoint header information from log file
    
    Datafile::validate_first_page(): Throw error in case
    of first page validation fails.
    caad34df
doublewrite_debug.test 6.01 KB