MySQL 9.0.0
Source Code Documentation
clone0desc.h File Reference

Innodb clone descriptors. More...

#include "mem0mem.h"
#include "os0file.h"
#include "univ.i"

Go to the source code of this file.

Classes

struct  Clone_Desc_Header
 Header common to all descriptors. More...
 
struct  Clone_Task_Meta
 Task information in clone operation. More...
 
class  Chnunk_Bitmap
 Bitmap for completed chunks in current state. More...
 
class  Chnunk_Bitmap::Bitmap_Operator_Impl
 Bitmap array index operator implementation. More...
 
struct  Chunk_Info
 Incomplete Chunk information. More...
 
struct  Clone_Desc_Locator
 CLONE_DESC_LOCATOR: Descriptor for a task for clone operation. More...
 
struct  Clone_Desc_Task_Meta
 CLONE_DESC_TASK_METADATA: Descriptor for a task for clone operation. More...
 
struct  Clone_Desc_State
 CLONE_DESC_STATE: Descriptor for current snapshot state. More...
 
struct  Clone_File_Meta
 Clone file information. More...
 
struct  Clone_Desc_File_MetaData
 CLONE_DESC_FILE_METADATA: Descriptor for file metadata. More...
 
struct  Clone_Desc_Data
 CLONE_DESC_DATA: Descriptor for data. More...
 

Typedefs

using Chunk_Map = std::map< uint32_t, uint32_t >
 Map for current block number for unfinished chunks. More...
 

Enumerations

enum  Snapshot_State : uint32_t {
  CLONE_SNAPSHOT_NONE = 0 , CLONE_SNAPSHOT_INIT , CLONE_SNAPSHOT_FILE_COPY , CLONE_SNAPSHOT_PAGE_COPY ,
  CLONE_SNAPSHOT_REDO_COPY , CLONE_SNAPSHOT_DONE
}
 Snapshot state transfer during clone. More...
 
enum  Clone_Desc_Type {
  CLONE_DESC_LOCATOR = 1 , CLONE_DESC_TASK_METADATA , CLONE_DESC_STATE , CLONE_DESC_FILE_METADATA ,
  CLONE_DESC_DATA , CLONE_DESC_MAX
}
 Clone descriptors contain meta information needed for applying cloned data. More...
 

Functions

uint choose_desc_version (const byte *ref_loc)
 Choose lowest descriptor version between reference locator and currently supported version. More...
 
bool clone_validate_locator (const byte *desc_loc, uint desc_len)
 Check if clone locator is valid. More...
 

Variables

const uint64_t CLONE_LOC_INVALID_ID = 0
 Invalid locator ID. More...
 
const uint32_t CLONE_DESC_MAX_BASE_LEN
 Maximum base length for any serialized descriptor. More...
 
const uint32_t CLONE_ALIGN_DIRECT_IO = 4 * 1024
 Align by 4K for O_DIRECT. More...
 
const int CLONE_MAX_TASKS = 128
 Maximum number of concurrent tasks for each clone. More...
 
const size_t CLONE_MAX_TRANSFER_STAGES = 3
 Total number of data transfer stages in clone. More...
 

Detailed Description

Innodb clone descriptors.

Typedef Documentation

◆ Chunk_Map

using Chunk_Map = std::map<uint32_t, uint32_t>

Map for current block number for unfinished chunks.

Used during restart from incomplete clone operation.

Enumeration Type Documentation

◆ Clone_Desc_Type

Clone descriptors contain meta information needed for applying cloned data.

These are PODs with interface to serialize and deserialize them.

Enumerator
CLONE_DESC_LOCATOR 

Logical pointer to identify a clone operation.

CLONE_DESC_TASK_METADATA 

Metadata for a Task/Thread for clone operation.

CLONE_DESC_STATE 

Information for snapshot state.

CLONE_DESC_FILE_METADATA 

Metadata for a database file.

CLONE_DESC_DATA 

Information for a data block.

CLONE_DESC_MAX 

Must be the last member.

◆ Snapshot_State

enum Snapshot_State : uint32_t

Snapshot state transfer during clone.

Clone Type: HA_CLONE_BLOCKING

Clone Type: HA_CLONE_REDO

Clone Type: HA_CLONE_HYBRID

Clone Type: HA_CLONE_PAGE: Not implemented

Enumerator
CLONE_SNAPSHOT_NONE 

Invalid state.

CLONE_SNAPSHOT_INIT 

Initialize state when snapshot object is created.

CLONE_SNAPSHOT_FILE_COPY 

Snapshot state while transferring files.

CLONE_SNAPSHOT_PAGE_COPY 

Snapshot state while transferring pages.

CLONE_SNAPSHOT_REDO_COPY 

Snapshot state while transferring redo.

CLONE_SNAPSHOT_DONE 

Snapshot state at end after finishing transfer.

Function Documentation

◆ choose_desc_version()

uint choose_desc_version ( const byte ref_loc)

Choose lowest descriptor version between reference locator and currently supported version.

Parameters
[in]ref_locreference locator
Returns
chosen version

◆ clone_validate_locator()

bool clone_validate_locator ( const byte desc_loc,
uint  desc_len 
)

Check if clone locator is valid.

Parameters
[in]desc_locserialized descriptor
[in]desc_lendescriptor length
Returns
true, if valid locator

Variable Documentation

◆ CLONE_ALIGN_DIRECT_IO

const uint32_t CLONE_ALIGN_DIRECT_IO = 4 * 1024

Align by 4K for O_DIRECT.

◆ CLONE_DESC_MAX_BASE_LEN

const uint32_t CLONE_DESC_MAX_BASE_LEN
Initial value:
=
static constexpr size_t KEY_LEN
Encryption key length.
Definition: os0enc.h:117

Maximum base length for any serialized descriptor.

This is only used for optimal allocation and has no impact on version compatibility.

◆ CLONE_LOC_INVALID_ID

const uint64_t CLONE_LOC_INVALID_ID = 0

Invalid locator ID.

◆ CLONE_MAX_TASKS

const int CLONE_MAX_TASKS = 128

Maximum number of concurrent tasks for each clone.

◆ CLONE_MAX_TRANSFER_STAGES

const size_t CLONE_MAX_TRANSFER_STAGES = 3

Total number of data transfer stages in clone.