MySQL 8.0.39
Source Code Documentation
dblwr::recv::Pages Class Reference

Pages recovered from the doublewrite buffer. More...

Public Types

using Buffers = std::vector< Page *, ut::allocator< Page * > >
 
using Page_entries = std::vector< Page_entry, ut::allocator< Page_entry > >
 

Public Member Functions

 Pages ()
 Default constructor. More...
 
 ~Pages () noexcept
 Destructor. More...
 
void add (page_no_t page_no, const byte *page, uint32_t n_bytes) noexcept
 Add a page frame to the doublewrite recovery buffer. More...
 
void add_entry (Page_entry &pg_entry)
 Add a page entry from reduced doublewrite buffer to vector. More...
 
const bytefind (const page_id_t &page_id) const noexcept
 Find a doublewrite copy of a page. More...
 
bool is_recovered (const page_id_t &page_id) const noexcept
 
bool dblwr_recover_page (page_no_t dblwr_page_no, fil_space_t *space, page_no_t page_no, byte *page) noexcept
 Recover a page from the doublewrite buffer. More...
 
std::tuple< bool, bool > is_actual_page_corrupted (fil_space_t *space, page_id_t &page_id)
 Checks if page in tablespace is corrupted or an all-zero page. More...
 
std::tuple< bool, lsn_tfind_entry (const page_id_t &page_id) const noexcept
 Check if page was logged in reduced doublewrite buffer mode, if so also return the page LSN. More...
 
void recover (fil_space_t *space) noexcept
 Recover double write buffer pages. More...
 
void check_missing_tablespaces () const noexcept
 Check if some pages could be restored because of missing tablespace IDs. More...
 
Buffersget_pages () noexcept
 Object the vector of pages. More...
 

Private Member Functions

void reduced_recover (fil_space_t *space) noexcept
 Check if page is logged in reduced doublewrite buffer. More...
 
 Pages (const Pages &)=delete
 
 Pages (const Pages &&)=delete
 
Pagesoperator= (Pages &&)=delete
 
Pagesoperator= (const Pages &)=delete
 

Private Attributes

Buffers m_pages
 Recovered doublewrite buffer page frames. More...
 
Page_entries m_page_entries
 Page entries from reduced doublewrite buffer. More...
 

Detailed Description

Pages recovered from the doublewrite buffer.

Member Typedef Documentation

◆ Buffers

using dblwr::recv::Pages::Buffers = std::vector<Page *, ut::allocator<Page *> >

◆ Page_entries

Constructor & Destructor Documentation

◆ Pages() [1/3]

dblwr::recv::Pages::Pages ( )
inline

Default constructor.

◆ ~Pages()

dblwr::recv::Pages::~Pages ( )
inlinenoexcept

Destructor.

◆ Pages() [2/3]

dblwr::recv::Pages::Pages ( const Pages )
privatedelete

◆ Pages() [3/3]

dblwr::recv::Pages::Pages ( const Pages &&  )
privatedelete

Member Function Documentation

◆ add()

void recv::Pages::add ( page_no_t  page_no,
const byte page,
uint32_t  n_bytes 
)
noexcept

Add a page frame to the doublewrite recovery buffer.

Parameters
[in]page_noPage number in the doublewrite buffer
[in]pagePage contents
[in]n_bytesSize in bytes

◆ add_entry()

void dblwr::recv::Pages::add_entry ( Page_entry pg_entry)
inline

Add a page entry from reduced doublewrite buffer to vector.

Parameters
[in]pg_entryReduced doublewrite buffer entry

◆ check_missing_tablespaces()

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

Check if some pages could be restored because of missing tablespace IDs.

◆ dblwr_recover_page()

bool dblwr::recv::Pages::dblwr_recover_page ( page_no_t  dblwr_page_no,
fil_space_t space,
page_no_t  page_no,
byte page 
)
noexcept

Recover a page from the doublewrite buffer.

Parameters
[in]dblwr_page_noPage number if the doublewrite buffer
[in]spaceTablespace the page belongs to
[in]page_noPage number in the tablespace
[in]pageData to write to <space, page_no>
Returns
true if page was restored to the tablespace

◆ find()

const byte * recv::Pages::find ( const page_id_t page_id) const
noexcept

Find a doublewrite copy of a page.

Parameters
[in]page_idPage number to lookup
Returns
page frame
Return values
nullptrif no page was found

◆ find_entry()

std::tuple< bool, lsn_t > dblwr::recv::Pages::find_entry ( const page_id_t page_id) const
inlinenoexcept

Check if page was logged in reduced doublewrite buffer mode, if so also return the page LSN.

Note if there are multiple entries of same page, we return the max_LSN of all entries.

Parameters
[in]page_idPage number to lookup
Return values
tuple<0>- true if the page is found in reduced doublewrite buffer, false if no page was found tuple<1> - if tuple<0> is true (ie page found in reduced dblwr mode), then return the max page LSN

◆ get_pages()

Buffers & dblwr::recv::Pages::get_pages ( )
inlinenoexcept

Object the vector of pages.

Returns
the vector of pages.

◆ is_actual_page_corrupted()

std::tuple< bool, bool > dblwr::recv::Pages::is_actual_page_corrupted ( fil_space_t space,
page_id_t page_id 
)

Checks if page in tablespace is corrupted or an all-zero page.

Parameters
[in]spaceTablespace object
[in]page_idPage number to check for corruption
Returns
tuple<0> - true if corrupted tuple<1> - true if the page is all zero page

◆ is_recovered()

bool recv::Pages::is_recovered ( const page_id_t page_id) const
noexcept
Returns
true if page is recovered from the regular doublewrite buffer
Parameters
[in]page_idPage number to lookup

◆ operator=() [1/2]

Pages & dblwr::recv::Pages::operator= ( const Pages )
privatedelete

◆ operator=() [2/2]

Pages & dblwr::recv::Pages::operator= ( Pages &&  )
privatedelete

◆ recover()

void recv::Pages::recover ( fil_space_t space)
noexcept

Recover double write buffer pages.

Parameters
[in]spaceTablespace pages to recover, if set to nullptr then try and recovery all.

◆ reduced_recover()

void recv::Pages::reduced_recover ( fil_space_t space)
privatenoexcept

Check if page is logged in reduced doublewrite buffer.

We cannot recover page because the entire page is not logged only an entry of space_id, page_id, LSN is logged. So we abort the server. It is expected that the user restores from backup

Parameters
[in]spaceTablespace pages to check in reduced dblwr, if set to nullptr then try and recovery all.

Member Data Documentation

◆ m_page_entries

Page_entries dblwr::recv::Pages::m_page_entries
private

Page entries from reduced doublewrite buffer.

◆ m_pages

Buffers dblwr::recv::Pages::m_pages
private

Recovered doublewrite buffer page frames.


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