MySQL 8.0.31
Source Code Documentation
arch0page.h File Reference

Innodb interface for modified page archive. More...

#include "arch0arch.h"
#include "buf0buf.h"

Go to the source code of this file.

Classes

class  Page_Arch_Client_Ctx
 Dirty page archiver client context. More...
 

Typedefs

using Page_Arch_Cbk = int(void *ctx, byte *buff, uint num_pages)
 Callback for retrieving archived page IDs. More...
 
using Page_Wait_Flush_Archiver_Cbk = std::function< bool(void)>
 Callback function to check if we need to wait for flush archiver to flush more blocks. More...
 

Variables

constexpr uint ARCH_PAGE_FILE_NUM_RESET_PAGE = 1
 Archived page header file size (RESET Page) in number of blocks. More...
 
constexpr uint ARCH_PAGE_FILE_HDR_SIZE
 Archived file header size. More...
 
constexpr uint ARCH_PAGE_NUM_BLKS = 32
 Number of memory blocks. More...
 
constexpr uint ARCH_PAGE_FILE_VERSION = 1
 Archived file format version. More...
 
uint ARCH_PAGE_FILE_CAPACITY
 Archived page file default size in number of blocks. More...
 
uint ARCH_PAGE_FILE_DATA_CAPACITY
 Archived page data file size (without header) in number of blocks. More...
 
constexpr uint ARCH_PAGE_RESET_THRESHOLD
 Threshold for page archive reset. More...
 
Page Archive doublewrite buffer file name prefix and constant length

parameters.

constexpr char ARCH_DBLWR_DIR [] = "ib_dblwr"
 Archive doublewrite buffer directory prefix. More...
 
constexpr char ARCH_DBLWR_FILE [] = "dblwr_"
 Archive doublewrite buffer file prefix. More...
 
constexpr char ARCH_PAGE_GROUP_ACTIVE_FILE_NAME [] = "active"
 File name for the active file which indicates whether a group is active or not. More...
 
constexpr uint ARCH_DBLWR_NUM_FILES = 1
 Archive doublewrite buffer number of files. More...
 
constexpr uint ARCH_DBLWR_FILE_CAPACITY = 3
 Archive doublewrite buffer file capacity in no. More...
 
Archive block header elements
constexpr uint ARCH_PAGE_BLK_HEADER_VERSION_OFFSET = 0
 Block Header: Version is in first 1 byte. More...
 
constexpr uint ARCH_PAGE_BLK_HEADER_TYPE_OFFSET = 1
 Block Header: Block Type is in next 1 byte. More...
 
constexpr uint ARCH_PAGE_BLK_HEADER_CHECKSUM_OFFSET = 2
 Block Header: Checksum is in next 4 bytes. More...
 
constexpr uint ARCH_PAGE_BLK_HEADER_DATA_LEN_OFFSET = 6
 Block Header: Data length is in next 2 bytes. More...
 
constexpr uint ARCH_PAGE_BLK_HEADER_STOP_LSN_OFFSET = 8
 Block Header: Stop LSN is in next 8 bytes. More...
 
constexpr uint ARCH_PAGE_BLK_HEADER_RESET_LSN_OFFSET = 16
 Block Header: Reset LSN is in next 8 bytes. More...
 
constexpr uint ARCH_PAGE_BLK_HEADER_NUMBER_OFFSET = 24
 Block Header: Block number is in next 8 bytes. More...
 
constexpr uint ARCH_PAGE_BLK_HEADER_LENGTH = 32
 Block Header: Total length. More...
 
Page Archive reset block elements size.
constexpr uint ARCH_PAGE_FILE_HEADER_RESET_LSN_SIZE = 8
 Serialized Reset ID: Reset LSN total size. More...
 
constexpr uint ARCH_PAGE_FILE_HEADER_RESET_BLOCK_NUM_SIZE = 2
 Serialized Reset ID: Reset block number size. More...
 
constexpr uint ARCH_PAGE_FILE_HEADER_RESET_BLOCK_OFFSET_SIZE = 2
 Serialized Reset ID: Reset block offset size. More...
 
