MySQL 9.1.0
Source Code Documentation
clone0clone.h File Reference

Innodb Clone System. More...

#include <chrono>
#include "db0err.h"
#include "mysql/plugin.h"
#include "sql/handler.h"
#include "univ.i"
#include "ut0mutex.h"
#include "clone0api.h"
#include "clone0desc.h"
#include "clone0repl.h"
#include "clone0snapshot.h"
#include <tuple>

Go to the source code of this file.

Classes

struct  Clone_Task
 Task for clone operation. More...
 
class  Clone_Task_Manager
 Task manager for manging the tasks for a clone operation. More...
 
class  Clone_Handle
 Clone Handle for copying or applying data. More...
 
class  Clone_Sys
 Clone System. More...
 
class  Clone_Sys::Wait_stage
 RAII style wrapper to enter and exit wait stage. More...
 
class  Clone_Sys::Acquire_clone
 

Macros

#define CLONE_FILES_DIR   OS_FILE_PREFIX "clone" OS_PATH_SEPARATOR_STR
 Directory under data directory for all clone status files. More...
 

Typedefs

using Clone_Msec = std::chrono::milliseconds
 
using Clone_Sec = std::chrono::seconds
 
using Clone_Min = std::chrono::minutes
 
using Clone_Sys_State = std::atomic< Clone_System_State >
 

Enumerations

enum  Clone_System_State { CLONE_SYS_INACTIVE , CLONE_SYS_ACTIVE , CLONE_SYS_ABORT }
 Clone system state. More...
 
enum  Clone_Handle_State { CLONE_STATE_INIT = 1 , CLONE_STATE_ACTIVE , CLONE_STATE_IDLE , CLONE_STATE_ABORT }
 Clone Handle State. More...
 
enum  Clone_Task_State { CLONE_TASK_INACTIVE = 1 , CLONE_TASK_ACTIVE }
 Clone task state. More...
 

Variables

const size_t CLONE_INNODB_FILE_LEN = 64
 Clone in progress file name length. More...
 
const char CLONE_INNODB_RECOVERY_CRASH_POINT []
 Clone simulate recovery error file name. More...
 
const char CLONE_INNODB_IN_PROGRESS_FILE []
 Clone in progress file name. More...
 
const char CLONE_INNODB_ERROR_FILE []
 Clone error file name. More...
 
const char CLONE_INNODB_FIXUP_FILE []
 Clone fix up file name. More...
 
const char CLONE_INNODB_RECOVERY_FILE []
 Clone recovery status. More...
 
const char CLONE_INNODB_NEW_FILES []
 Clone file name for list of files cloned in place. More...
 
const char CLONE_INNODB_REPLACED_FILES []
 Clone file name for list of files to be replaced. More...
 
const char CLONE_INNODB_OLD_FILES []
 Clone file name for list of old files to be removed. More...
 
const char CLONE_INNODB_DDL_FILES []
 Clone file name for list of temp files renamed by ddl. More...
 
const char CLONE_INNODB_REPLACED_FILE_EXTN [] = "." OS_FILE_PREFIX "clone"
 Clone file extension for files to be replaced. More...
 
const char CLONE_INNODB_SAVED_FILE_EXTN [] = "." OS_FILE_PREFIX "clone_save"
 Clone file extension for saved old files. More...
 
const char CLONE_INNODB_DDL_FILE_EXTN [] = "." OS_FILE_PREFIX "clone_ddl"
 Clone file extension for temporary renamed file. More...
 
const Clone_Msec CLONE_DEF_SLEEP {100}
 Default sleep time while waiting: 100 ms. More...
 
const Clone_Sec CLONE_DEF_ALERT_INTERVAL {5}
 Default alert interval in multiple of sleep time: 5 seconds. More...
 
const Clone_Min CLONE_DEF_TIMEOUT {30}
 Default timeout in multiple of sleep time: 30 minutes. More...
 
const int MAX_SNAPSHOTS = 1
 Maximum number of concurrent snapshots. More...
 
const int MAX_CLONES = 1
 Maximum number of concurrent clones. More...
 
const int CLONE_ARR_SIZE = 2 * MAX_CLONES
 Clone system array size. More...
 
const int SNAPSHOT_ARR_SIZE = 2 * MAX_SNAPSHOTS
 Snapshot system array size. More...
 
Clone_Sysclone_sys
 Clone system global. More...
 

Detailed Description

Innodb Clone System.

Macro Definition Documentation

◆ CLONE_FILES_DIR

#define CLONE_FILES_DIR   OS_FILE_PREFIX "clone" OS_PATH_SEPARATOR_STR

Directory under data directory for all clone status files.

Typedef Documentation

◆ Clone_Min

using Clone_Min = std::chrono::minutes

◆ Clone_Msec

using Clone_Msec = std::chrono::milliseconds

