34#ifndef ARCH_RECV_INCLUDE
35#define ARCH_RECV_INCLUDE
114 std::unordered_map<std::string, Arch_Recv_Group_Info>;
240 const std::string file_path);
263 ut_ad(group !=
nullptr);
Common interface for redo log and dirty page archiver system.
Arch_Blk_Flush_Type
Archiver block flush type.
Definition: arch0arch.h:222
Arch_Blk_Type
Archiver block type.
Definition: arch0arch.h:213
constexpr uint ARCH_PAGE_BLK_SIZE
Memory block size.
Definition: arch0arch.h:91
Innodb interface for modified page archive.
std::unordered_map< std::string, Arch_Recv_Group_Info > Arch_Dir_Group_Info_Map
Mapping of group directory name to information related to the recovery group info.
Definition: arch0recv.h:114
std::vector< Arch_Dblwr_Block > Arch_Dblwr_Blocks
Vector of doublewrite buffer blocks and their info.
Definition: arch0recv.h:132
Doublewrite buffer context.
Definition: arch0recv.h:135
uint64_t m_file_size
Total file size of the file which holds the doublewrite buffer.
Definition: arch0recv.h:179
Arch_Dblwr_Blocks blocks()
Get doubewrite buffer blocks.
Definition: arch0recv.h:166
Arch_Dblwr_Ctx()=default
Constructor: Initialize members.
Arch_Dblwr_Ctx & operator=(Arch_Dblwr_Ctx const &)=delete
Disable assignment.
dberr_t read_file()
Read the doublewrite buffer file.
Definition: arch0recv.cc:100
~Arch_Dblwr_Ctx()
Definition: arch0recv.h:140
dberr_t init(const char *path, const char *base_file, uint num_files, uint64_t file_size)
Initialize the doublewrite buffer.
Definition: arch0recv.cc:82
Arch_Dblwr_Blocks m_blocks
List of doublewrite buffer blocks.
Definition: arch0recv.h:185
Arch_File_Ctx m_file_ctx
Doublewrite buffer file context.
Definition: arch0recv.h:182
Arch_Dblwr_Ctx(Arch_Dblwr_Ctx const &)=delete
Disable copy construction.
byte * m_buf
Buffer to hold the contents of the doublwrite buffer.
Definition: arch0recv.h:176
void validate_and_fill_blocks(size_t num_files)
Validate the blocks contained in the m_buf buffer and load only the valid buffers into m_blocks.
Definition: arch0recv.cc:119
Recovery system data structure for the archiver.
Definition: arch0recv.h:303
~Recovery()
Destructor.
Definition: arch0recv.h:310
dberr_t parse_stop_points(bool last_file, Arch_Recv_Group_Info &info)
Fetch the stop lsn pertaining to a file.
Definition: arch0recv.cc:620
void reset_print(uint file_start_index)
Print recovery related data.
Definition: arch0recv.cc:530
Arch_File_Ctx & m_file_ctx
File context.
Definition: arch0recv.h:343
Recovery & operator=(Recovery const &)=delete
Disable assignment.
Recovery(Arch_File_Ctx &file_ctx)
Constructor.
Definition: arch0recv.h:307
dberr_t parse_reset_points(uint file_index, bool last_file, Arch_Recv_Group_Info &info)
Fetch the reset points pertaining to a file.
Definition: arch0recv.cc:661
Recovery(Recovery const &)=delete
Disable copy construction.
Archiver file context.
Definition: arch0arch.h:531
void close()
Close file, if open.
Definition: arch0arch.h:628
Recovery system data structure for the archiver.
Definition: arch0recv.h:258
Arch_Group * m_group
The parent class group object.
Definition: arch0recv.h:299
dberr_t replace_pages_from_dblwr(Arch_Dblwr_Ctx *dblwr_ctx)
Check and replace blocks in archived files belonging to a group from the doublewrite buffer if requir...
Definition: arch0recv.cc:278
dberr_t parse(Arch_Recv_Group_Info &info)
Start parsing the archive file for archive group information.
Definition: arch0recv.cc:571
Recovery(Recovery const &)=delete
Disable copy construction.
~Recovery()
Destructor.
Definition: arch0recv.h:268
void attach()
Attach system client to the archiver during recovery if any group was active at the time of crash.
Definition: arch0recv.h:289
Recovery(Arch_Group *group)
Constructor.
Definition: arch0recv.h:262
dberr_t cleanup_if_required(Arch_Recv_Group_Info &info)
Delete the last file if there are no blocks flushed to it.
Definition: arch0recv.cc:321
Recovery & operator=(Recovery const &)=delete
Disable assignment.
Contiguous archived data for redo log or page tracking.
Definition: arch0arch.h:843
uint m_dur_ref_count
Number of clients referencing for durable archiving.
Definition: arch0arch.h:1261
Recovery system data structure for the archiver.
Definition: arch0recv.h:189
dberr_t load_archiver()
Load archiver with the related data and start tracking if required.
Definition: arch0recv.cc:436
dberr_t init_dblwr()
Initialise the archiver's recovery system.
Definition: arch0recv.cc:70
std::string m_arch_dir_name
Archive directory.
Definition: arch0recv.h:244
Arch_Dir_Group_Info_Map m_dir_group_info_map
Mapping of group directory names and group information related to the group.
Definition: arch0recv.h:254
bool scan_for_groups()
Scan the archive directory and fetch all info related to group directories and its files.
Definition: arch0recv.cc:248
Arch_Dblwr_Ctx m_dblwr_ctx
Doublewrite buffer context.
Definition: arch0recv.h:250
Recovery(Recovery const &)=delete
Disable copy construction.
Recovery & operator=(Recovery const &)=delete
Disable assignment.
dberr_t recover()
Parse for group information and fill the group.
Definition: arch0recv.cc:395
void print()
Print information related to the archiver recovery system added for debugging purposes.
Definition: arch0recv.cc:180
Recovery(Arch_Page_Sys *page_sys, const char *dir_name)
Constructor: Initialize members.
Definition: arch0recv.h:194
void read_group_files(const std::string dir_path, const std::string file_path)
Read all the archived files belonging to a group and store information related to them required for p...
Definition: arch0recv.cc:210
Arch_Page_Sys * m_page_sys
Global dirty page archive system.
Definition: arch0recv.h:247
~Recovery()=default
Destructor: Close open file and free resources.
void read_group_dirs(const std::string file_path)
Read all the group directories and store information related to them required for parsing.
Definition: arch0recv.cc:189
Dirty page archive system.
Definition: arch0arch.h:1553
Info related to each group parsed at different stages of page archive recovery.
Definition: arch0recv.h:42
uint m_num_files
Number of archived files belonging to the group.
Definition: arch0recv.h:69
bool m_durable
True if group is from durable archiving, false if left over from a crash during clone operation.
Definition: arch0recv.h:76
lsn_t m_start_lsn
Start LSN of the group.
Definition: arch0recv.h:105
Arch_Recv_Group_Info & operator=(const Arch_Recv_Group_Info &)=delete
Disable assignment.
byte * m_last_data_block
Data block of the last reset file in a group.
Definition: arch0recv.h:99
uint m_file_start_index
The file index which is part of the file name may not necessarily be 0 always.
Definition: arch0recv.h:87
bool m_active
Group is active or not.
Definition: arch0recv.h:72
~Arch_Recv_Group_Info()
Definition: arch0recv.h:54
byte * m_last_reset_block
Reset block of the last reset file in a group.
Definition: arch0recv.h:96
Arch_Group * m_group
Group data.
Definition: arch0recv.h:66
Arch_Recv_Group_Info()
Definition: arch0recv.h:44
Arch_Recv_Group_Info(const Arch_Recv_Group_Info &)=delete
Disable copy construction.
bool m_new_empty_file
True if a new empty file was present in the group directory.
Definition: arch0recv.h:80
Arch_Page_Pos m_reset_pos
Last reset position of the group.
Definition: arch0recv.h:90
lsn_t m_last_stop_lsn
Last stop LSN of the group if active, else end LSN.
Definition: arch0recv.h:108
Arch_Reset_File m_last_reset_file
Reset file structure of the last reset file.
Definition: arch0recv.h:102
Arch_Page_Pos m_write_pos
Last write position of the group.
Definition: arch0recv.h:93
dberr_t
Definition: db0err.h:39
constexpr lsn_t LSN_MAX
Maximum possible lsn value is slightly higher than the maximum sn value, because lsn sequence enumera...
Definition: log0constants.h:159
uint64_t lsn_t
Type used for all log sequence number storage and arithmetic.
Definition: log0types.h:63
static size_t file_size
Definition: mysql_config_editor.cc:72
static char * path
Definition: mysqldump.cc:149
void * zalloc_withkey(PSI_memory_key_t key, std::size_t size) noexcept
Dynamically allocates zero-initialized storage of given size.
Definition: ut0new.h:634
void free(void *ptr) noexcept
Releases storage which has been dynamically allocated through any of the ut::malloc*(),...
Definition: ut0new.h:719
PSI_memory_key_t make_psi_memory_key(PSI_memory_key key)
Convenience helper function to create type-safe representation of PSI_memory_key.
Definition: ut0new.h:190
Doublewrite buffer block along with their info.
Definition: arch0recv.h:117
Arch_Blk_Type m_block_type
Type of block flushed into the doublewrite block.
Definition: arch0recv.h:119
uint64_t m_block_num
Block number of the block flushed into the doublewrite buffer.
Definition: arch0recv.h:125
Arch_Blk_Flush_Type m_flush_type
Flush type of the block flushed into the doublewrite buffer.
Definition: arch0recv.h:122
byte * m_block
Doublewrite buffer block.
Definition: arch0recv.h:128
Position in page ID archiving system.
Definition: arch0arch.h:299
void init()
Initialize a position.
Definition: arch0page.cc:1441
Definition: arch0arch.h:331
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:105
PSI_memory_key mem_key_archive
Definition: ut0new.cc:48