mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-02 02:34:19 +00:00
PT-181 online-schema-change not in sync with modules
- Modules updated - Improved tests
This commit is contained in:
@@ -42,15 +42,20 @@ $slave_dbh->do('STOP SLAVE');
|
||||
$slave_dbh->do('RESET SLAVE');
|
||||
$slave_dbh->do('START SLAVE');
|
||||
|
||||
diag('Loading test data');
|
||||
$sb->load_file('master', "t/pt-online-schema-change/samples/slave_lag.sql");
|
||||
|
||||
diag("Setting slave delay to $delay seconds");
|
||||
|
||||
$slave_dbh->do('STOP SLAVE');
|
||||
$slave_dbh->do("CHANGE MASTER TO MASTER_DELAY=$delay");
|
||||
$slave_dbh->do('START SLAVE');
|
||||
|
||||
diag('Loading test data');
|
||||
$sb->load_file('master', "t/pt-online-schema-change/samples/slave_lag.sql");
|
||||
|
||||
# Run a full table scan query to ensure the slave is behind the master
|
||||
$master_dbh->do('RESET QUERY CACHE');
|
||||
$slave_dbh->do('RESET QUERY CACHE');
|
||||
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""');
|
||||
|
||||
# This is the base test, ust to ensure that without using --check-slave-lag nor --skip-check-slave-lag
|
||||
# pt-online-schema-change will wait on the slave at port 12346
|
||||
|
||||
@@ -69,6 +74,11 @@ like(
|
||||
$args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag 5 --alter 'ENGINE=InnoDB' "
|
||||
. "--check-slave-lag h=127.1,P=12346,u=msandbox,p=msandbox,D=test,t=sbtest";
|
||||
|
||||
# Run a full table scan query to ensure the slave is behind the master
|
||||
$master_dbh->do('RESET QUERY CACHE');
|
||||
$slave_dbh->do('RESET QUERY CACHE');
|
||||
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""');
|
||||
|
||||
diag("Starting --check-slave-lag test. This is going to take some time due to the delay in the slave");
|
||||
$output = `$trunk/bin/pt-online-schema-change $args 2>&1`;
|
||||
|
||||
@@ -79,6 +89,11 @@ like(
|
||||
);
|
||||
|
||||
# Repeat the test now using --skip-check-slave-lag
|
||||
# Run a full table scan query to ensure the slave is behind the master
|
||||
$master_dbh->do('RESET QUERY CACHE');
|
||||
$slave_dbh->do('RESET QUERY CACHE');
|
||||
$master_dbh->do('UPDATE `test`.`pt178` SET f2 = f2 + 1 WHERE f1 = ""');
|
||||
|
||||
$args = "$master_dsn,D=test,t=pt178 --execute --chunk-size 1 --max-lag 5 --alter 'ENGINE=InnoDB' "
|
||||
. "--skip-check-slave-lag h=127.0.0.1,P=12346,u=msandbox,p=msandbox,D=test,t=sbtest";
|
||||
|
||||
@@ -91,6 +106,11 @@ unlike(
|
||||
"--skip-check-slave-lag is really skipping the slave",
|
||||
);
|
||||
|
||||
diag("Setting slave delay to 0 seconds");
|
||||
$slave_dbh->do('STOP SLAVE');
|
||||
$slave_dbh->do('RESET SLAVE');
|
||||
$slave_dbh->do('START SLAVE');
|
||||
|
||||
$master_dbh->do("DROP DATABASE IF EXISTS test");
|
||||
|
||||
# #############################################################################
|
||||
|
Reference in New Issue
Block a user