| 1 |
INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN'; |
| 2 |
# 1. CLONE blocked by DDL at beginning |
| 3 |
# In connection CON1 |
| 4 |
SET DEBUG_SYNC = 'fil_ibd_created_space SIGNAL start_clone WAIT_FOR resume_ddl_1'; |
| 5 |
CREATE TABLE t1(col1 int); |
| 6 |
# In connection DEFAULT |
| 7 |
SET DEBUG_SYNC = 'now WAIT_FOR start_clone'; |
| 8 |
SET DEBUG_SYNC = 'clone_begin_wait_ddl SIGNAL start_ddl_1 WAIT_FOR resume_clone_1'; |
| 9 |
SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_2 WAIT_FOR resume_clone_2'; |
| 10 |
SET GLOBAL clone_autotune_concurrency = OFF; |
| 11 |
SET GLOBAL clone_max_concurrency = 8; |
| 12 |
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; |
| 13 |
# In connection CON2 |
| 14 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_1'; |
| 15 |
SET DEBUG_SYNC = 'clone_notify_ddl_before_state_block SIGNAL resume_ddl_1'; |
| 16 |
CREATE TABLE t2(col1 int); |
| 17 |
# In connection CON1 |
| 18 |
# Reap CREATE TABLE t1 |
| 19 |
SET DEBUG_SYNC= 'now SIGNAL resume_clone_1'; |
| 20 |
# In connection CON2 |
| 21 |
# Reap CREATE TABLE t2 |
| 22 |
# Disconnect CON2 |
| 23 |
# In connection CON1 |
| 24 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_2'; |
| 25 |
# 1A. TOO MANY CLONE IN PROGRESS |
| 26 |
SET GLOBAL clone_autotune_concurrency = OFF; |
| 27 |
SET GLOBAL clone_max_concurrency = 8; |
| 28 |
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; |
| 29 |
ERROR HY000: Too many concurrent clone operations. Maximum allowed - 1. |
| 30 |
select ID, STATE, ERROR_NO from performance_schema.clone_status; |
| 31 |
ID STATE ERROR_NO |
| 32 |
1 In Progress 0 |
| 33 |
select ID, STAGE, STATE from performance_schema.clone_progress; |
| 34 |
ID STAGE STATE |
| 35 |
1 DROP DATA Completed |
| 36 |
1 FILE COPY In Progress |
| 37 |
1 PAGE COPY Not Started |
| 38 |
1 REDO COPY Not Started |
| 39 |
1 FILE SYNC Not Started |
| 40 |
1 RESTART Not Started |
| 41 |
1 RECOVERY Not Started |
| 42 |
# 2. ALTER INSTANCE while clone in progress |
| 43 |
ALTER INSTANCE DISABLE INNODB REDO_LOG; |
| 44 |
ERROR HY000: Concurrent clone in progress. Please try after clone is complete. |
| 45 |
INSERT INTO t1 values(10), (20), (30); |
| 46 |
SELECT * FROM t1 ORDER BY col1; |
| 47 |
col1 |
| 48 |
10 |
| 49 |
20 |
| 50 |
30 |
| 51 |
# 3. ALTER DISCARD while clone in progress |
| 52 |
ALTER TABLE t1 DISCARD TABLESPACE; |
| 53 |
ERROR HY000: Concurrent clone in progress. Please try after clone is complete. |
| 54 |
# 4. ALTER IMPORT while clone in progress |
| 55 |
ALTER TABLE t1 IMPORT TABLESPACE; |
| 56 |
ERROR HY000: Concurrent clone in progress. Please try after clone is complete. |
| 57 |
# 5. KILL CLONE command while in progress |
| 58 |
KILL QUERY CON_ID; |
| 59 |
SET DEBUG_SYNC= 'now SIGNAL resume_clone_2'; |
| 60 |
# In connection DEFAULT |
| 61 |
ERROR 70100: Query execution was interrupted |
| 62 |
SET DEBUG_SYNC = 'RESET'; |
| 63 |
DROP TABLE t2; |
| 64 |
# 6. Force clone to abort by DDL |
| 65 |
SET GLOBAL DEBUG = '+d,clone_ddl_error_abort'; |
| 66 |
SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl WAIT_FOR resume_clone'; |
| 67 |
SET GLOBAL clone_autotune_concurrency = OFF; |
| 68 |
SET GLOBAL clone_max_concurrency = 8; |
| 69 |
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; |
| 70 |
# In connection CON1 |
| 71 |
SET DEBUG_SYNC = 'now WAIT_FOR start_ddl'; |
| 72 |
SET DEBUG_SYNC = 'clone_notify_ddl_before_state_block SIGNAL resume_clone'; |
| 73 |
CREATE TABLE t2(col1 int); |
| 74 |
INSERT INTO t2 VALUES(10), (20), (30); |
| 75 |
SELECT * FROM t2 ORDER BY col1; |
| 76 |
col1 |
| 77 |
10 |
| 78 |
20 |
| 79 |
30 |
| 80 |
# In connection DEFAULT |
| 81 |
ERROR HY000: Concurrent DDL is performed during clone operation. Please try again. |
| 82 |
SET GLOBAL DEBUG = '-d,clone_ddl_error_abort'; |
| 83 |
SET DEBUG_SYNC = 'RESET'; |
| 84 |
#Cleanup |
| 85 |
DROP TABLE t1; |
| 86 |
DROP TABLE t2; |
| 87 |
# In connection DEFAULT |
| 88 |
SET DEBUG_SYNC = 'RESET'; |
| 89 |
# Attempt to uninstall clone if there |
| 90 |
UNINSTALL PLUGIN clone; |
| 91 |
# Restart server |
| 92 |
# restart |
| 93 |
# Uninstall clone if there |
| 94 |
UNINSTALL PLUGIN clone; |