MySQL 26.7.0
Source Code Documentation
dblwr::recv Namespace Reference

Classes

class  DBLWR
 Redo recovery configuration. More...
 
struct  Page
 Page recovered from the doublewrite buffer. More...
 
struct  Page_entry
 A record from reduced doublewrite buffer. More...
 
class  Pages
 Pages recovered from the doublewrite buffer. More...
 

Functions

static std::pair< std::string, page_no_tget_node_and_page_no_for_error (const fil_space_t &space, const page_id_t page_id)
 Helper method to calculate name of file and page offset inside it for reporting errors during Double-write recovery. More...
 
dberr_t reduced_load (recv::Pages *pages) noexcept
 Load the doublewrite buffer pages. More...
 
void create (Pages *&pages) noexcept
 Create the recovery dblwr data structures. More...
 
dberr_t load (Pages *pages) noexcept
 Load the doublewrite buffer pages. More...
 
void recover (Pages &pages, fil_space_t &space) noexcept
 Restore corrupted pages of the tablespace from the double write buffer. More...
 
const byteget_first_page_content_for_recovery (const recv::Pages &pages, space_id_t space_id, page_size_t page_size, const std::string &file_path, const byte *page_content)
 Checks if content of the first page provided from the specified space requires recovery from the Double-write Buffer. More...
 
void check_missing_tablespaces (const Pages *pages) noexcept
 Check if some pages from the double write buffer could not be restored because of the missing tablespace IDs. More...
 
void destroy (Pages *&pages) noexcept
 Free the recovery dblwr data structures. More...
 

Function Documentation

◆ check_missing_tablespaces()

void dblwr::recv::check_missing_tablespaces ( const Pages pages)
noexcept

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

Parameters
[in]pagesPages to check

◆ create()

void dblwr::recv::create ( recv::Pages *&  pages)
noexcept

Create the recovery dblwr data structures.

Parameters
[out]pagesPointer to newly created instance

◆ destroy()

void dblwr::recv::destroy ( recv::Pages *&  pages)
noexcept

Free the recovery dblwr data structures.

Parameters
[out]pagesInstance of the Pages to free.

◆ get_first_page_content_for_recovery()

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

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]pagesThe Double-write pages read from the Double-write Buffer.
[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, 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

◆ get_node_and_page_no_for_error()

static std::pair< std::string, page_no_t > dblwr::recv::get_node_and_page_no_for_error ( const fil_space_t space,
const page_id_t  page_id 
)
static

Helper method to calculate name of file and page offset inside it for reporting errors during Double-write recovery.

◆ load()

dberr_t dblwr::recv::load ( recv::Pages pages)
noexcept

Load the doublewrite buffer pages.

Parameters
[in,out]pagesFor storing the doublewrite pages read from the double write buffer
Returns
DB_SUCCESS or error code

◆ recover()

void dblwr::recv::recover ( recv::Pages pages,
fil_space_t space 
)
noexcept

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

Iterates over the supplied 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,out]pagesPages from the doublewrite buffer
[in]spaceTablespace to restore pages in.

◆ reduced_load()

dberr_t dblwr::recv::reduced_load ( recv::Pages pages)
noexcept

Load the doublewrite buffer pages.

Parameters
[in,out]pagesFor storing the doublewrite pages read from the double write buffer
Returns
DB_SUCCESS or error code