Debian Codegraph @

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

raw
1 # Prepare for creating Encrypted Table
2 # create bootstrap file
3 # Create and start mysqld with keyring plugin.
4 # restart: --datadir=ENCRYPT_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring
5 INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN';
6 CREATE TABLE t1(col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB);
7 CREATE TABLE t2(col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB)
8 PARTITION BY KEY(col1) PARTITIONS 5;
9 CREATE PROCEDURE execute_dml(
10 p_dml_type INT,
11 p_key_min INT,
12 p_key_range INT,
13 p_loop_count INT,
14 p_frequency INT,
15 p_is_rand INT)
16 BEGIN
17 DECLARE v_idx INT DEFAULT 0;
18 DECLARE v_commit INT DEFAULT 0;
19 DECLARE v_key INT DEFAULT 0;
20 /* Loop and INSERT data at random position */
21 WHILE(v_idx < p_loop_count) DO
22 /* Generate key between 1 to p_loop_count */
23 IF p_is_rand = 1 THEN
24 SET v_key = p_key_min + FLOOR(RAND() * p_key_range);
25 ELSE
26 SET v_key = p_key_min + (v_idx % p_key_range);
27 END IF;
28 CASE p_dml_type
29 WHEN 0 THEN
30 SET @clol3_text = CONCAT('Clone Test Row - ', v_key);
31 INSERT INTO t1 (col1, col2, col3, col4) VALUES (
32 v_key, v_key * 10,
33 @clol3_text, REPEAT('Large Column Data ', 2048))
34 ON DUPLICATE KEY UPDATE col2 = col2 + 1;
35 INSERT INTO t2 (col1, col2, col3, col4) VALUES (
36 v_key, v_key * 10,
37 @clol3_text, REPEAT('Large Column Data ', 2048))
38 ON DUPLICATE KEY UPDATE col2 = col2 + 1;
39 WHEN 1 THEN
40 UPDATE t1 SET col2 = v_idx + 1 WHERE col1 = v_key;
41 UPDATE t2 SET col2 = v_idx + 1 WHERE col1 = v_key;
42 WHEN 2 THEN
43 DELETE FROM t1 WHERE col1 = v_key;
44 DELETE FROM t2 WHERE col1 = v_key;
45 ELSE
46 DELETE FROM t1;
47 DELETE FROM t2;
48 END CASE;
49 SET v_idx = v_idx + 1;
50 /* Commit or rollback work at specified frequency. */
51 IF v_idx % p_frequency = 0 THEN
52 SET v_commit = FLOOR(RAND() * 2);
53 IF v_commit = 0 AND p_is_rand = 1 THEN
54 ROLLBACK;
55 START TRANSACTION;
56 ELSE
57 COMMIT;
58 START TRANSACTION;
59 END IF;
60 END IF;
61 END WHILE;
62 COMMIT;
63 END|
64 call execute_dml(0, 0, 100, 100, 10, 0);
65 CREATE TABLE t SELECT * FROM t1;
66 DROP table t1;
67 DROP table t2;
68 SHOW VARIABLES LIKE 'clone_ddl_timeout';
69 Variable_name Value
70 clone_ddl_timeout 300
71 SHOW VARIABLES LIKE 'clone_block_ddl';
72 Variable_name Value
73 clone_block_ddl OFF
74 # 1. CREATE TABLE with encryption while clone in progress
75 RESET MASTER;
76 SET GLOBAL DEBUG = '+d,local_release_clone_file_pin';
77 SET GLOBAL DEBUG = '+d,log_redo_with_invalid_master_key';
78 CREATE TABLE t0 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB) COMPRESSION = "LZ4";
79 SET DEBUG_SYNC = 'clone_before_init_meta SIGNAL start_ddl_file_init WAIT_FOR resume_file_init';
80 SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_file WAIT_FOR resume_file';
81 SET DEBUG_SYNC = 'clone_file_copy_end_before_ack SIGNAL start_ddl_file_ack WAIT_FOR resume_file_ack';
82 SET DEBUG_SYNC = 'clone_before_file_ddl_meta SIGNAL start_ddl_file_meta WAIT_FOR resume_file_meta';
83 SET DEBUG_SYNC = 'clone_page_copy SIGNAL start_ddl_page WAIT_FOR resume_page';
84 SET DEBUG_SYNC = 'clone_before_page_ddl_meta SIGNAL start_ddl_page_meta WAIT_FOR resume_page_meta';
85 SET DEBUG_SYNC = 'clone_redo_copy SIGNAL start_ddl_redo WAIT_FOR resume_redo';
86 SET GLOBAL clone_autotune_concurrency = OFF;
87 SET GLOBAL clone_max_concurrency = 8;
88 CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR';
89 # In connection CON1
90 # Waiting for clone to reach 'Initial metadata transfer'
91 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_init';
92 # Wait finished
93 CREATE TABLE t01 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB) COMPRESSION = "LZ4";
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 CREATE TABLE t1 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB) COMPRESSION = "LZ4";
99 INSERT INTO t1 SELECT * FROM t;
100 # Flush all dirty pages to track
101 SET GLOBAL innodb_buf_flush_list_now = 1;
102 SET DEBUG_SYNC = 'now SIGNAL resume_file';
103 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_ack';
104 SET DEBUG_SYNC = 'now SIGNAL resume_file_ack';
105 # Waiting for clone to reach DDL metadata for 'file copy'
106 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_meta';
107 # Wait finished
108 CREATE TABLE t11 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB) COMPRESSION = "LZ4";
109 INSERT INTO t11 SELECT * FROM t;
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 CREATE TABLE t2 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB) COMPRESSION = "LZ4";
115 CALL execute_dml(0, 0, 100, 100, 10, 0);
116 SET DEBUG_SYNC = 'now SIGNAL resume_page';
117 # Waiting for clone to reach DDL metadata for 'page copy'
118 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page_meta';
119 # Wait finished
120 CREATE TABLE t21 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB) COMPRESSION = "LZ4";
121 INSERT INTO t21 SELECT * FROM t;
122 SET DEBUG_SYNC = 'now SIGNAL resume_page_meta';
123 # Waiting for clone to reach 'redo copy'
124 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_redo';
125 # Wait finished
126 CREATE TABLE t3 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB) COMPRESSION = "LZ4";
127 SET DEBUG_SYNC = 'now SIGNAL resume_redo';
128 # In connection DEFAULT
129 # Waiting for clone to complete
130 # Wait finished
131 SET GLOBAL DEBUG = '-d,local_release_clone_file_pin';
132 # Restart server on cloned data directory
133 # restart: --datadir=CLONE_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring
134 # Check cloned data
135 SHOW TABLES;
136 Tables_in_test
137 t
138 t0
139 t01
140 t1
141 t11
142 t2
143 SHOW CREATE TABLE t1;
144 Table Create Table
145 t1 CREATE TABLE `t1` (
146 `col1` int NOT NULL,
147 `col2` int DEFAULT NULL,
148 `col3` varchar(64) DEFAULT NULL,
149 `col4` blob,
150 PRIMARY KEY (`col1`)
151 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMPRESSION='LZ4'
152 CHECK TABLE t1 EXTENDED;
153 Table Op Msg_type Msg_text
154 test.t1 check status OK
155 SELECT count(*) from t1;
156 count(*)
157 100
158 SELECT col1, col2, col3 FROM t1 ORDER BY col1 LIMIT 10;;
159 col1 col2 col3
160 0 1 Clone Test Row - 0
161 1 11 Clone Test Row - 1
162 2 21 Clone Test Row - 2
163 3 31 Clone Test Row - 3
164 4 41 Clone Test Row - 4
165 5 51 Clone Test Row - 5
166 6 61 Clone Test Row - 6
167 7 71 Clone Test Row - 7
168 8 81 Clone Test Row - 8
169 9 91 Clone Test Row - 9
170 SELECT col1, col2, col3 FROM t1 ORDER BY col1 DESC LIMIT 10;;
171 col1 col2 col3
172 99 991 Clone Test Row - 99
173 98 981 Clone Test Row - 98
174 97 971 Clone Test Row - 97
175 96 961 Clone Test Row - 96
176 95 951 Clone Test Row - 95
177 94 941 Clone Test Row - 94
178 93 931 Clone Test Row - 93
179 92 921 Clone Test Row - 92
180 91 911 Clone Test Row - 91
181 90 901 Clone Test Row - 90
182 SHOW CREATE TABLE t11;
183 Table Create Table
184 t11 CREATE TABLE `t11` (
185 `col1` int NOT NULL,
186 `col2` int DEFAULT NULL,
187 `col3` varchar(64) DEFAULT NULL,
188 `col4` blob,
189 PRIMARY KEY (`col1`)
190 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMPRESSION='LZ4'
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 0 Clone Test Row - 0
200 1 10 Clone Test Row - 1
201 2 20 Clone Test Row - 2
202 3 30 Clone Test Row - 3
203 4 40 Clone Test Row - 4
204 5 50 Clone Test Row - 5
205 6 60 Clone Test Row - 6
206 7 70 Clone Test Row - 7
207 8 80 Clone Test Row - 8
208 9 90 Clone Test Row - 9
209 SELECT col1, col2, col3 FROM t11 ORDER BY col1 DESC LIMIT 10;;
210 col1 col2 col3
211 99 990 Clone Test Row - 99
212 98 980 Clone Test Row - 98
213 97 970 Clone Test Row - 97
214 96 960 Clone Test Row - 96
215 95 950 Clone Test Row - 95
216 94 940 Clone Test Row - 94
217 93 930 Clone Test Row - 93
218 92 920 Clone Test Row - 92
219 91 910 Clone Test Row - 91
220 90 900 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 PRIMARY KEY (`col1`)
229 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMPRESSION='LZ4'
230 CHECK TABLE t2 EXTENDED;
231 Table Op Msg_type Msg_text
232 test.t2 check status OK
233 SELECT count(*) from t2;
234 count(*)
235 100
236 SELECT col1, col2, col3 FROM t2 ORDER BY col1 LIMIT 10;;
237 col1 col2 col3
238 0 0 Clone Test Row - 0
239 1 10 Clone Test Row - 1
240 2 20 Clone Test Row - 2
241 3 30 Clone Test Row - 3
242 4 40 Clone Test Row - 4
243 5 50 Clone Test Row - 5
244 6 60 Clone Test Row - 6
245 7 70 Clone Test Row - 7
246 8 80 Clone Test Row - 8
247 9 90 Clone Test Row - 9
248 SELECT col1, col2, col3 FROM t2 ORDER BY col1 DESC LIMIT 10;;
249 col1 col2 col3
250 99 990 Clone Test Row - 99
251 98 980 Clone Test Row - 98
252 97 970 Clone Test Row - 97
253 96 960 Clone Test Row - 96
254 95 950 Clone Test Row - 95
255 94 940 Clone Test Row - 94
256 93 930 Clone Test Row - 93
257 92 920 Clone Test Row - 92
258 91 910 Clone Test Row - 91
259 90 900 Clone Test Row - 90
260 call execute_dml(1, 0, 100, 100, 10, 0);
261 # Restart server back on base data directory
262 # restart: --datadir=ENCRYPT_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring
263 SET DEBUG_SYNC = 'RESET';
264 # 2. ALTER TABLE remove encryption while clone in progress
265 RESET MASTER;
266 SET GLOBAL DEBUG = '+d,local_release_clone_file_pin';
267 SET GLOBAL DEBUG = '+d,log_redo_with_invalid_master_key';
268 ALTER TABLE t0 COMPRESSION = "None" ;
269 SET DEBUG_SYNC = 'clone_before_init_meta SIGNAL start_ddl_file_init WAIT_FOR resume_file_init';
270 SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_file WAIT_FOR resume_file';
271 SET DEBUG_SYNC = 'clone_file_copy_end_before_ack SIGNAL start_ddl_file_ack WAIT_FOR resume_file_ack';
272 SET DEBUG_SYNC = 'clone_before_file_ddl_meta SIGNAL start_ddl_file_meta WAIT_FOR resume_file_meta';
273 SET DEBUG_SYNC = 'clone_page_copy SIGNAL start_ddl_page WAIT_FOR resume_page';
274 SET DEBUG_SYNC = 'clone_before_page_ddl_meta SIGNAL start_ddl_page_meta WAIT_FOR resume_page_meta';
275 SET DEBUG_SYNC = 'clone_redo_copy SIGNAL start_ddl_redo WAIT_FOR resume_redo';
276 SET GLOBAL clone_autotune_concurrency = OFF;
277 SET GLOBAL clone_max_concurrency = 8;
278 CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR';
279 # In connection CON1
280 # Waiting for clone to reach 'Initial metadata transfer'
281 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_init';
282 # Wait finished
283 ALTER TABLE t01 COMPRESSION = "None" ;
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 ALTER TABLE t1 COMPRESSION = "None" ;
289 call execute_dml(1, 0, 100, 100, 10, 0);
290 # Flush all dirty pages to track
291 SET GLOBAL innodb_buf_flush_list_now = 1;
292 SET DEBUG_SYNC = 'now SIGNAL resume_file';
293 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_ack';
294 SET DEBUG_SYNC = 'now SIGNAL resume_file_ack';
295 # Waiting for clone to reach DDL metadata for 'file copy'
296 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_meta';
297 # Wait finished
298 ALTER TABLE t11 COMPRESSION = "None" ;
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 COMPRESSION = "None" ;
305 call execute_dml(1, 0, 100, 100, 10, 0);
306 SET DEBUG_SYNC = 'now SIGNAL resume_page';
307 # Waiting for clone to reach DDL metadata for 'page copy'
308 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page_meta';
309 # Wait finished
310 ALTER TABLE t21 COMPRESSION = "None" ;
311 INSERT INTO t21 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t21.col2 + 1;;
312 SET DEBUG_SYNC = 'now SIGNAL resume_page_meta';
313 # Waiting for clone to reach 'redo copy'
314 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_redo';
315 # Wait finished
316 ALTER TABLE t3 COMPRESSION = "None" ;
317 SET DEBUG_SYNC = 'now SIGNAL resume_redo';
318 # In connection DEFAULT
319 # Waiting for clone to complete
320 # Wait finished
321 SET GLOBAL DEBUG = '-d,local_release_clone_file_pin';
322 # Restart server on cloned data directory
323 # restart: --datadir=CLONE_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring
324 # Check cloned data
325 SHOW TABLES;
326 Tables_in_test
327 t
328 t0
329 t01
330 t1
331 t11
332 t2
333 t21
334 t3
335 SHOW CREATE TABLE t1;
336 Table Create Table
337 t1 CREATE TABLE `t1` (
338 `col1` int NOT NULL,
339 `col2` int DEFAULT NULL,
340 `col3` varchar(64) DEFAULT NULL,
341 `col4` blob,
342 PRIMARY KEY (`col1`)
343 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMPRESSION='None'
344 CHECK TABLE t1 EXTENDED;
345 Table Op Msg_type Msg_text
346 test.t1 check status OK
347 SELECT count(*) from t1;
348 count(*)
349 100
350 SELECT col1, col2, col3 FROM t1 ORDER BY col1 LIMIT 10;;
351 col1 col2 col3
352 0 1 Clone Test Row - 0
353 1 2 Clone Test Row - 1
354 2 3 Clone Test Row - 2
355 3 4 Clone Test Row - 3
356 4 5 Clone Test Row - 4
357 5 6 Clone Test Row - 5
358 6 7 Clone Test Row - 6
359 7 8 Clone Test Row - 7
360 8 9 Clone Test Row - 8
361 9 10 Clone Test Row - 9
362 SELECT col1, col2, col3 FROM t1 ORDER BY col1 DESC LIMIT 10;;
363 col1 col2 col3
364 99 100 Clone Test Row - 99
365 98 99 Clone Test Row - 98
366 97 98 Clone Test Row - 97
367 96 97 Clone Test Row - 96
368 95 96 Clone Test Row - 95
369 94 95 Clone Test Row - 94
370 93 94 Clone Test Row - 93
371 92 93 Clone Test Row - 92
372 91 92 Clone Test Row - 91
373 90 91 Clone Test Row - 90
374 SHOW CREATE TABLE t11;
375 Table Create Table
376 t11 CREATE TABLE `t11` (
377 `col1` int NOT NULL,
378 `col2` int DEFAULT NULL,
379 `col3` varchar(64) DEFAULT NULL,
380 `col4` blob,
381 PRIMARY KEY (`col1`)
382 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMPRESSION='None'
383 CHECK TABLE t11 EXTENDED;
384 Table Op Msg_type Msg_text
385 test.t11 check status OK
386 SELECT count(*) from t11;
387 count(*)
388 100
389 SELECT col1, col2, col3 FROM t11 ORDER BY col1 LIMIT 10;;
390 col1 col2 col3
391 0 1 Clone Test Row - 0
392 1 11 Clone Test Row - 1
393 2 21 Clone Test Row - 2
394 3 31 Clone Test Row - 3
395 4 41 Clone Test Row - 4
396 5 51 Clone Test Row - 5
397 6 61 Clone Test Row - 6
398 7 71 Clone Test Row - 7
399 8 81 Clone Test Row - 8
400 9 91 Clone Test Row - 9
401 SELECT col1, col2, col3 FROM t11 ORDER BY col1 DESC LIMIT 10;;
402 col1 col2 col3
403 99 991 Clone Test Row - 99
404 98 981 Clone Test Row - 98
405 97 971 Clone Test Row - 97
406 96 961 Clone Test Row - 96
407 95 951 Clone Test Row - 95
408 94 941 Clone Test Row - 94
409 93 931 Clone Test Row - 93
410 92 921 Clone Test Row - 92
411 91 911 Clone Test Row - 91
412 90 901 Clone Test Row - 90
413 SHOW CREATE TABLE t2;
414 Table Create Table
415 t2 CREATE TABLE `t2` (
416 `col1` int NOT NULL,
417 `col2` int DEFAULT NULL,
418 `col3` varchar(64) DEFAULT NULL,
419 `col4` blob,
420 PRIMARY KEY (`col1`)
421 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMPRESSION='None'
422 CHECK TABLE t2 EXTENDED;
423 Table Op Msg_type Msg_text
424 test.t2 check status OK
425 SELECT count(*) from t2;
426 count(*)
427 100
428 SELECT col1, col2, col3 FROM t2 ORDER BY col1 LIMIT 10;;
429 col1 col2 col3
430 0 1 Clone Test Row - 0
431 1 2 Clone Test Row - 1
432 2 3 Clone Test Row - 2
433 3 4 Clone Test Row - 3
434 4 5 Clone Test Row - 4
435 5 6 Clone Test Row - 5
436 6 7 Clone Test Row - 6
437 7 8 Clone Test Row - 7
438 8 9 Clone Test Row - 8
439 9 10 Clone Test Row - 9
440 SELECT col1, col2, col3 FROM t2 ORDER BY col1 DESC LIMIT 10;;
441 col1 col2 col3
442 99 100 Clone Test Row - 99
443 98 99 Clone Test Row - 98
444 97 98 Clone Test Row - 97
445 96 97 Clone Test Row - 96
446 95 96 Clone Test Row - 95
447 94 95 Clone Test Row - 94
448 93 94 Clone Test Row - 93
449 92 93 Clone Test Row - 92
450 91 92 Clone Test Row - 91
451 90 91 Clone Test Row - 90
452 call execute_dml(1, 0, 100, 100, 10, 0);
453 # Restart server back on base data directory
454 # restart: --datadir=ENCRYPT_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring
455 SET DEBUG_SYNC = 'RESET';
456 # 3. ALTER TABLE add encryption while clone in progress
457 RESET MASTER;
458 SET GLOBAL DEBUG = '+d,local_release_clone_file_pin';
459 SET GLOBAL DEBUG = '+d,log_redo_with_invalid_master_key';
460 ALTER TABLE t0 COMPRESSION = "LZ4" ;
461 SET DEBUG_SYNC = 'clone_before_init_meta SIGNAL start_ddl_file_init WAIT_FOR resume_file_init';
462 SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_file WAIT_FOR resume_file';
463 SET DEBUG_SYNC = 'clone_file_copy_end_before_ack SIGNAL start_ddl_file_ack WAIT_FOR resume_file_ack';
464 SET DEBUG_SYNC = 'clone_before_file_ddl_meta SIGNAL start_ddl_file_meta WAIT_FOR resume_file_meta';
465 SET DEBUG_SYNC = 'clone_page_copy SIGNAL start_ddl_page WAIT_FOR resume_page';
466 SET DEBUG_SYNC = 'clone_before_page_ddl_meta SIGNAL start_ddl_page_meta WAIT_FOR resume_page_meta';
467 SET DEBUG_SYNC = 'clone_redo_copy SIGNAL start_ddl_redo WAIT_FOR resume_redo';
468 SET GLOBAL clone_autotune_concurrency = OFF;
469 SET GLOBAL clone_max_concurrency = 8;
470 CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR';
471 # In connection CON1
472 # Waiting for clone to reach 'Initial metadata transfer'
473 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_init';
474 # Wait finished
475 ALTER TABLE t01 COMPRESSION = "LZ4" ;
476 SET DEBUG_SYNC = 'now SIGNAL resume_file_init';
477 # Waiting for clone to reach 'file copy'
478 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file';
479 # Wait finished
480 ALTER TABLE t1 COMPRESSION = "LZ4" ;
481 call execute_dml(1, 0, 100, 100, 10, 0);
482 # Flush all dirty pages to track
483 SET GLOBAL innodb_buf_flush_list_now = 1;
484 SET DEBUG_SYNC = 'now SIGNAL resume_file';
485 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_ack';
486 SET DEBUG_SYNC = 'now SIGNAL resume_file_ack';
487 # Waiting for clone to reach DDL metadata for 'file copy'
488 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_meta';
489 # Wait finished
490 ALTER TABLE t11 COMPRESSION = "LZ4" ;
491 INSERT INTO t11 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t11.col2 + 1;;
492 SET DEBUG_SYNC = 'now SIGNAL resume_file_meta';
493 # Waiting for clone to reach 'page copy'
494 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page';
495 # Wait finished
496 ALTER TABLE t2 COMPRESSION = "LZ4" ;
497 call execute_dml(1, 0, 100, 100, 10, 0);
498 SET DEBUG_SYNC = 'now SIGNAL resume_page';
499 # Waiting for clone to reach DDL metadata for 'page copy'
500 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page_meta';
501 # Wait finished
502 ALTER TABLE t21 COMPRESSION = "LZ4" ;
503 INSERT INTO t21 SELECT * FROM t ON DUPLICATE KEY UPDATE col2 = t21.col2 + 1;;
504 SET DEBUG_SYNC = 'now SIGNAL resume_page_meta';
505 # Waiting for clone to reach 'redo copy'
506 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_redo';
507 # Wait finished
508 ALTER TABLE t3 COMPRESSION = "LZ4" ;
509 SET DEBUG_SYNC = 'now SIGNAL resume_redo';
510 # In connection DEFAULT
511 # Waiting for clone to complete
512 # Wait finished
513 SET GLOBAL DEBUG = '-d,local_release_clone_file_pin';
514 # Restart server on cloned data directory
515 # restart: --datadir=CLONE_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring
516 # Check cloned data
517 SHOW TABLES;
518 Tables_in_test
519 t
520 t0
521 t01
522 t1
523 t11
524 t2
525 t21
526 t3
527 SHOW CREATE TABLE t1;
528 Table Create Table
529 t1 CREATE TABLE `t1` (
530 `col1` int NOT NULL,
531 `col2` int DEFAULT NULL,
532 `col3` varchar(64) DEFAULT NULL,
533 `col4` blob,
534 PRIMARY KEY (`col1`)
535 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMPRESSION='LZ4'
536 CHECK TABLE t1 EXTENDED;
537 Table Op Msg_type Msg_text
538 test.t1 check status OK
539 SELECT count(*) from t1;
540 count(*)
541 100
542 SELECT col1, col2, col3 FROM t1 ORDER BY col1 LIMIT 10;;
543 col1 col2 col3
544 0 1 Clone Test Row - 0
545 1 2 Clone Test Row - 1
546 2 3 Clone Test Row - 2
547 3 4 Clone Test Row - 3
548 4 5 Clone Test Row - 4
549 5 6 Clone Test Row - 5
550 6 7 Clone Test Row - 6
551 7 8 Clone Test Row - 7
552 8 9 Clone Test Row - 8
553 9 10 Clone Test Row - 9
554 SELECT col1, col2, col3 FROM t1 ORDER BY col1 DESC LIMIT 10;;
555 col1 col2 col3
556 99 100 Clone Test Row - 99
557 98 99 Clone Test Row - 98
558 97 98 Clone Test Row - 97
559 96 97 Clone Test Row - 96
560 95 96 Clone Test Row - 95
561 94 95 Clone Test Row - 94
562 93 94 Clone Test Row - 93
563 92 93 Clone Test Row - 92
564 91 92 Clone Test Row - 91
565 90 91 Clone Test Row - 90
566 SHOW CREATE TABLE t11;
567 Table Create Table
568 t11 CREATE TABLE `t11` (
569 `col1` int NOT NULL,
570 `col2` int DEFAULT NULL,
571 `col3` varchar(64) DEFAULT NULL,
572 `col4` blob,
573 PRIMARY KEY (`col1`)
574 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMPRESSION='LZ4'
575 CHECK TABLE t11 EXTENDED;
576 Table Op Msg_type Msg_text
577 test.t11 check status OK
578 SELECT count(*) from t11;
579 count(*)
580 100
581 SELECT col1, col2, col3 FROM t11 ORDER BY col1 LIMIT 10;;
582 col1 col2 col3
583 0 2 Clone Test Row - 0
584 1 12 Clone Test Row - 1
585 2 22 Clone Test Row - 2
586 3 32 Clone Test Row - 3
587 4 42 Clone Test Row - 4
588 5 52 Clone Test Row - 5
589 6 62 Clone Test Row - 6
590 7 72 Clone Test Row - 7
591 8 82 Clone Test Row - 8
592 9 92 Clone Test Row - 9
593 SELECT col1, col2, col3 FROM t11 ORDER BY col1 DESC LIMIT 10;;
594 col1 col2 col3
595 99 992 Clone Test Row - 99
596 98 982 Clone Test Row - 98
597 97 972 Clone Test Row - 97
598 96 962 Clone Test Row - 96
599 95 952 Clone Test Row - 95
600 94 942 Clone Test Row - 94
601 93 932 Clone Test Row - 93
602 92 922 Clone Test Row - 92
603 91 912 Clone Test Row - 91
604 90 902 Clone Test Row - 90
605 SHOW CREATE TABLE t2;
606 Table Create Table
607 t2 CREATE TABLE `t2` (
608 `col1` int NOT NULL,
609 `col2` int DEFAULT NULL,
610 `col3` varchar(64) DEFAULT NULL,
611 `col4` blob,
612 PRIMARY KEY (`col1`)
613 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMPRESSION='LZ4'
614 CHECK TABLE t2 EXTENDED;
615 Table Op Msg_type Msg_text
616 test.t2 check status OK
617 SELECT count(*) from t2;
618 count(*)
619 100
620 SELECT col1, col2, col3 FROM t2 ORDER BY col1 LIMIT 10;;
621 col1 col2 col3
622 0 1 Clone Test Row - 0
623 1 2 Clone Test Row - 1
624 2 3 Clone Test Row - 2
625 3 4 Clone Test Row - 3
626 4 5 Clone Test Row - 4
627 5 6 Clone Test Row - 5
628 6 7 Clone Test Row - 6
629 7 8 Clone Test Row - 7
630 8 9 Clone Test Row - 8
631 9 10 Clone Test Row - 9
632 SELECT col1, col2, col3 FROM t2 ORDER BY col1 DESC LIMIT 10;;
633 col1 col2 col3
634 99 100 Clone Test Row - 99
635 98 99 Clone Test Row - 98
636 97 98 Clone Test Row - 97
637 96 97 Clone Test Row - 96
638 95 96 Clone Test Row - 95
639 94 95 Clone Test Row - 94
640 93 94 Clone Test Row - 93
641 92 93 Clone Test Row - 92
642 91 92 Clone Test Row - 91
643 90 91 Clone Test Row - 90
644 call execute_dml(1, 0, 100, 100, 10, 0);
645 # Restart server back on base data directory
646 # restart: --datadir=ENCRYPT_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring
647 SET DEBUG_SYNC = 'RESET';
648 # 2. DROP TABLE while clone in progress
649 RESET MASTER;
650 SET GLOBAL DEBUG = '+d,local_release_clone_file_pin';
651 SET GLOBAL DEBUG = '+d,log_redo_with_invalid_master_key';
652 DROP TABLE t0 ;
653 SET DEBUG_SYNC = 'clone_before_init_meta SIGNAL start_ddl_file_init WAIT_FOR resume_file_init';
654 SET DEBUG_SYNC = 'clone_file_copy SIGNAL start_ddl_file WAIT_FOR resume_file';
655 SET DEBUG_SYNC = 'clone_file_copy_end_before_ack SIGNAL start_ddl_file_ack WAIT_FOR resume_file_ack';
656 SET DEBUG_SYNC = 'clone_before_file_ddl_meta SIGNAL start_ddl_file_meta WAIT_FOR resume_file_meta';
657 SET DEBUG_SYNC = 'clone_page_copy SIGNAL start_ddl_page WAIT_FOR resume_page';
658 SET DEBUG_SYNC = 'clone_before_page_ddl_meta SIGNAL start_ddl_page_meta WAIT_FOR resume_page_meta';
659 SET DEBUG_SYNC = 'clone_redo_copy SIGNAL start_ddl_redo WAIT_FOR resume_redo';
660 SET GLOBAL clone_autotune_concurrency = OFF;
661 SET GLOBAL clone_max_concurrency = 8;
662 CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR';
663 # In connection CON1
664 # Waiting for clone to reach 'Initial metadata transfer'
665 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_init';
666 # Wait finished
667 DROP TABLE t01 ;
668 SET DEBUG_SYNC = 'now SIGNAL resume_file_init';
669 # Waiting for clone to reach 'file copy'
670 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file';
671 # Wait finished
672 DROP TABLE t1 ;
673 SHOW TABLES;
674 Tables_in_test
675 t
676 t11
677 t2
678 t21
679 t3
680 # Flush all dirty pages to track
681 SET GLOBAL innodb_buf_flush_list_now = 1;
682 SET DEBUG_SYNC = 'now SIGNAL resume_file';
683 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_ack';
684 SET DEBUG_SYNC = 'now SIGNAL resume_file_ack';
685 # Waiting for clone to reach DDL metadata for 'file copy'
686 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_file_meta';
687 # Wait finished
688 DROP TABLE t11 ;
689 SHOW TABLES;
690 Tables_in_test
691 t
692 t2
693 t21
694 t3
695 SET DEBUG_SYNC = 'now SIGNAL resume_file_meta';
696 # Waiting for clone to reach 'page copy'
697 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page';
698 # Wait finished
699 DROP TABLE t2 ;
700 SHOW TABLES;
701 Tables_in_test
702 t
703 t21
704 t3
705 SET DEBUG_SYNC = 'now SIGNAL resume_page';
706 # Waiting for clone to reach DDL metadata for 'page copy'
707 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_page_meta';
708 # Wait finished
709 DROP TABLE t21 ;
710 SHOW TABLES;
711 Tables_in_test
712 t
713 t3
714 SET DEBUG_SYNC = 'now SIGNAL resume_page_meta';
715 # Waiting for clone to reach 'redo copy'
716 SET DEBUG_SYNC = 'now WAIT_FOR start_ddl_redo';
717 # Wait finished
718 DROP TABLE t3 ;
719 SET DEBUG_SYNC = 'now SIGNAL resume_redo';
720 # In connection DEFAULT
721 # Waiting for clone to complete
722 # Wait finished
723 SET GLOBAL DEBUG = '-d,local_release_clone_file_pin';
724 # Restart server on cloned data directory
725 # restart: --datadir=CLONE_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring
726 # Check cloned data
727 SHOW TABLES;
728 Tables_in_test
729 t
730 t21
731 t3
732 # Restart server back on base data directory
733 # restart: --datadir=ENCRYPT_DATADIR --early-plugin-load=keyring_file=KEYRING_PLUGIN --keyring_file_data=MYSQL_TMP_DIR/mysecret_keyring
734 SET DEBUG_SYNC = 'RESET';
735 # Cleanup
736 DROP TABLE t;
737 CREATE TABLE t1 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB);
738 CREATE TABLE t2 (col1 INT PRIMARY KEY, col2 int, col3 varchar(64), col4 BLOB);
739 DROP TABLE t1;
740 DROP TABLE t2;
741 DROP PROCEDURE execute_dml;
742 # Uninstall clone
743 UNINSTALL PLUGIN clone;
744 # Restart server and remove encrypted data directory
745 # restart: