1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
# Test clone remote restart command
--source include/have_debug.inc
--let $CLONE_DATADIR = $MYSQL_TMP_DIR/data_new
--let $HOST = 127.0.0.1
--let $PORT =`select @@port`
--let $USER = root
--let remote_clone = 1
CREATE TABLE t1(col1 INT PRIMARY KEY, col2 char(64));
INSERT INTO t1 VALUES(10, 'clone row 1');
INSERT INTO t1 VALUES(20, 'clone row 2');
INSERT INTO t1 VALUES(30, 'clone row 3');
SELECT * from t1 ORDER BY col1;
# Install Clone Plugin
--replace_result $CLONE_PLUGIN CLONE_PLUGIN
--eval INSTALL PLUGIN clone SONAME '$CLONE_PLUGIN'
SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS
WHERE PLUGIN_NAME LIKE '%clone%';
SET GLOBAL CLONE_MAX_CONCURRENCY = 8;
SHOW VARIABLES LIKE '%CLONE_MAX_CONCURRENCY%';
SET GLOBAL CLONE_MAX_CONCURRENCY = default;
--echo # Clone failure by forcing network error and disabling restart
SET GLOBAL CLONE_DONOR_TIMEOUT_AFTER_NETWORK_FAILURE = 0;
SHOW VARIABLES LIKE 'CLONE_DONOR_TIMEOUT_AFTER_NETWORK_FAILURE';
SET global debug="+d,clone_restart_apply";
--let $clone_err = ER_CLONE_DONOR
--source ../include/clone_command.inc
--let $clone_err = 0
SET global debug="-d,clone_restart_apply";
--force-rmdir $CLONE_DATADIR
--echo # Clone by forcing network error and allowing restart
SET GLOBAL CLONE_DONOR_TIMEOUT_AFTER_NETWORK_FAILURE = 15;
SHOW VARIABLES LIKE 'CLONE_DONOR_TIMEOUT_AFTER_NETWORK_FAILURE';
SET global debug="+d,clone_restart_apply";
--source ../include/clone_command.inc
SET global debug="-d,clone_restart_apply";
# Restart server on cloned data directory
--replace_result $CLONE_DATADIR CLONE_DATADIR
--let restart_parameters="restart: --datadir=$CLONE_DATADIR"
--source include/restart_mysqld.inc
# Validate data
SELECT * from t1 ORDER BY col1;
INSERT INTO t1 VALUES(40, 'clone row 4');
SELECT * from t1 ORDER BY col1;
#Cleanup
--let restart_parameters="restart:"
--source include/restart_mysqld.inc
SELECT * from t1 ORDER BY col1;
UNINSTALL PLUGIN clone;
DROP TABLE t1;
--force-rmdir $CLONE_DATADIR
|