Debian Codegraph @

mysql-test/suite/clone/r/remote_ddl_skip_validation.result

raw
1 INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN';
2 SET GLOBAL innodb_ddl_threads = 1;
3 CREATE TABLE t1(col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB);
4 CREATE TABLE t2(col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB)
5 PARTITION BY KEY(col1) PARTITIONS 5;
6 CREATE PROCEDURE execute_dml(
7 p_dml_type INT,
8 p_key_min INT,
9 p_key_range INT,
10 p_loop_count INT,
11 p_frequency INT,
12 p_is_rand INT)
13 BEGIN
14 DECLARE v_idx INT DEFAULT 0;
15 DECLARE v_commit INT DEFAULT 0;
16 DECLARE v_key INT DEFAULT 0;
17 /* Loop and INSERT data at random position */
18 WHILE(v_idx < p_loop_count) DO
19 /* Generate key between 1 to p_loop_count */
20 IF p_is_rand = 1 THEN
21 SET v_key = p_key_min + FLOOR(RAND() * p_key_range);
22 ELSE
23 SET v_key = p_key_min + (v_idx % p_key_range);
24 END IF;
25 CASE p_dml_type
26 WHEN 0 THEN
27 SET @clol3_text = CONCAT('Clone Test Row - ', v_key);
28 INSERT INTO t1 (col1, col2, col3, col4) VALUES (
29 v_key, v_key * 10,
30 @clol3_text, REPEAT('Large Column Data ', 2048))
31 ON DUPLICATE KEY UPDATE col2 = col2 + 1;
32 INSERT INTO t2 (col1, col2, col3, col4) VALUES (
33 v_key, v_key * 10,
34 @clol3_text, REPEAT('Large Column Data ', 2048))
35 ON DUPLICATE KEY UPDATE col2 = col2 + 1;
36 WHEN 1 THEN
37 UPDATE t1 SET col2 = v_idx + 1 WHERE col1 = v_key;
38 UPDATE t2 SET col2 = v_idx + 1 WHERE col1 = v_key;
39 WHEN 2 THEN
40 DELETE FROM t1 WHERE col1 = v_key;
41 DELETE FROM t2 WHERE col1 = v_key;
42 ELSE
43 DELETE FROM t1;
44 DELETE FROM t2;
45 END CASE;
46 SET v_idx = v_idx + 1;
47 /* Commit or rollback work at specified frequency. */
48 IF v_idx % p_frequency = 0 THEN
49 SET v_commit = FLOOR(RAND() * 2);
50 IF v_commit = 0 AND p_is_rand = 1 THEN
51 ROLLBACK;
52 START TRANSACTION;
53 ELSE
54 COMMIT;
55 START TRANSACTION;
56 END IF;
57 END IF;
58 END WHILE;
59 COMMIT;
60 END|
61 call execute_dml(0, 0, 100, 100, 10, 0);
62 CREATE TABLE t SELECT * FROM t1;
63 CREATE TABLE t0 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB);
64 CREATE TABLE t01 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB);
65 CREATE TABLE t3 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB);
66 CREATE TABLE t11 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB);
67 CREATE TABLE t21 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB);
68 INSERT INTO t11 SELECT * FROM t;
69 INSERT INTO t21 SELECT * FROM t;
70 SHOW VARIABLES LIKE 'clone_ddl_timeout';
71 Variable_name Value
72 clone_ddl_timeout 300
73 SHOW VARIABLES LIKE 'clone_block_ddl';
74 Variable_name Value
75 clone_block_ddl OFF
76 # restart: --skip-innodb-validate-tablespace-paths
77 # 1. ALTER TABLE ADD COLUMN while clone in progress
78 RESET MASTER;
79 SET GLOBAL DEBUG = '+d,remote_release_clone_file_pin';
80 ALTER TABLE t0 ADD COLUMN col5 int, ALGORITHM=COPY ;
81 SET DEBUG_SYNC = 'clone_before_init_meta SIGNAL start_ddl_file_init WAIT_FOR resume_file_init';
82 SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_file WAIT_FOR resume_file';
83 SET DEBUG_SYNC = 'clone_file_copy_end_before_ack SIGNAL start_ddl_file_ack WAIT_FOR resume_file_ack';
84 SET DEBUG_SYNC = 'clone_before_file_ddl_meta SIGNAL start_ddl_file_meta WAIT_FOR resume_file_meta';
85 SET DEBUG_SYNC = 'clone_page_copy SIGNAL start_ddl_page WAIT_FOR resume_page';
86 SET DEBUG_SYNC = 'clone_before_page_ddl_meta SIGNAL start_ddl_page_meta WAIT_FOR resume_page_meta';
87 SET DEBUG_SYNC = 'clone_redo_copy SIGNAL start_ddl_redo WAIT_FOR resume_redo';
88 SET GLOBAL clone_autotune_concurrency = OFF;
89 SET GLOBAL clone_max_concurrency = 8;
90 SET GLOBAL clone_valid_donor_list = 'HOST:PORT';
91 CLONE INSTANCE FROM USER@HOST:PORT IDENTIFIED BY '' DATA DIRECTORY = 'CLONE_DATADIR';
92 # In connection CON1
93 ALTER TABLE t01 ADD COLUMN col5 int, ALGORITHM=COPY ;
94 SET DEBUG_SYNC = 'now SIGNAL resume_file_init';
95 # Waiting for clone to reach 'file copy'
96 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file';
97 # Wait finished
98 # For remote clone, let the donor progress concurrently
99 # otherwise file pins may not be released causing deadlock
100 SET DEBUG_SYNC = 'clone_notify_ddl SIGNAL resume_file';
101 ALTER TABLE t1 ADD COLUMN col5 int, ALGORITHM=COPY ;
102 CALL execute_dml(0, 0, 100, 100, 10, 0);
103 # Flush all dirty pages to track
104 SET GLOBAL innodb_buf_flush_list_now = 1;
105 SET DEBUG_SYNC = 'now SIGNAL resume_file';
106 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_ack';
107 SET DEBUG_SYNC = 'now SIGNAL resume_file_ack';
108 ALTER TABLE t11 ADD COLUMN col5 int, ALGORITHM=COPY ;
109 INSERT INTO t11 SELECT col1, col2, col3, col4, col2 + 100 FROM t ON DUPLICATE KEY UPDATE col2 = t11.col2 + 1;;
110 SET DEBUG_SYNC = 'now SIGNAL resume_file_meta';
111 # Waiting for clone to reach 'page copy'
112 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page';
113 # Wait finished
114 ALTER TABLE t2 ADD COLUMN col5 int, ALGORITHM=COPY ;
115 CALL execute_dml(0, 0, 100, 100, 10, 0);
116 SET DEBUG_SYNC = 'now SIGNAL resume_page';
117 # Waiting for clone to reach 'redo copy'
118 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_redo';
119 # Wait finished
120 ALTER TABLE t21 ADD COLUMN col5 int, ALGORITHM=COPY ;
121 INSERT INTO t21 SELECT col1, col2, col3, col4, col2 + 100 FROM t ON DUPLICATE KEY UPDATE col2 = t21.col2 + 1;;
122 ALTER TABLE t3 ADD COLUMN col5 int, ALGORITHM=COPY ;
123 SET DEBUG_SYNC = 'now SIGNAL resume_redo';
124 # In connection DEFAULT
125 # Waiting for clone to complete
126 # Wait finished
127 SET GLOBAL DEBUG = '-d,remote_release_clone_file_pin';
128 # Restart server on cloned data directory
129 # restart: --datadir=CLONE_DATADIR
130 # Check cloned data
131 SHOW TABLES;
132 Tables_in_test
133 t
134 t0
135 t01
136 t1
137 t11
138 t2
139 t21
140 t3
141 SHOW CREATE TABLE t1;
142 Table Create Table
143 t1 CREATE TABLE `t1` (
144 `col1` int NOT NULL,
145 `col2` int DEFAULT NULL,
146 `col3` varchar(64) DEFAULT NULL,
147 `col4` blob,
148 `col5` int DEFAULT NULL,
149 PRIMARY KEY (`col1`)
150 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
151 CHECK TABLE t1 EXTENDED;
152 Table Op Msg_type Msg_text
153 test.t1 check status OK
154 SELECT count(*) from t1;
155 count(*)
156 100
157 SELECT col1, col2, col3 FROM t1 ORDER BY col1 LIMIT 10;;
158 col1 col2 col3
159 0 2 Clone Test Row - 0
160 1 12 Clone Test Row - 1
161 2 22 Clone Test Row - 2
162 3 32 Clone Test Row - 3
163 4 42 Clone Test Row - 4
164 5 52 Clone Test Row - 5
165 6 62 Clone Test Row - 6
166 7 72 Clone Test Row - 7
167 8 82 Clone Test Row - 8
168 9 92 Clone Test Row - 9
169 SELECT col1, col2, col3 FROM t1 ORDER BY col1 DESC LIMIT 10;;
170 col1 col2 col3
171 99 992 Clone Test Row - 99
172 98 982 Clone Test Row - 98
173 97 972 Clone Test Row - 97
174 96 962 Clone Test Row - 96
175 95 952 Clone Test Row - 95
176 94 942 Clone Test Row - 94
177 93 932 Clone Test Row - 93
178 92 922 Clone Test Row - 92
179 91 912 Clone Test Row - 91
180 90 902 Clone Test Row - 90
181 SHOW CREATE TABLE t11;
182 Table Create Table
183 t11 CREATE TABLE `t11` (
184 `col1` int NOT NULL,
185 `col2` int DEFAULT NULL,
186 `col3` varchar(64) DEFAULT NULL,
187 `col4` blob,
188 `col5` int DEFAULT NULL,
189 PRIMARY KEY (`col1`)
190 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
191 CHECK TABLE t11 EXTENDED;
192 Table Op Msg_type Msg_text
193 test.t11 check status OK
194 SELECT count(*) from t11;
195 count(*)
196 100
197 SELECT col1, col2, col3 FROM t11 ORDER BY col1 LIMIT 10;;
198 col1 col2 col3
199 0 1 Clone Test Row - 0
200 1 11 Clone Test Row - 1
201 2 21 Clone Test Row - 2
202 3 31 Clone Test Row - 3
203 4 41 Clone Test Row - 4
204 5 51 Clone Test Row - 5
205 6 61 Clone Test Row - 6
206 7 71 Clone Test Row - 7
207 8 81 Clone Test Row - 8
208 9 91 Clone Test Row - 9
209 SELECT col1, col2, col3 FROM t11 ORDER BY col1 DESC LIMIT 10;;
210 col1 col2 col3
211 99 991 Clone Test Row - 99
212 98 981 Clone Test Row - 98
213 97 971 Clone Test Row - 97
214 96 961 Clone Test Row - 96
215 95 951 Clone Test Row - 95
216 94 941 Clone Test Row - 94
217 93 931 Clone Test Row - 93
218 92 921 Clone Test Row - 92
219 91 911 Clone Test Row - 91
220 90 901 Clone Test Row - 90
221 SHOW CREATE TABLE t2;
222 Table Create Table
223 t2 CREATE TABLE `t2` (
224 `col1` int NOT NULL,
225 `col2` int DEFAULT NULL,
226 `col3` varchar(64) DEFAULT NULL,
227 `col4` blob,
228 `col5` int DEFAULT NULL,
229 PRIMARY KEY (`col1`)
230 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
231 /*!50100 PARTITION BY KEY (col1)
232 PARTITIONS 5 */
233 CHECK TABLE t2 EXTENDED;
234 Table Op Msg_type Msg_text
235 test.t2 check status OK
236 SELECT count(*) from t2;
237 count(*)
238 100
239 SELECT col1, col2, col3 FROM t2 ORDER BY col1 LIMIT 10;;
240 col1 col2 col3
241 0 2 Clone Test Row - 0
242 1 12 Clone Test Row - 1
243 2 22 Clone Test Row - 2
244 3 32 Clone Test Row - 3
245 4 42 Clone Test Row - 4
246 5 52 Clone Test Row - 5
247 6 62 Clone Test Row - 6
248 7 72 Clone Test Row - 7
249 8 82 Clone Test Row - 8
250 9 92 Clone Test Row - 9
251 SELECT col1, col2, col3 FROM t2 ORDER BY col1 DESC LIMIT 10;;
252 col1 col2 col3
253 99 992 Clone Test Row - 99
254 98 982 Clone Test Row - 98
255 97 972 Clone Test Row - 97
256 96 962 Clone Test Row - 96
257 95 952 Clone Test Row - 95
258 94 942 Clone Test Row - 94
259 93 932 Clone Test Row - 93
260 92 922 Clone Test Row - 92
261 91 912 Clone Test Row - 91
262 90 902 Clone Test Row - 90
263 call execute_dml(1, 0, 100, 100, 10, 0);
264 # Restart server back on base data directory
265 # restart: --skip-innodb-validate-tablespace-paths
266 SET DEBUG_SYNC = 'RESET';
267 # 2. ALTER TABLE DROP COLUMN while clone in progress
268 RESET MASTER;
269 SET GLOBAL DEBUG = '+d,remote_release_clone_file_pin';
270 ALTER TABLE t0 DROP COLUMN col5, ALGORITHM=COPY ;
271 SET DEBUG_SYNC = 'clone_before_init_meta SIGNAL start_ddl_file_init WAIT_FOR resume_file_init';
272 SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_file WAIT_FOR resume_file';
273 SET DEBUG_SYNC = 'clone_file_copy_end_before_ack SIGNAL start_ddl_file_ack WAIT_FOR resume_file_ack';
274 SET DEBUG_SYNC = 'clone_before_file_ddl_meta SIGNAL start_ddl_file_meta WAIT_FOR resume_file_meta';
275 SET DEBUG_SYNC = 'clone_page_copy SIGNAL start_ddl_page WAIT_FOR resume_page';
276 SET DEBUG_SYNC = 'clone_before_page_ddl_meta SIGNAL start_ddl_page_meta WAIT_FOR resume_page_meta';
277 SET DEBUG_SYNC = 'clone_redo_copy SIGNAL start_ddl_redo WAIT_FOR resume_redo';
278 SET GLOBAL clone_autotune_concurrency = OFF;
279 SET GLOBAL clone_max_concurrency = 8;
280 SET GLOBAL clone_valid_donor_list = 'HOST:PORT';
281 CLONE INSTANCE FROM USER@HOST:PORT IDENTIFIED BY '' DATA DIRECTORY = 'CLONE_DATADIR';
282 # In connection CON1
283 ALTER TABLE t01 DROP COLUMN col5, ALGORITHM=COPY ;
284 SET DEBUG_SYNC = 'now SIGNAL resume_file_init';
285 # Waiting for clone to reach 'file copy'
286 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file';
287 # Wait finished
288 # For remote clone, let the donor progress concurrently
289 # otherwise file pins may not be released causing deadlock
290 SET DEBUG_SYNC = 'clone_notify_ddl SIGNAL resume_file';
291 ALTER TABLE t1 DROP COLUMN col5, ALGORITHM=COPY ;
292 call execute_dml(1, 0, 100, 100, 10, 0);
293 # Flush all dirty pages to track
294 SET GLOBAL innodb_buf_flush_list_now = 1;
295 SET DEBUG_SYNC = 'now SIGNAL resume_file';
296 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_ack';
297 SET DEBUG_SYNC = 'now SIGNAL resume_file_ack';
298 ALTER TABLE t11 DROP COLUMN col5, ALGORITHM=COPY ;
299 INSERT INTO t11 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t11.col2 + 1;;
300 SET DEBUG_SYNC = 'now SIGNAL resume_file_meta';
301 # Waiting for clone to reach 'page copy'
302 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page';
303 # Wait finished
304 ALTER TABLE t2 DROP COLUMN col5, ALGORITHM=COPY ;
305 call execute_dml(1, 0, 100, 100, 10, 0);
306 SET DEBUG_SYNC = 'now SIGNAL resume_page';
307 # Waiting for clone to reach 'redo copy'
308 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_redo';
309 # Wait finished
310 ALTER TABLE t21 DROP COLUMN col5, ALGORITHM=COPY ;
311 INSERT INTO t21 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t21.col2 + 1;;
312 ALTER TABLE t3 DROP COLUMN col5, ALGORITHM=COPY ;
313 SET DEBUG_SYNC = 'now SIGNAL resume_redo';
314 # In connection DEFAULT
315 # Waiting for clone to complete
316 # Wait finished
317 SET GLOBAL DEBUG = '-d,remote_release_clone_file_pin';
318 # Restart server on cloned data directory
319 # restart: --datadir=CLONE_DATADIR
320 # Check cloned data
321 SHOW TABLES;
322 Tables_in_test
323 t
324 t0
325 t01
326 t1
327 t11
328 t2
329 t21
330 t3
331 SHOW CREATE TABLE t1;
332 Table Create Table
333 t1 CREATE TABLE `t1` (
334 `col1` int NOT NULL,
335 `col2` int DEFAULT NULL,
336 `col3` varchar(64) DEFAULT NULL,
337 `col4` blob,
338 PRIMARY KEY (`col1`)
339 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
340 CHECK TABLE t1 EXTENDED;
341 Table Op Msg_type Msg_text
342 test.t1 check status OK
343 SELECT count(*) from t1;
344 count(*)
345 100
346 SELECT col1, col2, col3 FROM t1 ORDER BY col1 LIMIT 10;;
347 col1 col2 col3
348 0 1 Clone Test Row - 0
349 1 2 Clone Test Row - 1
350 2 3 Clone Test Row - 2
351 3 4 Clone Test Row - 3
352 4 5 Clone Test Row - 4
353 5 6 Clone Test Row - 5
354 6 7 Clone Test Row - 6
355 7 8 Clone Test Row - 7
356 8 9 Clone Test Row - 8
357 9 10 Clone Test Row - 9
358 SELECT col1, col2, col3 FROM t1 ORDER BY col1 DESC LIMIT 10;;
359 col1 col2 col3
360 99 100 Clone Test Row - 99
361 98 99 Clone Test Row - 98
362 97 98 Clone Test Row - 97
363 96 97 Clone Test Row - 96
364 95 96 Clone Test Row - 95
365 94 95 Clone Test Row - 94
366 93 94 Clone Test Row - 93
367 92 93 Clone Test Row - 92
368 91 92 Clone Test Row - 91
369 90 91 Clone Test Row - 90
370 SHOW CREATE TABLE t11;
371 Table Create Table
372 t11 CREATE TABLE `t11` (
373 `col1` int NOT NULL,
374 `col2` int DEFAULT NULL,
375 `col3` varchar(64) DEFAULT NULL,
376 `col4` blob,
377 PRIMARY KEY (`col1`)
378 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
379 CHECK TABLE t11 EXTENDED;
380 Table Op Msg_type Msg_text
381 test.t11 check status OK
382 SELECT count(*) from t11;
383 count(*)
384 100
385 SELECT col1, col2, col3 FROM t11 ORDER BY col1 LIMIT 10;;
386 col1 col2 col3
387 0 2 Clone Test Row - 0
388 1 12 Clone Test Row - 1
389 2 22 Clone Test Row - 2
390 3 32 Clone Test Row - 3
391 4 42 Clone Test Row - 4
392 5 52 Clone Test Row - 5
393 6 62 Clone Test Row - 6
394 7 72 Clone Test Row - 7
395 8 82 Clone Test Row - 8
396 9 92 Clone Test Row - 9
397 SELECT col1, col2, col3 FROM t11 ORDER BY col1 DESC LIMIT 10;;
398 col1 col2 col3
399 99 992 Clone Test Row - 99
400 98 982 Clone Test Row - 98
401 97 972 Clone Test Row - 97
402 96 962 Clone Test Row - 96
403 95 952 Clone Test Row - 95
404 94 942 Clone Test Row - 94
405 93 932 Clone Test Row - 93
406 92 922 Clone Test Row - 92
407 91 912 Clone Test Row - 91
408 90 902 Clone Test Row - 90
409 SHOW CREATE TABLE t2;
410 Table Create Table
411 t2 CREATE TABLE `t2` (
412 `col1` int NOT NULL,
413 `col2` int DEFAULT NULL,
414 `col3` varchar(64) DEFAULT NULL,
415 `col4` blob,
416 PRIMARY KEY (`col1`)
417 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
418 /*!50100 PARTITION BY KEY (col1)
419 PARTITIONS 5 */
420 CHECK TABLE t2 EXTENDED;
421 Table Op Msg_type Msg_text
422 test.t2 check status OK
423 SELECT count(*) from t2;
424 count(*)
425 100
426 SELECT col1, col2, col3 FROM t2 ORDER BY col1 LIMIT 10;;
427 col1 col2 col3
428 0 1 Clone Test Row - 0
429 1 2 Clone Test Row - 1
430 2 3 Clone Test Row - 2
431 3 4 Clone Test Row - 3
432 4 5 Clone Test Row - 4
433 5 6 Clone Test Row - 5
434 6 7 Clone Test Row - 6
435 7 8 Clone Test Row - 7
436 8 9 Clone Test Row - 8
437 9 10 Clone Test Row - 9
438 SELECT col1, col2, col3 FROM t2 ORDER BY col1 DESC LIMIT 10;;
439 col1 col2 col3
440 99 100 Clone Test Row - 99
441 98 99 Clone Test Row - 98
442 97 98 Clone Test Row - 97
443 96 97 Clone Test Row - 96
444 95 96 Clone Test Row - 95
445 94 95 Clone Test Row - 94
446 93 94 Clone Test Row - 93
447 92 93 Clone Test Row - 92
448 91 92 Clone Test Row - 91
449 90 91 Clone Test Row - 90
450 call execute_dml(1, 0, 100, 100, 10, 0);
451 # Restart server back on base data directory
452 # restart: --skip-innodb-validate-tablespace-paths
453 SET DEBUG_SYNC = 'RESET';
454 # 3. ADD INDEX while clone in progress
455 SET GLOBAL innodb_ddl_threads = 1;
456 RESET MASTER;
457 SET GLOBAL DEBUG = '+d,remote_release_clone_file_pin';
458 ALTER TABLE t0 ADD INDEX col2_idx(col2), ALGORITHM=COPY ;
459 SET DEBUG_SYNC = 'clone_before_init_meta SIGNAL start_ddl_file_init WAIT_FOR resume_file_init';
460 SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_file WAIT_FOR resume_file';
461 SET DEBUG_SYNC = 'clone_file_copy_end_before_ack SIGNAL start_ddl_file_ack WAIT_FOR resume_file_ack';
462 SET DEBUG_SYNC = 'clone_before_file_ddl_meta SIGNAL start_ddl_file_meta WAIT_FOR resume_file_meta';
463 SET DEBUG_SYNC = 'clone_page_copy SIGNAL start_ddl_page WAIT_FOR resume_page';
464 SET DEBUG_SYNC = 'clone_before_page_ddl_meta SIGNAL start_ddl_page_meta WAIT_FOR resume_page_meta';
465 SET DEBUG_SYNC = 'clone_redo_copy SIGNAL start_ddl_redo WAIT_FOR resume_redo';
466 SET GLOBAL clone_autotune_concurrency = OFF;
467 SET GLOBAL clone_max_concurrency = 8;
468 SET GLOBAL clone_valid_donor_list = 'HOST:PORT';
469 CLONE INSTANCE FROM USER@HOST:PORT IDENTIFIED BY '' DATA DIRECTORY = 'CLONE_DATADIR';
470 # In connection CON1
471 ALTER TABLE t01 ADD INDEX col2_idx(col2), ALGORITHM=COPY ;
472 SET DEBUG_SYNC = 'now SIGNAL resume_file_init';
473 # Waiting for clone to reach 'file copy'
474 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file';
475 # Wait finished
476 # For remote clone, let the donor progress concurrently
477 # otherwise file pins may not be released causing deadlock
478 SET DEBUG_SYNC = 'clone_notify_ddl SIGNAL resume_file';
479 ALTER TABLE t1 ADD INDEX col2_idx(col2), ALGORITHM=COPY ;
480 CALL execute_dml(0, 0, 100, 100, 10, 0);
481 # Flush all dirty pages to track
482 SET GLOBAL innodb_buf_flush_list_now = 1;
483 SET DEBUG_SYNC = 'now SIGNAL resume_file';
484 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_ack';
485 SET DEBUG_SYNC = 'now SIGNAL resume_file_ack';
486 ALTER TABLE t11 ADD INDEX col2_idx(col2), ALGORITHM=COPY ;
487 INSERT INTO t11 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t11.col2 + 1;;
488 SET DEBUG_SYNC = 'now SIGNAL resume_file_meta';
489 # Waiting for clone to reach 'page copy'
490 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page';
491 # Wait finished
492 ALTER TABLE t2 ADD INDEX col2_idx(col2), ALGORITHM=COPY ;
493 CALL execute_dml(0, 0, 100, 100, 10, 0);
494 SET DEBUG_SYNC = 'now SIGNAL resume_page';
495 # Waiting for clone to reach 'redo copy'
496 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_redo';
497 # Wait finished
498 ALTER TABLE t21 ADD INDEX col2_idx(col2), ALGORITHM=COPY ;
499 INSERT INTO t21 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t21.col2 + 1;;
500 ALTER TABLE t3 ADD INDEX col2_idx(col2), ALGORITHM=COPY ;
501 SET DEBUG_SYNC = 'now SIGNAL resume_redo';
502 # In connection DEFAULT
503 # Waiting for clone to complete
504 # Wait finished
505 SET GLOBAL DEBUG = '-d,remote_release_clone_file_pin';
506 # Restart server on cloned data directory
507 # restart: --datadir=CLONE_DATADIR
508 # Check cloned data
509 SHOW TABLES;
510 Tables_in_test
511 t
512 t0
513 t01
514 t1
515 t11
516 t2
517 t21
518 t3
519 SHOW CREATE TABLE t1;
520 Table Create Table
521 t1 CREATE TABLE `t1` (
522 `col1` int NOT NULL,
523 `col2` int DEFAULT NULL,
524 `col3` varchar(64) DEFAULT NULL,
525 `col4` blob,
526 PRIMARY KEY (`col1`),
527 KEY `col2_idx` (`col2`)
528 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
529 CHECK TABLE t1 EXTENDED;
530 Table Op Msg_type Msg_text
531 test.t1 check status OK
532 SELECT count(*) from t1;
533 count(*)
534 100
535 SELECT col1, col2, col3 FROM t1 ORDER BY col1 LIMIT 10;;
536 col1 col2 col3
537 0 3 Clone Test Row - 0
538 1 4 Clone Test Row - 1
539 2 5 Clone Test Row - 2
540 3 6 Clone Test Row - 3
541 4 7 Clone Test Row - 4
542 5 8 Clone Test Row - 5
543 6 9 Clone Test Row - 6
544 7 10 Clone Test Row - 7
545 8 11 Clone Test Row - 8
546 9 12 Clone Test Row - 9
547 SELECT col1, col2, col3 FROM t1 ORDER BY col1 DESC LIMIT 10;;
548 col1 col2 col3
549 99 102 Clone Test Row - 99
550 98 101 Clone Test Row - 98
551 97 100 Clone Test Row - 97
552 96 99 Clone Test Row - 96
553 95 98 Clone Test Row - 95
554 94 97 Clone Test Row - 94
555 93 96 Clone Test Row - 93
556 92 95 Clone Test Row - 92
557 91 94 Clone Test Row - 91
558 90 93 Clone Test Row - 90
559 SHOW CREATE TABLE t11;
560 Table Create Table
561 t11 CREATE TABLE `t11` (
562 `col1` int NOT NULL,
563 `col2` int DEFAULT NULL,
564 `col3` varchar(64) DEFAULT NULL,
565 `col4` blob,
566 PRIMARY KEY (`col1`),
567 KEY `col2_idx` (`col2`)
568 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
569 CHECK TABLE t11 EXTENDED;
570 Table Op Msg_type Msg_text
571 test.t11 check status OK
572 SELECT count(*) from t11;
573 count(*)
574 100
575 SELECT col1, col2, col3 FROM t11 ORDER BY col1 LIMIT 10;;
576 col1 col2 col3
577 0 3 Clone Test Row - 0
578 1 13 Clone Test Row - 1
579 2 23 Clone Test Row - 2
580 3 33 Clone Test Row - 3
581 4 43 Clone Test Row - 4
582 5 53 Clone Test Row - 5
583 6 63 Clone Test Row - 6
584 7 73 Clone Test Row - 7
585 8 83 Clone Test Row - 8
586 9 93 Clone Test Row - 9
587 SELECT col1, col2, col3 FROM t11 ORDER BY col1 DESC LIMIT 10;;
588 col1 col2 col3
589 99 993 Clone Test Row - 99
590 98 983 Clone Test Row - 98
591 97 973 Clone Test Row - 97
592 96 963 Clone Test Row - 96
593 95 953 Clone Test Row - 95
594 94 943 Clone Test Row - 94
595 93 933 Clone Test Row - 93
596 92 923 Clone Test Row - 92
597 91 913 Clone Test Row - 91
598 90 903 Clone Test Row - 90
599 SHOW CREATE TABLE t2;
600 Table Create Table
601 t2 CREATE TABLE `t2` (
602 `col1` int NOT NULL,
603 `col2` int DEFAULT NULL,
604 `col3` varchar(64) DEFAULT NULL,
605 `col4` blob,
606 PRIMARY KEY (`col1`),
607 KEY `col2_idx` (`col2`)
608 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
609 /*!50100 PARTITION BY KEY (col1)
610 PARTITIONS 5 */
611 CHECK TABLE t2 EXTENDED;
612 Table Op Msg_type Msg_text
613 test.t2 check status OK
614 SELECT count(*) from t2;
615 count(*)
616 100
617 SELECT col1, col2, col3 FROM t2 ORDER BY col1 LIMIT 10;;
618 col1 col2 col3
619 0 3 Clone Test Row - 0
620 1 4 Clone Test Row - 1
621 2 5 Clone Test Row - 2
622 3 6 Clone Test Row - 3
623 4 7 Clone Test Row - 4
624 5 8 Clone Test Row - 5
625 6 9 Clone Test Row - 6
626 7 10 Clone Test Row - 7
627 8 11 Clone Test Row - 8
628 9 12 Clone Test Row - 9
629 SELECT col1, col2, col3 FROM t2 ORDER BY col1 DESC LIMIT 10;;
630 col1 col2 col3
631 99 102 Clone Test Row - 99
632 98 101 Clone Test Row - 98
633 97 100 Clone Test Row - 97
634 96 99 Clone Test Row - 96
635 95 98 Clone Test Row - 95
636 94 97 Clone Test Row - 94
637 93 96 Clone Test Row - 93
638 92 95 Clone Test Row - 92
639 91 94 Clone Test Row - 91
640 90 93 Clone Test Row - 90
641 call execute_dml(1, 0, 100, 100, 10, 0);
642 # Restart server back on base data directory
643 # restart: --skip-innodb-validate-tablespace-paths
644 SET DEBUG_SYNC = 'RESET';
645 # 4. DROP INDEX while clone in progress
646 RESET MASTER;
647 SET GLOBAL DEBUG = '+d,remote_release_clone_file_pin';
648 ALTER TABLE t0 DROP INDEX col2_idx, ALGORITHM=COPY ;
649 SET DEBUG_SYNC = 'clone_before_init_meta SIGNAL start_ddl_file_init WAIT_FOR resume_file_init';
650 SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_file WAIT_FOR resume_file';
651 SET DEBUG_SYNC = 'clone_file_copy_end_before_ack SIGNAL start_ddl_file_ack WAIT_FOR resume_file_ack';
652 SET DEBUG_SYNC = 'clone_before_file_ddl_meta SIGNAL start_ddl_file_meta WAIT_FOR resume_file_meta';
653 SET DEBUG_SYNC = 'clone_page_copy SIGNAL start_ddl_page WAIT_FOR resume_page';
654 SET DEBUG_SYNC = 'clone_before_page_ddl_meta SIGNAL start_ddl_page_meta WAIT_FOR resume_page_meta';
655 SET DEBUG_SYNC = 'clone_redo_copy SIGNAL start_ddl_redo WAIT_FOR resume_redo';
656 SET GLOBAL clone_autotune_concurrency = OFF;
657 SET GLOBAL clone_max_concurrency = 8;
658 SET GLOBAL clone_valid_donor_list = 'HOST:PORT';
659 CLONE INSTANCE FROM USER@HOST:PORT IDENTIFIED BY '' DATA DIRECTORY = 'CLONE_DATADIR';
660 # In connection CON1
661 ALTER TABLE t01 DROP INDEX col2_idx, ALGORITHM=COPY ;
662 SET DEBUG_SYNC = 'now SIGNAL resume_file_init';
663 # Waiting for clone to reach 'file copy'
664 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file';
665 # Wait finished
666 # For remote clone, let the donor progress concurrently
667 # otherwise file pins may not be released causing deadlock
668 SET DEBUG_SYNC = 'clone_notify_ddl SIGNAL resume_file';
669 ALTER TABLE t1 DROP INDEX col2_idx, ALGORITHM=COPY ;
670 CALL execute_dml(0, 0, 100, 100, 10, 0);
671 # Flush all dirty pages to track
672 SET GLOBAL innodb_buf_flush_list_now = 1;
673 SET DEBUG_SYNC = 'now SIGNAL resume_file';
674 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_ack';
675 SET DEBUG_SYNC = 'now SIGNAL resume_file_ack';
676 ALTER TABLE t11 DROP INDEX col2_idx, ALGORITHM=COPY ;
677 INSERT INTO t11 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t11.col2 + 1;;
678 SET DEBUG_SYNC = 'now SIGNAL resume_file_meta';
679 # Waiting for clone to reach 'page copy'
680 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page';
681 # Wait finished
682 ALTER TABLE t2 DROP INDEX col2_idx, ALGORITHM=COPY ;
683 CALL execute_dml(0, 0, 100, 100, 10, 0);
684 SET DEBUG_SYNC = 'now SIGNAL resume_page';
685 # Waiting for clone to reach 'redo copy'
686 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_redo';
687 # Wait finished
688 ALTER TABLE t21 DROP INDEX col2_idx, ALGORITHM=COPY ;
689 INSERT INTO t21 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t21.col2 + 1;;
690 ALTER TABLE t3 DROP INDEX col2_idx, ALGORITHM=COPY ;
691 SET DEBUG_SYNC = 'now SIGNAL resume_redo';
692 # In connection DEFAULT
693 # Waiting for clone to complete
694 # Wait finished
695 SET GLOBAL DEBUG = '-d,remote_release_clone_file_pin';
696 # Restart server on cloned data directory
697 # restart: --datadir=CLONE_DATADIR
698 # Check cloned data
699 SHOW TABLES;
700 Tables_in_test
701 t
702 t0
703 t01
704 t1
705 t11
706 t2
707 t21
708 t3
709 SHOW CREATE TABLE t1;
710 Table Create Table
711 t1 CREATE TABLE `t1` (
712 `col1` int NOT NULL,
713 `col2` int DEFAULT NULL,
714 `col3` varchar(64) DEFAULT NULL,
715 `col4` blob,
716 PRIMARY KEY (`col1`)
717 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
718 CHECK TABLE t1 EXTENDED;
719 Table Op Msg_type Msg_text
720 test.t1 check status OK
721 SELECT count(*) from t1;
722 count(*)
723 100
724 SELECT col1, col2, col3 FROM t1 ORDER BY col1 LIMIT 10;;
725 col1 col2 col3
726 0 5 Clone Test Row - 0
727 1 6 Clone Test Row - 1
728 2 7 Clone Test Row - 2
729 3 8 Clone Test Row - 3
730 4 9 Clone Test Row - 4
731 5 10 Clone Test Row - 5
732 6 11 Clone Test Row - 6
733 7 12 Clone Test Row - 7
734 8 13 Clone Test Row - 8
735 9 14 Clone Test Row - 9
736 SELECT col1, col2, col3 FROM t1 ORDER BY col1 DESC LIMIT 10;;
737 col1 col2 col3
738 99 104 Clone Test Row - 99
739 98 103 Clone Test Row - 98
740 97 102 Clone Test Row - 97
741 96 101 Clone Test Row - 96
742 95 100 Clone Test Row - 95
743 94 99 Clone Test Row - 94
744 93 98 Clone Test Row - 93
745 92 97 Clone Test Row - 92
746 91 96 Clone Test Row - 91
747 90 95 Clone Test Row - 90
748 SHOW CREATE TABLE t11;
749 Table Create Table
750 t11 CREATE TABLE `t11` (
751 `col1` int NOT NULL,
752 `col2` int DEFAULT NULL,
753 `col3` varchar(64) DEFAULT NULL,
754 `col4` blob,
755 PRIMARY KEY (`col1`)
756 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
757 CHECK TABLE t11 EXTENDED;
758 Table Op Msg_type Msg_text
759 test.t11 check status OK
760 SELECT count(*) from t11;
761 count(*)
762 100
763 SELECT col1, col2, col3 FROM t11 ORDER BY col1 LIMIT 10;;
764 col1 col2 col3
765 0 4 Clone Test Row - 0
766 1 14 Clone Test Row - 1
767 2 24 Clone Test Row - 2
768 3 34 Clone Test Row - 3
769 4 44 Clone Test Row - 4
770 5 54 Clone Test Row - 5
771 6 64 Clone Test Row - 6
772 7 74 Clone Test Row - 7
773 8 84 Clone Test Row - 8
774 9 94 Clone Test Row - 9
775 SELECT col1, col2, col3 FROM t11 ORDER BY col1 DESC LIMIT 10;;
776 col1 col2 col3
777 99 994 Clone Test Row - 99
778 98 984 Clone Test Row - 98
779 97 974 Clone Test Row - 97
780 96 964 Clone Test Row - 96
781 95 954 Clone Test Row - 95
782 94 944 Clone Test Row - 94
783 93 934 Clone Test Row - 93
784 92 924 Clone Test Row - 92
785 91 914 Clone Test Row - 91
786 90 904 Clone Test Row - 90
787 SHOW CREATE TABLE t2;
788 Table Create Table
789 t2 CREATE TABLE `t2` (
790 `col1` int NOT NULL,
791 `col2` int DEFAULT NULL,
792 `col3` varchar(64) DEFAULT NULL,
793 `col4` blob,
794 PRIMARY KEY (`col1`)
795 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
796 /*!50100 PARTITION BY KEY (col1)
797 PARTITIONS 5 */
798 CHECK TABLE t2 EXTENDED;
799 Table Op Msg_type Msg_text
800 test.t2 check status OK
801 SELECT count(*) from t2;
802 count(*)
803 100
804 SELECT col1, col2, col3 FROM t2 ORDER BY col1 LIMIT 10;;
805 col1 col2 col3
806 0 5 Clone Test Row - 0
807 1 6 Clone Test Row - 1
808 2 7 Clone Test Row - 2
809 3 8 Clone Test Row - 3
810 4 9 Clone Test Row - 4
811 5 10 Clone Test Row - 5
812 6 11 Clone Test Row - 6
813 7 12 Clone Test Row - 7
814 8 13 Clone Test Row - 8
815 9 14 Clone Test Row - 9
816 SELECT col1, col2, col3 FROM t2 ORDER BY col1 DESC LIMIT 10;;
817 col1 col2 col3
818 99 104 Clone Test Row - 99
819 98 103 Clone Test Row - 98
820 97 102 Clone Test Row - 97
821 96 101 Clone Test Row - 96
822 95 100 Clone Test Row - 95
823 94 99 Clone Test Row - 94
824 93 98 Clone Test Row - 93
825 92 97 Clone Test Row - 92
826 91 96 Clone Test Row - 91
827 90 95 Clone Test Row - 90
828 call execute_dml(1, 0, 100, 100, 10, 0);
829 # Restart server back on base data directory
830 # restart:
831 SET DEBUG_SYNC = 'RESET';
832 # Cleanup
833 DROP TABLE t;
834 DROP TABLE t1;
835 DROP TABLE t2;
836 DROP PROCEDURE execute_dml;
837 DROP TABLE t0;
838 DROP TABLE t01;
839 DROP TABLE t3;
840 DROP TABLE t11;
841 DROP TABLE t21;
842 SET GLOBAL innodb_ddl_threads = default;
843 # Uninstall clone
844 UNINSTALL PLUGIN clone;