MySQL 26.7.0
Source Code Documentation
ib::redo::Redo_applier::Impl Class Reference

Public Member Functions

 Impl ()
 
Parse_result< Mtr_viewparse_mtr (std::span< const uint8_t > buffer)
 
bool apply (const Record_handle &record_handle, Page_handle &page_handle)
 

Private Member Functions

Parse_result< Record_viewparse_record (std::span< const uint8_t > buffer)
 Parse redo record. More...
 
Parse_result< size_t > parse_page_record_body (int type, uint32_t space_id, uint32_t page_no, std::span< const uint8_t > buffer)
 Parse page data record body. More...
 
Parse_result< size_t > parse_table_record_body (uint64_t table_id, std::span< const uint8_t > buffer)
 Parse table metadata record body. More...
 
Parse_result< size_t > parse_or_apply_page_record_body (int rec_type, uint32_t space_id, uint32_t page_no, std::span< const uint8_t > buffer, buf_block_t *block, mtr_t *mtr)
 Parse or apply page data record body. More...
 
bool check_encryption (uint32_t page_no, uint32_t space_id, const byte *start, const byte *end)
 Check if redo record has encryption information. More...
 
const byteparse_index (const byte *ptr, const byte *end_ptr, dict_index_t **index, const page_t *page)
 Calls mlog_parse_index() and sets index->id if page is not null. More...
 

Static Private Member Functions

static bool is_space_record (int type)
 Check if the record is of table space kind. More...
 

Private Attributes

std::unique_ptr< Persistersm_persisters
 

Constructor & Destructor Documentation

◆ Impl()

ib::redo::Redo_applier::Impl::Impl ( )
inline

Member Function Documentation

◆ apply()

bool ib::redo::Redo_applier::Impl::apply ( const Record_handle record_handle,
Page_handle page_handle 
)
inline

We don't want to ever apply MLOG_FILE_CREATE to a page, even to page 0, even though for legacy reasons the MLOG_FILE_CREATE starts with a header which looks as if it was a record targeting page_no=0 of a given space.

This assert is to distinguish if a given parser's subfunction returned nullptr because it had trouble with parsing, or because the buffer was nullptr to begin with

◆ check_encryption()

bool ib::redo::Redo_applier::Impl::check_encryption ( uint32_t  page_no,
uint32_t  space_id,
const byte start,
const byte end 
)
inlineprivate

Check if redo record has encryption information.

Parameters
page_nopage number
space_idtablespace id
startrecord body start
endrecord body end
Returns
True if encryption information presents.

◆ is_space_record()

static bool ib::redo::Redo_applier::Impl::is_space_record ( int  type)
inlinestaticprivate

Check if the record is of table space kind.

Parameters
typerecord type
Returns
true if the record is of table space kind, false otherwise.

◆ parse_index()

const byte * ib::redo::Redo_applier::Impl::parse_index ( const byte ptr,
const byte end_ptr,
dict_index_t **  index,
const page_t page 
)
inlineprivate

Calls mlog_parse_index() and sets index->id if page is not null.

mlog_parse_index() creates a dummy index with the index->id field unset. This field is required when applying a record to a page. In this case, read the index id from the page header and assign it.

Parameters
[in]ptrbuffer
[in]end_ptrbuffer end
[out]indexown: dummy index
[in]pagepage to apply the record or null
Returns
parsed record end or null if record is incomplete.

◆ parse_mtr()

Parse_result< Mtr_view > ib::redo::Redo_applier::Impl::parse_mtr ( std::span< const uint8_t >  buffer)
inline

◆ parse_or_apply_page_record_body()

Parse_result< size_t > ib::redo::Redo_applier::Impl::parse_or_apply_page_record_body ( int  rec_type,
uint32_t  space_id,
uint32_t  page_no,
std::span< const uint8_t >  buffer,
buf_block_t block,
mtr_t mtr 
)
inlineprivate

Parse or apply page data record body.

Parameters
rec_typerecord type
space_idtablespace id
page_nopage number
bufferbuffer to parse or apply
blockblock containing a page to apply (nullptr for parsing)
mtrmtr for apply operation (nullptr for parsing)
Returns
Record body size or error.
Note
This function was moved from log0recv.cc mostly untouched and needs to be refactored:
  • Consider to get rid of the block parameter.
  • Consider to get rid of the mtr parameter.
  • Get rid of recv_sys global usage.
  • Get rid of other possible innodb globals.
  • Decide how to handle table space flags modification.
  • Create unit tests for all possible record types.

A few lines later fil_tablespace_redo_delete(..,true) is called where the last argument means parse_only. Passing hardcoded pasre_only=true is only justified if we assume that true return from is_space_record(type) implies applying_redo variable is false

◆ parse_page_record_body()

Parse_result< size_t > ib::redo::Redo_applier::Impl::parse_page_record_body ( int  type,
uint32_t  space_id,
uint32_t  page_no,
std::span< const uint8_t >  buffer 
)
inlineprivate

Parse page data record body.

Parameters
typerecord type
space_idtablespace id
page_nopage number
bufferbuffer to parse
Returns
Record body size or error.

◆ parse_record()

Parse_result< Record_view > ib::redo::Redo_applier::Impl::parse_record ( std::span< const uint8_t >  buffer)
inlineprivate

Parse redo record.

Parameters
bufferbuffer to parse
Returns
Parsed record or error.

◆ parse_table_record_body()

Parse_result< size_t > ib::redo::Redo_applier::Impl::parse_table_record_body ( uint64_t  table_id,
std::span< const uint8_t >  buffer 
)
inlineprivate

Parse table metadata record body.

Parameters
table_idtable id
bufferbuffer to parse
Returns
Record body size or error.

Member Data Documentation

◆ m_persisters

std::unique_ptr<Persisters> ib::redo::Redo_applier::Impl::m_persisters
private

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