233 lines
9.7 KiB
Plaintext
233 lines
9.7 KiB
Plaintext
CALL sys.ps_setup_disable_thread(CONNECTION_ID());
|
|
summary
|
|
Disabled 1 thread
|
|
CALL sys.ps_setup_disable_thread(CONNECTION_ID());
|
|
summary
|
|
Disabled 1 thread
|
|
CALL sys.ps_setup_disable_thread(CONNECTION_ID());
|
|
summary
|
|
Disabled 1 thread
|
|
INSTALL PLUGIN clone SONAME 'CLONE_PLUGIN';
|
|
CALL sys.ps_setup_enable_instrument('%stage/innodb/clone%');
|
|
summary
|
|
Enabled X instruments
|
|
CALL sys.ps_setup_enable_instrument('statement/clone/%');
|
|
summary
|
|
Enabled X instruments
|
|
CALL sys.ps_setup_enable_consumer('events_statements%');
|
|
summary
|
|
Enabled X consumers
|
|
CALL sys.ps_setup_enable_consumer('events_stages%');
|
|
summary
|
|
Enabled X consumers
|
|
SELECT *
|
|
FROM performance_schema.setup_instruments
|
|
WHERE name LIKE "%stage/innodb/clone%"
|
|
OR name LIKE "statement/clone/%"
|
|
OR name LIKE "wait/io/file/innodb/innodb_clone_file"
|
|
ORDER BY NAME;
|
|
NAME ENABLED TIMED PROPERTIES VOLATILITY DOCUMENTATION
|
|
stage/innodb/clone (file copy) YES YES progress 0 NULL
|
|
stage/innodb/clone (page copy) YES YES progress 0 NULL
|
|
stage/innodb/clone (redo copy) YES YES progress 0 NULL
|
|
statement/clone/client YES YES 0 NULL
|
|
statement/clone/local YES YES 0 NULL
|
|
statement/clone/server YES YES 0 NULL
|
|
wait/io/file/innodb/innodb_clone_file YES YES 0 NULL
|
|
SELECT *
|
|
FROM performance_schema.setup_consumers
|
|
WHERE name LIKE "events_statements_%" OR name LIKE "events_stages_%"
|
|
ORDER BY NAME;
|
|
NAME ENABLED
|
|
events_stages_current YES
|
|
events_stages_history YES
|
|
events_stages_history_long YES
|
|
events_statements_current YES
|
|
events_statements_history YES
|
|
events_statements_history_long YES
|
|
TRUNCATE TABLE performance_schema.events_stages_history;
|
|
TRUNCATE TABLE performance_schema.events_stages_history_long;
|
|
TRUNCATE TABLE performance_schema.events_statements_history;
|
|
TRUNCATE TABLE performance_schema.events_statements_history_long;
|
|
# Case 1 - Monitoring a normal Clone operation.
|
|
CALL sys.ps_setup_enable_thread(CONNECTION_ID());
|
|
summary
|
|
Enabled 1 thread
|
|
SET GLOBAL clone_autotune_concurrency = OFF;
|
|
SET GLOBAL clone_max_concurrency = 8;
|
|
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR';
|
|
select ID, STATE, ERROR_NO from performance_schema.clone_status;
|
|
ID STATE ERROR_NO
|
|
1 Completed 0
|
|
select ID, STAGE, STATE from performance_schema.clone_progress;
|
|
ID STAGE STATE
|
|
1 DROP DATA Completed
|
|
1 FILE COPY Completed
|
|
1 PAGE COPY Completed
|
|
1 REDO COPY Completed
|
|
1 FILE SYNC Completed
|
|
1 RESTART Not Started
|
|
1 RECOVERY Not Started
|
|
SELECT EVENT_NAME, TIMER_START > 0, TIMER_END > 0, TIMER_WAIT > 0,
|
|
SQL_TEXT, CURRENT_SCHEMA
|
|
FROM performance_schema.events_statements_history_long
|
|
WHERE event_name LIKE "statement/clone/%"
|
|
ORDER BY EVENT_NAME;
|
|
EVENT_NAME TIMER_START > 0 TIMER_END > 0 TIMER_WAIT > 0 SQL_TEXT CURRENT_SCHEMA
|
|
statement/clone/local 1 1 1 CLONE LOCAL DATA DIRECTORY = '$CLONE_DATADIR' test
|
|
SELECT EVENT_NAME, TIMER_START > 0,
|
|
TIMER_END > 0, WORK_COMPLETED = WORK_ESTIMATED
|
|
FROM performance_schema.events_stages_history_long
|
|
WHERE event_name LIKE "%stage/innodb/clone%"
|
|
ORDER BY EVENT_NAME;
|
|
EVENT_NAME TIMER_START > 0 TIMER_END > 0 WORK_COMPLETED = WORK_ESTIMATED
|
|
stage/innodb/clone (file copy) 1 1 1
|
|
stage/innodb/clone (page copy) 1 1 1
|
|
stage/innodb/clone (redo copy) 1 1 1
|
|
TRUNCATE TABLE performance_schema.events_stages_history;
|
|
TRUNCATE TABLE performance_schema.events_stages_history_long;
|
|
TRUNCATE TABLE performance_schema.events_statements_history;
|
|
TRUNCATE TABLE performance_schema.events_statements_history_long;
|
|
# Case 2 - Monitoring Clone operation which has more estimated work
|
|
# during file and page copy stage than in a default run.
|
|
CREATE PROCEDURE prepare_data(IN val INT)
|
|
BEGIN
|
|
DECLARE i INT DEFAULT 0;
|
|
WHILE i < val DO
|
|
INSERT INTO t1 (b,c) VALUES (REPEAT(a,500), REPEAT(b,100));
|
|
INSERT INTO t2 (b,c) VALUES (REPEAT(a,500), REPEAT(b,100));
|
|
INSERT INTO t3 (b,c) VALUES (REPEAT(a,500), REPEAT(b,100));
|
|
SET i = i + 1;
|
|
END WHILE;
|
|
END|
|
|
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB);
|
|
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB);
|
|
CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB);
|
|
SET GLOBAL innodb_buf_flush_list_now = 1;
|
|
SET DEBUG_SYNC = 'clone_file_copy SIGNAL page_signal WAIT_FOR go_page';
|
|
SET DEBUG_SYNC = 'clone_page_copy SIGNAL redo_signal WAIT_FOR go_redo';
|
|
SET GLOBAL clone_autotune_concurrency = OFF;
|
|
SET GLOBAL clone_max_concurrency = 8;
|
|
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR';
|
|
SET DEBUG_SYNC = 'now WAIT_FOR page_signal';
|
|
CALL prepare_data(50);
|
|
SET GLOBAL innodb_buf_flush_list_now = 1;
|
|
SET DEBUG_SYNC = 'now SIGNAL go_page';
|
|
SET DEBUG_SYNC = 'now WAIT_FOR redo_signal';
|
|
SELECT EVENT_NAME, TIMER_START > 0, TIMER_END > 0, TIMER_WAIT > 0,
|
|
SQL_TEXT, CURRENT_SCHEMA
|
|
FROM performance_schema.events_statements_current
|
|
WHERE event_name LIKE "statement/clone/%"
|
|
ORDER BY EVENT_NAME;
|
|
EVENT_NAME TIMER_START > 0 TIMER_END > 0 TIMER_WAIT > 0 SQL_TEXT CURRENT_SCHEMA
|
|
statement/clone/local 1 1 1 CLONE LOCAL DATA DIRECTORY = '$CLONE_DATADIR' test
|
|
CALL prepare_data(50);
|
|
SET DEBUG_SYNC = 'now SIGNAL go_redo';
|
|
SELECT EVENT_NAME, WORK_COMPLETED > 0, TIMER_START > 0,
|
|
TIMER_END > 0, WORK_COMPLETED = WORK_ESTIMATED
|
|
FROM performance_schema.events_stages_history_long
|
|
WHERE event_name LIKE "%stage/innodb/clone%"
|
|
ORDER BY EVENT_NAME;
|
|
EVENT_NAME WORK_COMPLETED > 0 TIMER_START > 0 TIMER_END > 0 WORK_COMPLETED = WORK_ESTIMATED
|
|
stage/innodb/clone (file copy) 1 1 1 1
|
|
stage/innodb/clone (page copy) 1 1 1 1
|
|
stage/innodb/clone (redo copy) 1 1 1 1
|
|
SELECT EVENT_NAME, TIMER_START > 0, TIMER_END > 0, TIMER_WAIT > 0,
|
|
SQL_TEXT, CURRENT_SCHEMA
|
|
FROM performance_schema.events_statements_history_long
|
|
WHERE thread_id = sys.ps_thread_id(CONNECTION_ID())
|
|
AND event_name LIKE "statement/clone/%";
|
|
EVENT_NAME TIMER_START > 0 TIMER_END > 0 TIMER_WAIT > 0 SQL_TEXT CURRENT_SCHEMA
|
|
statement/clone/local 1 1 1 CLONE LOCAL DATA DIRECTORY = '$CLONE_DATADIR' test
|
|
Warnings:
|
|
Note 1585 This function 'ps_thread_id' has the same name as a native function
|
|
SET DEBUG_SYNC='RESET';
|
|
TRUNCATE TABLE performance_schema.events_stages_history;
|
|
TRUNCATE TABLE performance_schema.events_stages_history_long;
|
|
TRUNCATE TABLE performance_schema.events_statements_history;
|
|
TRUNCATE TABLE performance_schema.events_statements_history_long;
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
DROP TABLE t3;
|
|
# Case 3 - Monitoring progress in the middle of file copy.
|
|
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT);
|
|
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT);
|
|
CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT);
|
|
SET DEBUG_SYNC = 'clone_file_copy SIGNAL file_signal WAIT_FOR go_file';
|
|
SET GLOBAL clone_autotune_concurrency = OFF;
|
|
SET GLOBAL clone_max_concurrency = 8;
|
|
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR';
|
|
SET DEBUG_SYNC= 'now WAIT_FOR file_signal';
|
|
SELECT EVENT_NAME, WORK_COMPLETED <= WORK_ESTIMATED
|
|
FROM performance_schema.events_stages_current
|
|
WHERE event_name LIKE "%file copy%"
|
|
ORDER BY EVENT_NAME;
|
|
EVENT_NAME WORK_COMPLETED <= WORK_ESTIMATED
|
|
stage/innodb/clone (file copy) 1
|
|
SET DEBUG_SYNC= 'now SIGNAL go_file';
|
|
SET DEBUG_SYNC = 'RESET';
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
DROP TABLE t3;
|
|
TRUNCATE TABLE performance_schema.events_stages_history;
|
|
TRUNCATE TABLE performance_schema.events_stages_history_long;
|
|
TRUNCATE TABLE performance_schema.events_statements_history;
|
|
TRUNCATE TABLE performance_schema.events_statements_history_long;
|
|
# Case 4 - Monitoring progress in the middle of page copy.
|
|
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB);
|
|
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB);
|
|
CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB);
|
|
SET GLOBAL innodb_buf_flush_list_now = 1;
|
|
SET DEBUG_SYNC = 'clone_file_copy SIGNAL page_signal WAIT_FOR go_page';
|
|
SET DEBUG_SYNC = 'clone_page_copy SIGNAL page_middle_signal WAIT_FOR go_page_middle';
|
|
SET GLOBAL clone_autotune_concurrency = OFF;
|
|
SET GLOBAL clone_max_concurrency = 8;
|
|
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR';
|
|
SET DEBUG_SYNC = 'now WAIT_FOR page_signal';
|
|
CALL prepare_data(50);
|
|
SET GLOBAL innodb_buf_flush_list_now = 1;
|
|
SET DEBUG_SYNC = 'now SIGNAL go_page';
|
|
SET DEBUG_SYNC = 'now WAIT_FOR page_middle_signal';
|
|
SELECT EVENT_NAME, WORK_COMPLETED <= WORK_ESTIMATED
|
|
FROM performance_schema.events_stages_current
|
|
WHERE event_name LIKE "%page copy%"
|
|
ORDER BY EVENT_NAME;
|
|
EVENT_NAME WORK_COMPLETED <= WORK_ESTIMATED
|
|
stage/innodb/clone (page copy) 1
|
|
SET DEBUG_SYNC = 'now SIGNAL go_page_middle';
|
|
SET DEBUG_SYNC = 'RESET';
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
DROP TABLE t3;
|
|
TRUNCATE TABLE performance_schema.events_stages_history;
|
|
TRUNCATE TABLE performance_schema.events_stages_history_long;
|
|
TRUNCATE TABLE performance_schema.events_statements_history;
|
|
TRUNCATE TABLE performance_schema.events_statements_history_long;
|
|
# Case 5 - Monitoring progress in the middle of redo copy.
|
|
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB);
|
|
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB);
|
|
CREATE TABLE t3 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b LONGBLOB, c LONGBLOB);
|
|
SET DEBUG_SYNC = 'clone_page_copy SIGNAL redo_signal WAIT_FOR go_redo';
|
|
SET DEBUG_SYNC = 'clone_redo_copy SIGNAL redo_middle_signal WAIT_FOR go_redo_middle';
|
|
SET GLOBAL clone_autotune_concurrency = OFF;
|
|
SET GLOBAL clone_max_concurrency = 8;
|
|
CLONE LOCAL DATA DIRECTORY = 'CLONE_DATADIR';
|
|
SET DEBUG_SYNC= 'now WAIT_FOR redo_signal';
|
|
CALL prepare_data(50);
|
|
SET DEBUG_SYNC= 'now SIGNAL go_redo';
|
|
SET DEBUG_SYNC = 'now WAIT_FOR redo_middle_signal';
|
|
SELECT EVENT_NAME, WORK_COMPLETED <= WORK_ESTIMATED
|
|
FROM performance_schema.events_stages_current
|
|
WHERE event_name LIKE "%redo copy%"
|
|
ORDER BY EVENT_NAME;
|
|
EVENT_NAME WORK_COMPLETED <= WORK_ESTIMATED
|
|
stage/innodb/clone (redo copy) 1
|
|
SET DEBUG_SYNC = 'now SIGNAL go_redo_middle';
|
|
SET DEBUG_SYNC = 'RESET';
|
|
DROP PROCEDURE prepare_data;
|
|
USE test;
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
DROP TABLE t3;
|
|
UNINSTALL PLUGIN clone;
|