constexpr uint ARCH_PAGE_FILE_HEADER_RESET_POS_SIZE
 Serialized Reset ID: Reset position total size. More...
 
Page Archive data block elements
constexpr uint ARCH_BLK_SPCE_ID_OFFSET = 0
 Serialized page ID: tablespace ID in First 4 bytes. More...
 
constexpr uint ARCH_BLK_PAGE_NO_OFFSET = 4
 Serialized page ID: Page number in next 4 bytes. More...
 
constexpr uint ARCH_BLK_PAGE_ID_SIZE = 8
 Serialized page ID: Total length. More...
 

Detailed Description

Innodb interface for modified page archive.

Typedef Documentation

◆ Page_Arch_Cbk

using Page_Arch_Cbk = int(void *ctx, byte *buff, uint num_pages)

Callback for retrieving archived page IDs.

Parameters
[in]ctxcontext passed by caller
[in]buffbuffer with page IDs
[in]num_pagesnumber of page IDs in buffer
Returns
error code

◆ Page_Wait_Flush_Archiver_Cbk

using Page_Wait_Flush_Archiver_Cbk = std::function<bool(void)>

Callback function to check if we need to wait for flush archiver to flush more blocks.

Variable Documentation

◆ ARCH_BLK_PAGE_ID_SIZE

constexpr uint ARCH_BLK_PAGE_ID_SIZE = 8
constexpr

Serialized page ID: Total length.

◆ ARCH_BLK_PAGE_NO_OFFSET

constexpr uint ARCH_BLK_PAGE_NO_OFFSET = 4
constexpr

Serialized page ID: Page number in next 4 bytes.

◆ ARCH_BLK_SPCE_ID_OFFSET

constexpr uint ARCH_BLK_SPCE_ID_OFFSET = 0
constexpr

Serialized page ID: tablespace ID in First 4 bytes.

◆ ARCH_DBLWR_DIR

constexpr char ARCH_DBLWR_DIR[] = "ib_dblwr"
constexpr

Archive doublewrite buffer directory prefix.

◆ ARCH_DBLWR_FILE

constexpr char ARCH_DBLWR_FILE[] = "dblwr_"
constexpr

Archive doublewrite buffer file prefix.

◆ ARCH_DBLWR_FILE_CAPACITY

constexpr uint ARCH_DBLWR_FILE_CAPACITY = 3
constexpr

Archive doublewrite buffer file capacity in no.

of blocks

◆ ARCH_DBLWR_NUM_FILES

constexpr uint ARCH_DBLWR_NUM_FILES = 1
constexpr

Archive doublewrite buffer number of files.

◆ ARCH_PAGE_BLK_HEADER_CHECKSUM_OFFSET

constexpr uint ARCH_PAGE_BLK_HEADER_CHECKSUM_OFFSET = 2
constexpr

Block Header: Checksum is in next 4 bytes.

◆ ARCH_PAGE_BLK_HEADER_DATA_LEN_OFFSET

constexpr uint ARCH_PAGE_BLK_HEADER_DATA_LEN_OFFSET = 6
constexpr

Block Header: Data length is in next 2 bytes.

◆ ARCH_PAGE_BLK_HEADER_LENGTH

constexpr uint ARCH_PAGE_BLK_HEADER_LENGTH = 32
constexpr

Block Header: Total length.

Keep header length in multiple of ARCH_BLK_PAGE_ID_SIZE

◆ ARCH_PAGE_BLK_HEADER_NUMBER_OFFSET

constexpr uint ARCH_PAGE_BLK_HEADER_NUMBER_OFFSET = 24
constexpr

Block Header: Block number is in next 8 bytes.

◆ ARCH_PAGE_BLK_HEADER_RESET_LSN_OFFSET

constexpr uint ARCH_PAGE_BLK_HEADER_RESET_LSN_OFFSET = 16
constexpr

Block Header: Reset LSN is in next 8 bytes.

◆ ARCH_PAGE_BLK_HEADER_STOP_LSN_OFFSET

constexpr uint ARCH_PAGE_BLK_HEADER_STOP_LSN_OFFSET = 8
constexpr

Block Header: Stop LSN is in next 8 bytes.

◆ ARCH_PAGE_BLK_HEADER_TYPE_OFFSET

