MySQL 8.4.2
Source Code Documentation
|
Common interface for redo log and dirty page archiver system. More...
#include <mysql/components/services/page_track_service.h>
#include <list>
#include "buf0buf.h"
#include "ut0mem.h"
#include "ut0mutex.h"
Go to the source code of this file.
Classes | |
class | Arch_scope_guard |
Guard to release resources safely. More... | |
struct | Arch_Page_Pos |
Position in page ID archiving system. More... | |
struct | Arch_Point |
Structure which represents a point in a file. More... | |
struct | Arch_Reset_File |
class | Arch_Block |
In memory data block in Page ID archiving system. More... | |
class | Arch_File_Ctx |
Archiver file context. More... | |
class | Arch_Group |
Contiguous archived data for redo log or page tracking. More... | |
class | Arch_log_consumer |
class | Arch_Log_Sys |
Redo log archiving system. More... | |
struct | ArchPageData |
Page archiver in memory data. More... | |
class | Arch_Page_Sys |
Dirty page archive system. More... | |
Typedefs | |
using | Arch_Reset = std::deque< Arch_Reset_File > |
typedef uint32_t | Arch_group_uuid |
Number which tries to uniquely identify the archived data (unless it is zero, which stands for unsupported identification). More... | |
using | Arch_Grp_List = std::list< Arch_Group *, ut::allocator< Arch_Group * > > |
A list of archive groups. More... | |
using | Arch_Grp_List_Iter = Arch_Grp_List::iterator |
An iterator for archive group. More... | |
using | Arch_Block_Vec = std::vector< Arch_Block *, ut::allocator< Arch_Block * > > |
Vector of page archive in memory blocks. More... | |
Enumerations | |
enum | Arch_Client_State { ARCH_CLIENT_STATE_INIT = 0 , ARCH_CLIENT_STATE_STARTED , ARCH_CLIENT_STATE_STOPPED } |
Archiver client state. More... | |
enum | Arch_State { ARCH_STATE_INIT = 0 , ARCH_STATE_ACTIVE , ARCH_STATE_PREPARE_IDLE , ARCH_STATE_IDLE , ARCH_STATE_READ_ONLY , ARCH_STATE_ABORT } |
Archiver system state. More... | |
enum | Arch_Blk_State { ARCH_BLOCK_INIT = 0 , ARCH_BLOCK_ACTIVE , ARCH_BLOCK_READY_TO_FLUSH , ARCH_BLOCK_FLUSHED } |
Archived data block state. More... | |
enum | Arch_Blk_Type { ARCH_RESET_BLOCK = 0 , ARCH_DATA_BLOCK } |
Archiver block type. More... | |
enum | Arch_Blk_Flush_Type { ARCH_FLUSH_NORMAL = 0 , ARCH_FLUSH_PARTIAL } |
Archiver block flush type. More... | |
enum | Arch_Page_Dblwr_Offset { ARCH_PAGE_DBLWR_RESET_PAGE = 0 , ARCH_PAGE_DBLWR_FULL_FLUSH_PAGE , ARCH_PAGE_DBLWR_PARTIAL_FLUSH_PAGE } |
Page Archive doublewrite buffer block offsets. More... | |
Functions | |
void | log_archiver_thread () |
Log archiver background thread. More... | |
void | arch_remove_file (const char *file_path, const char *file_name) |
Remove files related to page and log archiving. More... | |
void | arch_remove_dir (const char *dir_path, const char *dir_name) |
Remove group directory and the files related to page and log archiving. More... | |
dberr_t | arch_init () |
Initialize Page and Log archiver system. More... | |
void | arch_free () |
Free Page and Log archiver system. More... | |
int | start_log_archiver_background () |
Start log archiver background thread. More... | |
int | start_page_archiver_background () |
Start page archiver background thread. More... | |
void | page_archiver_thread () |
Page archiver background thread. More... | |
bool | arch_wake_threads () |
Wakes up archiver threads. More... | |
Variables | |
constexpr char | ARCH_PAGE_GROUP_DURABLE_FILE_NAME [] = "durable" |
File name for the durable file which indicates whether a group was made durable or not. More... | |
const uint | MAX_LSN_DECIMAL_DIGIT = 32 |
Byte length for printing LSN. More... | |
const uint | MAX_ARCH_LOG_FILE_NAME_LEN |
Max string length for archive log file name. More... | |
const uint | MAX_ARCH_PAGE_FILE_NAME_LEN |
Max string length for archive page file name. More... | |
const uint | MAX_ARCH_DIR_NAME_LEN |
Max string length for archive group directory name. More... | |
os_event_t | log_archiver_thread_event |
Archiver thread event to signal that data is available. More... | |
constexpr uint | ARCH_PAGE_BLK_SIZE = UNIV_PAGE_SIZE_DEF |
Memory block size. More... | |
os_event_t | page_archiver_thread_event |
Archiver thread event to signal that data is available. More... | |
Arch_Log_Sys * | arch_log_sys |
Redo log archiver system global. More... | |
Arch_Page_Sys * | arch_page_sys |
Dirty page ID archiver system global. More... | |
Archive file name prefix and constant length parameters. | |
const char | ARCH_DIR [] = OS_FILE_PREFIX "ib_archive" |
Archive directory prefix. More... | |
const char | ARCH_LOG_DIR [] = "log_group_" |
Archive Log group directory prefix. More... | |
const char | ARCH_PAGE_DIR [] = "page_group_" |
Archive Page group directory prefix. More... | |
const char | ARCH_LOG_FILE [] = "ib_log_" |
Archive log file prefix. More... | |
const char | ARCH_PAGE_FILE [] = "ib_page_" |
Archive page file prefix. More... | |
Common interface for redo log and dirty page archiver system.
using Arch_Block_Vec = std::vector<Arch_Block *, ut::allocator<Arch_Block *> > |
Vector of page archive in memory blocks.
typedef uint32_t Arch_group_uuid |
Number which tries to uniquely identify the archived data (unless it is zero, which stands for unsupported identification).
Currently only redo log files are identified (by Log_uuid's value).
using Arch_Grp_List = std::list<Arch_Group *, ut::allocator<Arch_Group *> > |
A list of archive groups.
using Arch_Grp_List_Iter = Arch_Grp_List::iterator |
An iterator for archive group.
using Arch_Reset = std::deque<Arch_Reset_File> |
enum Arch_Blk_Flush_Type |
enum Arch_Blk_State |
Archived data block state.
A data block is a block in memory that holds dirty page IDs before persisting into disk. Shown below is the state transfer diagram for a data block.
enum Arch_Blk_Type |
enum Arch_Client_State |
Archiver client state.
Archiver clients request archiving for specific interval using the start and stop interfaces. During this time the client is attached to global Archiver system. A client copies archived data for the interval after calling stop. System keeps the data till the time client object is destroyed.
Enumerator | |
---|---|
ARCH_CLIENT_STATE_INIT | Client is initialized. |
ARCH_CLIENT_STATE_STARTED | Archiving started by client. |
ARCH_CLIENT_STATE_STOPPED | Archiving stopped by client. |
enum Arch_State |
Archiver system state.
Archiver state changes are triggered by client request to start or stop archiving and system wide events like shutdown fatal error etc. Following diagram shows the state transfer.
void arch_free | ( | ) |
Free Page and Log archiver system.
dberr_t arch_init | ( | ) |
Initialize Page and Log archiver system.
void arch_remove_dir | ( | const char * | dir_path, |
const char * | dir_name | ||
) |
Remove group directory and the files related to page and log archiving.
[in] | dir_path | path to the directory |
[in] | dir_name | directory name |
void arch_remove_file | ( | const char * | file_path, |
const char * | file_name | ||
) |
Remove files related to page and log archiving.
[in] | file_path | path to the file |
[in] | file_name | name of the file |
bool arch_wake_threads | ( | ) |
Wakes up archiver threads.
void log_archiver_thread | ( | ) |
Log archiver background thread.
Log archiver background thread.
void page_archiver_thread | ( | ) |
Page archiver background thread.
Page archiver background thread.
int start_log_archiver_background | ( | ) |
Start log archiver background thread.
int start_page_archiver_background | ( | ) |
Start page archiver background thread.
const char ARCH_DIR[] = OS_FILE_PREFIX "ib_archive" |
Archive directory prefix.
const char ARCH_LOG_DIR[] = "log_group_" |
Archive Log group directory prefix.
const char ARCH_LOG_FILE[] = "ib_log_" |
Archive log file prefix.
|
extern |
Redo log archiver system global.
Redo log archiver system global.
|
constexpr |
Memory block size.
const char ARCH_PAGE_DIR[] = "page_group_" |
Archive Page group directory prefix.
const char ARCH_PAGE_FILE[] = "ib_page_" |
Archive page file prefix.
|
constexpr |
File name for the durable file which indicates whether a group was made durable or not.
Required to differentiate durable group from group left over by crash during clone operation.
|
extern |
Dirty page ID archiver system global.
Dirty page ID archiver system global.
|
extern |
Archiver thread event to signal that data is available.
Archiver thread event to signal that data is available.
const uint MAX_ARCH_DIR_NAME_LEN |
Max string length for archive group directory name.
const uint MAX_ARCH_LOG_FILE_NAME_LEN |
Max string length for archive log file name.
const uint MAX_ARCH_PAGE_FILE_NAME_LEN |
Max string length for archive page file name.
const uint MAX_LSN_DECIMAL_DIGIT = 32 |
Byte length for printing LSN.
Each archive group name is appended with start LSN
|
extern |
Archiver thread event to signal that data is available.
Archiver thread event to signal that data is available.