| 1 |
CALL sys.ps_setup_disable_thread(CONNECTION_ID()); |
| 2 |
summary |
| 3 |
Disabled 1 thread |
| 4 |
CALL sys.ps_setup_disable_thread(CONNECTION_ID()); |
| 5 |
summary |
| 6 |
Disabled 1 thread |
| 7 |
CALL sys.ps_setup_disable_thread(CONNECTION_ID()); |
| 8 |
summary |
| 9 |
Disabled 1 thread |
| 10 |
INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN'; |
| 11 |
CALL sys.ps_setup_enable_instrument('%stage/innodb/clone%'); |
| 12 |
summary |
| 13 |
Enabled X instruments |
| 14 |
CALL sys.ps_setup_enable_instrument('statement/clone/%'); |
| 15 |
summary |
| 16 |
Enabled X instruments |
| 17 |
CALL sys.ps_setup_enable_consumer('events_statements%'); |
| 18 |
summary |
| 19 |
Enabled X consumers |
| 20 |
CALL sys.ps_setup_enable_consumer('events_stages%'); |
| 21 |
summary |
| 22 |
Enabled X consumers |
| 23 |
SELECT * |
| 24 |
FROM performance_schema.setup_instruments |
| 25 |
WHERE name LIKE "%stage/innodb/clone%" |
| 26 |
OR name LIKE "statement/clone/%" |
| 27 |
OR name LIKE "wait/io/file/innodb/innodb_clone_file" |
| 28 |
ORDER BY NAME; |
| 29 |
NAME ENABLED TIMED PROPERTIES FLAGS VOLATILITY DOCUMENTATION |
| 30 |
stage/innodb/clone (file copy) YES YES progress NULL 0 NULL |
| 31 |
stage/innodb/clone (page copy) YES YES progress NULL 0 NULL |
| 32 |
stage/innodb/clone (redo copy) YES YES progress NULL 0 NULL |
| 33 |
statement/clone/client YES YES NULL 0 NULL |
| 34 |
statement/clone/local YES YES NULL 0 NULL |
| 35 |
statement/clone/server YES YES NULL 0 NULL |
| 36 |
wait/io/file/innodb/innodb_clone_file YES YES NULL 0 NULL |
| 37 |
SELECT * |
| 38 |
FROM performance_schema.setup_consumers |
| 39 |
WHERE name LIKE "events_statements_%" OR name LIKE "events_stages_%" |
| 40 |
ORDER BY NAME; |
| 41 |
NAME ENABLED |
| 42 |
events_stages_current YES |
| 43 |
events_stages_history YES |
| 44 |
events_stages_history_long YES |
| 45 |
events_statements_cpu YES |
| 46 |
events_statements_current YES |
| 47 |
events_statements_history YES |
| 48 |
events_statements_history_long YES |
| 49 |
TRUNCATE TABLE performance_schema.events_stages_history; |
| 50 |
TRUNCATE TABLE performance_schema.events_stages_history_long; |
| 51 |
TRUNCATE TABLE performance_schema.events_statements_history; |
| 52 |
TRUNCATE TABLE performance_schema.events_statements_history_long; |
| 53 |
# Case 1 - Monitoring a normal Clone operation. |
| 54 |
CALL sys.ps_setup_enable_thread(CONNECTION_ID()); |
| 55 |
summary |
| 56 |
Enabled 1 thread |
| 57 |
SET GLOBAL clone_autotune_concurrency = OFF; |
| 58 |
SET GLOBAL clone_max_concurrency = 8; |
| 59 |
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; |
| 60 |
select ID, STATE, ERROR_NO from performance_schema.clone_status; |
| 61 |
ID STATE ERROR_NO |
| 62 |
1 Completed 0 |
| 63 |
select ID, STAGE, STATE from performance_schema.clone_progress; |
| 64 |
ID STAGE STATE |
| 65 |
1 DROP DATA Completed |
| 66 |
1 FILE COPY Completed |
| 67 |
1 PAGE COPY Completed |
| 68 |
1 REDO COPY Completed |
| 69 |
1 FILE SYNC Completed |
| 70 |
1 RESTART Not Started |
| 71 |
1 RECOVERY Not Started |
| 72 |
SELECT EVENT_NAME, TIMER_START > 0, TIMER_END > 0, TIMER_WAIT > 0, |
| 73 |
SQL_TEXT, CURRENT_SCHEMA |
| 74 |
FROM performance_schema.events_statements_history_long |
| 75 |
WHERE event_name LIKE "statement/clone/%" |
| 76 |
ORDER BY EVENT_NAME; |
| 77 |
EVENT_NAME TIMER_START > 0 TIMER_END > 0 TIMER_WAIT > 0 SQL_TEXT CURRENT_SCHEMA |
| 78 |
statement/clone/local 1 1 1 CLONE LOCAL DATA DIRECTORY = '$CLONE_DATADIR' test |
| 79 |
SELECT EVENT_NAME, TIMER_START > 0, |
| 80 |
TIMER_END > 0, WORK_COMPLETED = WORK_ESTIMATED |
| 81 |
FROM performance_schema.events_stages_history_long |
| 82 |
WHERE event_name LIKE "%stage/innodb/clone%" |
| 83 |
ORDER BY EVENT_NAME; |
| 84 |
EVENT_NAME TIMER_START > 0 TIMER_END > 0 WORK_COMPLETED = WORK_ESTIMATED |
| 85 |
stage/innodb/clone (file copy) 1 1 1 |
| 86 |
stage/innodb/clone (page copy) 1 1 1 |
| 87 |
stage/innodb/clone (redo copy) 1 1 1 |
| 88 |
TRUNCATE TABLE performance_schema.events_stages_history; |
| 89 |
TRUNCATE TABLE performance_schema.events_stages_history_long; |
| 90 |
TRUNCATE TABLE performance_schema.events_statements_history; |
| 91 |
TRUNCATE TABLE performance_schema.events_statements_history_long; |
| 92 |
# Case 2 - Monitoring Clone operation which has more estimated work |
| 93 |
# during file and page copy stage than in a default run. |
| 94 |
CREATE PROCEDURE prepare_data(IN val INT) |
| 95 |
BEGIN |
| 96 |
DECLARE i INT DEFAULT 0; |
| 97 |
WHILE i < val DO |
| 98 |
INSERT INTO t1 (b,c) VALUES (REPEAT(a,500), REPEAT(b,100)); |
| 99 |
INSERT INTO t2 (b,c) VALUES (REPEAT(a,500), REPEAT(b,100)); |
| 100 |
INSERT INTO t3 (b,c) VALUES (REPEAT(a,500), REPEAT(b,100)); |
| 101 |
SET i = i + 1; |
| 102 |
END WHILE; |
| 103 |
END| |
| 104 |
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB); |
| 105 |
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB); |
| 106 |
CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB); |
| 107 |
SET GLOBAL innodb_buf_flush_list_now = 1; |
| 108 |
SET DEBUG_SYNC = 'clone_file_copy SIGNAL page_signal WAIT_FOR go_page'; |
| 109 |
SET DEBUG_SYNC = 'clone_page_copy SIGNAL redo_signal WAIT_FOR go_redo'; |
| 110 |
SET GLOBAL clone_autotune_concurrency = OFF; |
| 111 |
SET GLOBAL clone_max_concurrency = 8; |
| 112 |
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; |
| 113 |
SET DEBUG_SYNC = 'now WAIT_FOR page_signal'; |
| 114 |
CALL prepare_data(50); |
| 115 |
SET GLOBAL innodb_buf_flush_list_now = 1; |
| 116 |
SET DEBUG_SYNC = 'now SIGNAL go_page'; |
| 117 |
SET DEBUG_SYNC = 'now WAIT_FOR redo_signal'; |
| 118 |
SELECT EVENT_NAME, TIMER_START > 0, TIMER_END > 0, TIMER_WAIT > 0, |
| 119 |
SQL_TEXT, CURRENT_SCHEMA |
| 120 |
FROM performance_schema.events_statements_current |
| 121 |
WHERE event_name LIKE "statement/clone/%" |
| 122 |
ORDER BY EVENT_NAME; |
| 123 |
EVENT_NAME TIMER_START > 0 TIMER_END > 0 TIMER_WAIT > 0 SQL_TEXT CURRENT_SCHEMA |
| 124 |
statement/clone/local 1 1 1 CLONE LOCAL DATA DIRECTORY = '$CLONE_DATADIR' test |
| 125 |
CALL prepare_data(50); |
| 126 |
SET DEBUG_SYNC = 'now SIGNAL go_redo'; |
| 127 |
SELECT EVENT_NAME, WORK_COMPLETED > 0, TIMER_START > 0, |
| 128 |
TIMER_END > 0, WORK_COMPLETED = WORK_ESTIMATED |
| 129 |
FROM performance_schema.events_stages_history_long |
| 130 |
WHERE event_name LIKE "%stage/innodb/clone%" |
| 131 |
ORDER BY EVENT_NAME; |
| 132 |
EVENT_NAME WORK_COMPLETED > 0 TIMER_START > 0 TIMER_END > 0 WORK_COMPLETED = WORK_ESTIMATED |
| 133 |
stage/innodb/clone (file copy) 1 1 1 1 |
| 134 |
stage/innodb/clone (page copy) 1 1 1 1 |
| 135 |
stage/innodb/clone (redo copy) 1 1 1 1 |
| 136 |
SELECT EVENT_NAME, TIMER_START > 0, TIMER_END > 0, TIMER_WAIT > 0, |
| 137 |
SQL_TEXT, CURRENT_SCHEMA |
| 138 |
FROM performance_schema.events_statements_history_long |
| 139 |
WHERE thread_id = ps_thread_id(CONNECTION_ID()) |
| 140 |
AND event_name LIKE "statement/clone/%"; |
| 141 |
EVENT_NAME TIMER_START > 0 TIMER_END > 0 TIMER_WAIT > 0 SQL_TEXT CURRENT_SCHEMA |
| 142 |
statement/clone/local 1 1 1 CLONE LOCAL DATA DIRECTORY = '$CLONE_DATADIR' test |
| 143 |
SET DEBUG_SYNC='RESET'; |
| 144 |
TRUNCATE TABLE performance_schema.events_stages_history; |
| 145 |
TRUNCATE TABLE performance_schema.events_stages_history_long; |
| 146 |
TRUNCATE TABLE performance_schema.events_statements_history; |
| 147 |
TRUNCATE TABLE performance_schema.events_statements_history_long; |
| 148 |
DROP TABLE t1; |
| 149 |
DROP TABLE t2; |
| 150 |
DROP TABLE t3; |
| 151 |
# Case 3 - Monitoring progress in the middle of file copy. |
| 152 |
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT); |
| 153 |
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT); |
| 154 |
CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT); |
| 155 |
SET DEBUG_SYNC = 'clone_file_copy SIGNAL file_signal WAIT_FOR go_file'; |
| 156 |
SET GLOBAL clone_autotune_concurrency = OFF; |
| 157 |
SET GLOBAL clone_max_concurrency = 8; |
| 158 |
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; |
| 159 |
SET DEBUG_SYNC= 'now WAIT_FOR file_signal'; |
| 160 |
SELECT EVENT_NAME, WORK_COMPLETED <= WORK_ESTIMATED |
| 161 |
FROM performance_schema.events_stages_current |
| 162 |
WHERE event_name LIKE "%file copy%" |
| 163 |
ORDER BY EVENT_NAME; |
| 164 |
EVENT_NAME WORK_COMPLETED <= WORK_ESTIMATED |
| 165 |
stage/innodb/clone (file copy) 1 |
| 166 |
SET DEBUG_SYNC= 'now SIGNAL go_file'; |
| 167 |
SET DEBUG_SYNC = 'RESET'; |
| 168 |
DROP TABLE t1; |
| 169 |
DROP TABLE t2; |
| 170 |
DROP TABLE t3; |
| 171 |
TRUNCATE TABLE performance_schema.events_stages_history; |
| 172 |
TRUNCATE TABLE performance_schema.events_stages_history_long; |
| 173 |
TRUNCATE TABLE performance_schema.events_statements_history; |
| 174 |
TRUNCATE TABLE performance_schema.events_statements_history_long; |
| 175 |
# Case 4 - Monitoring progress in the middle of page copy. |
| 176 |
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB); |
| 177 |
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB); |
| 178 |
CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB); |
| 179 |
SET GLOBAL innodb_buf_flush_list_now = 1; |
| 180 |
SET DEBUG_SYNC = 'clone_file_copy SIGNAL page_signal WAIT_FOR go_page'; |
| 181 |
SET DEBUG_SYNC = 'clone_page_copy SIGNAL page_middle_signal WAIT_FOR go_page_middle'; |
| 182 |
SET GLOBAL clone_autotune_concurrency = OFF; |
| 183 |
SET GLOBAL clone_max_concurrency = 8; |
| 184 |
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; |
| 185 |
SET DEBUG_SYNC = 'now WAIT_FOR page_signal'; |
| 186 |
CALL prepare_data(50); |
| 187 |
SET GLOBAL innodb_buf_flush_list_now = 1; |
| 188 |
SET DEBUG_SYNC = 'now SIGNAL go_page'; |
| 189 |
SET DEBUG_SYNC = 'now WAIT_FOR page_middle_signal'; |
| 190 |
SELECT EVENT_NAME, WORK_COMPLETED <= WORK_ESTIMATED |
| 191 |
FROM performance_schema.events_stages_current |
| 192 |
WHERE event_name LIKE "%page copy%" |
| 193 |
ORDER BY EVENT_NAME; |
| 194 |
EVENT_NAME WORK_COMPLETED <= WORK_ESTIMATED |
| 195 |
stage/innodb/clone (page copy) 1 |
| 196 |
SET DEBUG_SYNC = 'now SIGNAL go_page_middle'; |
| 197 |
SET DEBUG_SYNC = 'RESET'; |
| 198 |
DROP TABLE t1; |
| 199 |
DROP TABLE t2; |
| 200 |
DROP TABLE t3; |
| 201 |
TRUNCATE TABLE performance_schema.events_stages_history; |
| 202 |
TRUNCATE TABLE performance_schema.events_stages_history_long; |
| 203 |
TRUNCATE TABLE performance_schema.events_statements_history; |
| 204 |
TRUNCATE TABLE performance_schema.events_statements_history_long; |
| 205 |
# Case 5 - Monitoring progress in the middle of redo copy. |
| 206 |
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB); |
| 207 |
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB); |
| 208 |
CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB); |
| 209 |
SET DEBUG_SYNC = 'clone_page_copy SIGNAL redo_signal WAIT_FOR go_redo'; |
| 210 |
SET DEBUG_SYNC = 'clone_redo_copy SIGNAL redo_middle_signal WAIT_FOR go_redo_middle'; |
| 211 |
SET GLOBAL clone_autotune_concurrency = OFF; |
| 212 |
SET GLOBAL clone_max_concurrency = 8; |
| 213 |
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR'; |
| 214 |
SET DEBUG_SYNC= 'now WAIT_FOR redo_signal'; |
| 215 |
CALL prepare_data(50); |
| 216 |
SET DEBUG_SYNC= 'now SIGNAL go_redo'; |
| 217 |
SET DEBUG_SYNC = 'now WAIT_FOR redo_middle_signal'; |
| 218 |
SELECT EVENT_NAME, WORK_COMPLETED <= WORK_ESTIMATED |
| 219 |
FROM performance_schema.events_stages_current |
| 220 |
WHERE event_name LIKE "%redo copy%" |
| 221 |
ORDER BY EVENT_NAME; |
| 222 |
EVENT_NAME WORK_COMPLETED <= WORK_ESTIMATED |
| 223 |
stage/innodb/clone (redo copy) 1 |
| 224 |
SET DEBUG_SYNC = 'now SIGNAL go_redo_middle'; |
| 225 |
SET DEBUG_SYNC = 'RESET'; |
| 226 |
DROP PROCEDURE prepare_data; |
| 227 |
USE test; |
| 228 |
DROP TABLE t1; |
| 229 |
DROP TABLE t2; |
| 230 |
DROP TABLE t3; |
| 231 |
UNINSTALL PLUGIN clone; |