constexpr uint ARCH_PAGE_BLK_HEADER_TYPE_OFFSET = 1
constexpr

Block Header: Block Type is in next 1 byte.

◆ ARCH_PAGE_BLK_HEADER_VERSION_OFFSET

constexpr uint ARCH_PAGE_BLK_HEADER_VERSION_OFFSET = 0
constexpr

Block Header: Version is in first 1 byte.

◆ ARCH_PAGE_FILE_CAPACITY

uint ARCH_PAGE_FILE_CAPACITY
extern

Archived page file default size in number of blocks.

◆ ARCH_PAGE_FILE_DATA_CAPACITY

uint ARCH_PAGE_FILE_DATA_CAPACITY
extern

Archived page data file size (without header) in number of blocks.

◆ ARCH_PAGE_FILE_HDR_SIZE

constexpr uint ARCH_PAGE_FILE_HDR_SIZE
constexpr
Initial value:
=
constexpr uint ARCH_PAGE_BLK_SIZE
Memory block size.
Definition: arch0arch.h:90
constexpr uint ARCH_PAGE_FILE_NUM_RESET_PAGE
Archived page header file size (RESET Page) in number of blocks.
Definition: arch0page.h:39

Archived file header size.

No file header for this version.

◆ ARCH_PAGE_FILE_HEADER_RESET_BLOCK_NUM_SIZE

constexpr uint ARCH_PAGE_FILE_HEADER_RESET_BLOCK_NUM_SIZE = 2
constexpr

Serialized Reset ID: Reset block number size.

◆ ARCH_PAGE_FILE_HEADER_RESET_BLOCK_OFFSET_SIZE

constexpr uint ARCH_PAGE_FILE_HEADER_RESET_BLOCK_OFFSET_SIZE = 2
constexpr

Serialized Reset ID: Reset block offset size.

◆ ARCH_PAGE_FILE_HEADER_RESET_LSN_SIZE

constexpr uint ARCH_PAGE_FILE_HEADER_RESET_LSN_SIZE = 8
constexpr

Serialized Reset ID: Reset LSN total size.

◆ ARCH_PAGE_FILE_HEADER_RESET_POS_SIZE

constexpr uint ARCH_PAGE_FILE_HEADER_RESET_POS_SIZE
constexpr
Initial value:
=
constexpr uint ARCH_PAGE_FILE_HEADER_RESET_BLOCK_OFFSET_SIZE
Serialized Reset ID: Reset block offset size.
Definition: arch0page.h:106
constexpr uint ARCH_PAGE_FILE_HEADER_RESET_BLOCK_NUM_SIZE
Serialized Reset ID: Reset block number size.
Definition: arch0page.h:103

Serialized Reset ID: Reset position total size.

◆ ARCH_PAGE_FILE_NUM_RESET_PAGE

constexpr uint ARCH_PAGE_FILE_NUM_RESET_PAGE = 1
constexpr

Archived page header file size (RESET Page) in number of blocks.

◆ ARCH_PAGE_FILE_VERSION

constexpr uint ARCH_PAGE_FILE_VERSION = 1
constexpr

Archived file format version.

◆ ARCH_PAGE_GROUP_ACTIVE_FILE_NAME

constexpr char ARCH_PAGE_GROUP_ACTIVE_FILE_NAME[] = "active"
constexpr

File name for the active file which indicates whether a group is active or not.

◆ ARCH_PAGE_NUM_BLKS

constexpr uint ARCH_PAGE_NUM_BLKS = 32
constexpr

Number of memory blocks.

◆ ARCH_PAGE_RESET_THRESHOLD

constexpr uint ARCH_PAGE_RESET_THRESHOLD
constexpr
Initial value:
=
constexpr uint ARCH_BLK_PAGE_ID_SIZE
Serialized page ID: Total length.
Definition: arch0page.h:125
constexpr uint ARCH_PAGE_BLK_HEADER_LENGTH
Block Header: Total length.
Definition: arch0page.h:92

Threshold for page archive reset.

Attach to current reset if the number of tracked pages between the reset request and the current reset is less than this threshold as we allow only one reset per data block.