INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN'; # 1. CLONE blocked by DDL at beginning # In connection CON1 SET DEBUG_SYNC = 'fil_ibd_created_space SIGNAL start_clone WAIT_FOR resume_ddl_1'; CREATE TABLE t1(col1 int); # In connection DEFAULT SET DEBUG_SYNC = 'now WAIT_FOR start_clone'; SET DEBUG_SYNC = 'clone_begin_wait_ddl SIGNAL start_ddl_1 WAIT_FOR resume_clone_1'; SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_2 WAIT_FOR resume_clone_2'; SET GLOBAL clone_autotune_concurrency = OFF; SET GLOBAL clone_max_concurrency = 8; CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; # In connection CON2 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_1'; SET DEBUG_SYNC = 'clone_notify_ddl_before_state_block SIGNAL resume_ddl_1'; CREATE TABLE t2(col1 int); # In connection CON1 # Reap CREATE TABLE t1 SET DEBUG_SYNC= 'now SIGNAL resume_clone_1'; # In connection CON2 # Reap CREATE TABLE t2 # Disconnect CON2 # In connection CON1 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_2'; # 1A. TOO MANY CLONE IN PROGRESS SET GLOBAL clone_autotune_concurrency = OFF; SET GLOBAL clone_max_concurrency = 8; CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; ERROR HY000: Too many concurrent clone operations. Maximum allowed - 1. select ID, STATE, ERROR_NO from performance_schema.clone_status; ID STATE ERROR_NO 1 In Progress 0 select ID, STAGE, STATE from performance_schema.clone_progress; ID STAGE STATE 1 DROP DATA Completed 1 FILE COPY In Progress 1 PAGE COPY Not Started 1 REDO COPY Not Started 1 FILE SYNC Not Started 1 RESTART Not Started 1 RECOVERY Not Started # 2. ALTER INSTANCE while clone in progress ALTER INSTANCE DISABLE INNODB REDO_LOG; ERROR HY000: Concurrent clone in progress. Please try after clone is complete. INSERT INTO t1 values(10), (20), (30); SELECT * FROM t1 ORDER BY col1; col1 10 20 30 # 3. ALTER DISCARD while clone in progress ALTER TABLE t1 DISCARD TABLESPACE; ERROR HY000: Concurrent clone in progress. Please try after clone is complete. # 4. ALTER IMPORT while clone in progress ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Concurrent clone in progress. Please try after clone is complete. # 5. KILL CLONE command while in progress KILL QUERY CON_ID; SET DEBUG_SYNC= 'now SIGNAL resume_clone_2'; # In connection DEFAULT ERROR 70100: Query execution was interrupted SET DEBUG_SYNC = 'RESET'; DROP TABLE t2; # 6. Force clone to abort by DDL SET GLOBAL DEBUG = '+d,clone_ddl_error_abort'; SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl WAIT_FOR resume_clone'; SET GLOBAL clone_autotune_concurrency = OFF; SET GLOBAL clone_max_concurrency = 8; CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; # In connection CON1 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl'; SET DEBUG_SYNC = 'clone_notify_ddl_before_state_block SIGNAL resume_clone'; CREATE TABLE t2(col1 int); INSERT INTO t2 VALUES(10), (20), (30); SELECT * FROM t2 ORDER BY col1; col1 10 20 30 # In connection DEFAULT ERROR HY000: Concurrent DDL is performed during clone operation. Please try again. SET GLOBAL DEBUG = '-d,clone_ddl_error_abort'; SET DEBUG_SYNC = 'RESET'; #Cleanup DROP TABLE t1; DROP TABLE t2; # In connection DEFAULT SET DEBUG_SYNC = 'RESET'; # Attempt to uninstall clone if there UNINSTALL PLUGIN clone; # Restart server # restart # Uninstall clone if there UNINSTALL PLUGIN clone;