mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 21:51:21 +00:00
Add stub test for pt-osc on master replicating to cluster, altering table with foreign keys.
This commit is contained in:
@@ -119,7 +119,7 @@ ok(
|
|||||||
$exit,
|
$exit,
|
||||||
"wsrep_OSU_method=RSU: non-zero exit"
|
"wsrep_OSU_method=RSU: non-zero exit"
|
||||||
) or diag($output);
|
) or diag($output);
|
||||||
print $output;
|
|
||||||
like(
|
like(
|
||||||
$output,
|
$output,
|
||||||
qr/wsrep_OSU_method=TOI is required.+?currently set to RSU/,
|
qr/wsrep_OSU_method=TOI is required.+?currently set to RSU/,
|
||||||
@@ -133,9 +133,38 @@ is_deeply(
|
|||||||
"Restored wsrep_OSU_method=TOI"
|
"Restored wsrep_OSU_method=TOI"
|
||||||
) or BAIL_OUT("Failed to restore wsrep_OSU_method=TOI");
|
) or BAIL_OUT("Failed to restore wsrep_OSU_method=TOI");
|
||||||
|
|
||||||
|
# #############################################################################
|
||||||
|
# master -> cluster, run on master on table with foreign keys.
|
||||||
|
# #############################################################################
|
||||||
|
|
||||||
|
my ($master_dbh, $master_dsn) = $sb->start_sandbox(
|
||||||
|
server => 'cmaster',
|
||||||
|
type => 'master',
|
||||||
|
env => q/BINLOG_FORMAT="ROW"/,
|
||||||
|
);
|
||||||
|
|
||||||
|
# CAREFUL: The master and the cluster are different, so we must load dbs on
|
||||||
|
# the master then flush the logs, else node1 will apply the master's binlogs
|
||||||
|
# and blow up because it already had these dbs.
|
||||||
|
$master_dbh->do("FLUSH LOGS");
|
||||||
|
$master_dbh->do("RESET MASTER");
|
||||||
|
|
||||||
|
$sb->set_as_slave('node1', 'cmaster');
|
||||||
|
|
||||||
|
$sb->load_file('cmaster', "$sample/basic_with_fks.sql");
|
||||||
|
|
||||||
|
($output, $exit) = full_output(
|
||||||
|
sub { pt_online_schema_change::main(
|
||||||
|
"$master_dsn,D=pt_osc,t=city",
|
||||||
|
qw(--print --execute --alter-foreign-keys-method auto),
|
||||||
|
'--alter', 'DROP COLUMN last_update'
|
||||||
|
)},
|
||||||
|
stderr => 1,
|
||||||
|
);
|
||||||
|
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
# Done.
|
# Done.
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
$sb->wipe_clean($node1);
|
#$sb->wipe_clean($node1);
|
||||||
ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
#ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox");
|
||||||
done_testing;
|
done_testing;
|
||||||
|
Reference in New Issue
Block a user