◆ Clone_Sec

◆ Clone_Sys_State

using Clone_Sys_State = std::atomic<Clone_System_State>

Enumeration Type Documentation

◆ Clone_Handle_State

Clone Handle State.

Enumerator
CLONE_STATE_INIT 
CLONE_STATE_ACTIVE 
CLONE_STATE_IDLE 
CLONE_STATE_ABORT 

◆ Clone_System_State

Clone system state.

Enumerator
CLONE_SYS_INACTIVE 
CLONE_SYS_ACTIVE 
CLONE_SYS_ABORT 

◆ Clone_Task_State

Clone task state.

Enumerator
CLONE_TASK_INACTIVE 
CLONE_TASK_ACTIVE 

Variable Documentation

◆ CLONE_ARR_SIZE

const int CLONE_ARR_SIZE = 2 * MAX_CLONES

Clone system array size.

◆ CLONE_DEF_ALERT_INTERVAL

const Clone_Sec CLONE_DEF_ALERT_INTERVAL {5}

Default alert interval in multiple of sleep time: 5 seconds.

◆ CLONE_DEF_SLEEP

const Clone_Msec CLONE_DEF_SLEEP {100}

Default sleep time while waiting: 100 ms.

◆ CLONE_DEF_TIMEOUT

const Clone_Min CLONE_DEF_TIMEOUT {30}

Default timeout in multiple of sleep time: 30 minutes.

◆ CLONE_INNODB_DDL_FILE_EXTN

const char CLONE_INNODB_DDL_FILE_EXTN[] = "." OS_FILE_PREFIX "clone_ddl"

Clone file extension for temporary renamed file.

◆ CLONE_INNODB_DDL_FILES

const char CLONE_INNODB_DDL_FILES[]
Initial value:
=
#define CLONE_FILES_DIR
Directory under data directory for all clone status files.
Definition: clone0clone.h:51
#define OS_FILE_PREFIX
Prefix all files and directory created under data directory with special string so that it never conf...
Definition: os0file.h:68

Clone file name for list of temp files renamed by ddl.

◆ CLONE_INNODB_ERROR_FILE

const char CLONE_INNODB_ERROR_FILE[]
Initial value:

Clone error file name.

◆ CLONE_INNODB_FILE_LEN

const size_t CLONE_INNODB_FILE_LEN = 64

Clone in progress file name length.

◆ CLONE_INNODB_FIXUP_FILE

const char CLONE_INNODB_FIXUP_FILE[]
Initial value:

Clone fix up file name.

Present when clone needs table fix up.

◆ CLONE_INNODB_IN_PROGRESS_FILE

const char CLONE_INNODB_IN_PROGRESS_FILE[]
Initial value:
=
CLONE_FILES_DIR OS_FILE_PREFIX "status_in_progress"

Clone in progress file name.

◆ CLONE_INNODB_NEW_FILES

const char CLONE_INNODB_NEW_FILES[]
Initial value:

Clone file name for list of files cloned in place.

◆ CLONE_INNODB_OLD_FILES

const char CLONE_INNODB_OLD_FILES[]
Initial value:

Clone file name for list of old files to be removed.

◆ CLONE_INNODB_RECOVERY_CRASH_POINT

const char CLONE_INNODB_RECOVERY_CRASH_POINT[]
Initial value:
=
CLONE_FILES_DIR OS_FILE_PREFIX "status_crash_point"

Clone simulate recovery error file name.

◆ CLONE_INNODB_RECOVERY_FILE

const char CLONE_INNODB_RECOVERY_FILE[]
Initial value:
=
CLONE_FILES_DIR OS_FILE_PREFIX "status_recovery"

Clone recovery status.

◆ CLONE_INNODB_REPLACED_FILE_EXTN

const char CLONE_INNODB_REPLACED_FILE_EXTN[] = "." OS_FILE_PREFIX "clone"

Clone file extension for files to be replaced.

◆ CLONE_INNODB_REPLACED_FILES

const char CLONE_INNODB_REPLACED_FILES[]
Initial value:
=

Clone file name for list of files to be replaced.

◆ CLONE_INNODB_SAVED_FILE_EXTN

const char CLONE_INNODB_SAVED_FILE_EXTN[] = "." OS_FILE_PREFIX "clone_save"

Clone file extension for saved old files.

◆ clone_sys

Clone_Sys* clone_sys
extern

Clone system global.

Clone system global.

◆ MAX_CLONES

const int MAX_CLONES = 1

Maximum number of concurrent clones.

◆ MAX_SNAPSHOTS

const int MAX_SNAPSHOTS = 1

Maximum number of concurrent snapshots.

◆ SNAPSHOT_ARR_SIZE

const int SNAPSHOT_ARR_SIZE = 2 * MAX_SNAPSHOTS

Snapshot system array size.