MySQL 26.7.0
Source Code Documentation
dblwr::recv::DBLWR Class Reference

Redo recovery configuration. More...

#include <buf0dblwr.h>

Public Member Functions

 DBLWR () noexcept
 Constructor. More...
 
 ~DBLWR () noexcept
 Destructor. More...
 
bool empty () const noexcept
 
dberr_t load () noexcept
 Load the doublewrite buffer pages. More...
 
void recover (fil_space_t &space) noexcept
 Restore corrupted pages of the tablespace from the double write buffer. More...
 
const byteget_first_page_content_for_recovery (space_id_t space_id, page_size_t page_size, const std::string &file_path, const byte *page_content) noexcept
 Checks if content of the first page provided from the specified space requires recovery from the Double-write Buffer. More...
 
void check_missing_tablespaces () noexcept
 Check if some pages from the double write buffer could not be restored because of the missing tablespace IDs. More...
 
void recovered () noexcept
 Note that recovery is complete. More...
 
 DBLWR (const DBLWR &)=delete
 Disable copying. More...
 
 DBLWR (DBLWR &&)=delete
 
DBLWRoperator= (DBLWR &&)=delete
 
DBLWRoperator= (const DBLWR &)=delete
 

Private Attributes

Pagesm_pages {}
 Pages read from the double write file. More...
 

Detailed Description

Redo recovery configuration.

Constructor & Destructor Documentation

◆ DBLWR() [1/3]

dblwr::recv::DBLWR::DBLWR ( )
inlineexplicitnoexcept

Constructor.

◆ ~DBLWR()

dblwr::recv::DBLWR::~DBLWR ( )
inlinenoexcept

Destructor.

◆ DBLWR() [2/3]

dblwr::recv::DBLWR::DBLWR ( const DBLWR )
delete

Disable copying.

◆ DBLWR() [3/3]

dblwr::recv::DBLWR::DBLWR ( DBLWR &&  )
delete

Member Function Documentation

◆ check_missing_tablespaces()

void dblwr::recv::DBLWR::check_missing_tablespaces ( )
inlinenoexcept

Check if some pages from the double write buffer could not be restored because of the missing tablespace IDs.

◆ empty()

bool dblwr::recv::DBLWR::empty ( ) const
inlinenoexcept
Returns
true if empty.

◆ get_first_page_content_for_recovery()

const byte * dblwr::recv::DBLWR::get_first_page_content_for_recovery ( space_id_t  space_id,
page_size_t  page_size,
const std::string &  file_path,
const byte page_content 
)
inlinenoexcept

Checks if content of the first page provided from the specified space requires recovery from the Double-write Buffer.

If the supplied page_content has a valid not corrupted page, no action is taken. If it is not, then we try to get a non-corrupted copy from the Double-write Buffer. If there are any entries in the Reduced Double-write pages list, we may crash.

Parameters
[in]space_idID of the space to be checked.
[in]page_sizePage size structure to use for the tablespace page manipulation.
[in]file_pathPath of a file to be used for error reporting.
[in]page_contentContent of the first page of the specified tablespace read from the disk. The buffer must hold at least page_size.physical() bytes.
Returns
pointer to page_content if the page does not require recovery, a pointer to page contents from the Double-write Buffer or nullptr if page_content is corrupted, but there's no valid image of it in the Double-write Buffer to restore it from

◆ load()

dberr_t dblwr::recv::DBLWR::load ( )
inlinenoexcept

Load the doublewrite buffer pages.

Doesn't create the doublewrite

Returns
DB_SUCCESS or error code

◆ operator=() [1/2]

DBLWR & dblwr::recv::DBLWR::operator= ( const DBLWR )
delete

◆ operator=() [2/2]

DBLWR & dblwr::recv::DBLWR::operator= ( DBLWR &&  )
delete

◆ recover()

void dblwr::recv::DBLWR::recover ( fil_space_t space)
inlinenoexcept

Restore corrupted pages of the tablespace from the double write buffer.

Iterates over the previously loaded double write buffer pages, but only ones that are not corrupted, searching for mentions of pages from the specified space, and for each such page checks if tablespace file contains a corrupted version of it and if so, restores it from the backup in image found in double write buffer page, unless this is impossible because the double write buffer page does not contain the body (in reduced, detect-only mode). In case of any errors (IO errors, out of bounds space access) we crash the server.

Parameters
[in]spaceTablespace to restore pages in.

◆ recovered()

void dblwr::recv::DBLWR::recovered ( )
inlinenoexcept

Note that recovery is complete.

Adjust the file sizes if necessary.

Member Data Documentation

◆ m_pages

Pages* dblwr::recv::DBLWR::m_pages {}
private

Pages read from the double write file.


The documentation for this class was generated from the following file: