mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 18:30:16 +00:00
Re-merged PT-242
This commit is contained in:
@@ -1162,7 +1162,10 @@ slave_status() {
|
||||
local outfile=$1
|
||||
local mysql_version=$2
|
||||
|
||||
if [ "${mysql_version}" '<' "5.7" ]; then
|
||||
local sql="SHOW SLAVE STATUS\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
if [ "${mysql_version}" '>' "5.6" ]; then
|
||||
local sql="SHOW SLAVE STATUS\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
@@ -1171,11 +1174,11 @@ slave_status() {
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
sql="SELECT * FROM replication_connection_status\G"
|
||||
sql="SELECT * FROM performance_schema.replication_connection_status\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
|
||||
sql="SELECT * FROM replication_applier_status JOIN replication_applier_status_by_coordinator USING(channel_name)\G"
|
||||
sql="SELECT * FROM performance_schema.replication_applier_status JOIN performance_schema.replication_applier_status_by_coordinator USING(channel_name)\G"
|
||||
echo -e "\n$sql\n" >> $outfile
|
||||
$CMD_MYSQL $EXT_ARGV -e "$sql" >> $outfile
|
||||
fi
|
||||
|
15
sandbox/slave_channels_t.sql
Normal file
15
sandbox/slave_channels_t.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
STOP SLAVE FOR CHANNEL '';
|
||||
SET GLOBAL master_info_repository = 'TABLE';
|
||||
SET @@GLOBAL.relay_log_info_repository = 'TABLE';
|
||||
SET @@GLOBAL.ENFORCE_GTID_CONSISTENCY=ON;
|
||||
SET @@GLOBAL.GTID_MODE = OFF_PERMISSIVE;
|
||||
SET @@GLOBAL.GTID_MODE = ON_PERMISSIVE;
|
||||
SET @@GLOBAL.GTID_MODE = ON;
|
||||
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_port=2900, master_user='msandbox', master_password='msandbox', master_auto_position=1 FOR CHANNEL 'masterchan1';
|
||||
|
||||
CHANGE MASTER TO master_host='127.0.0.1', master_port=2901, master_user='msandbox', master_password='msandbox', master_auto_position=1 FOR CHANNEL 'masterchan2';
|
||||
|
||||
START SLAVE for channel 'masterchan1';
|
||||
START SLAVE for channel 'masterchan2';
|
||||
|
@@ -489,11 +489,13 @@ SKIP: {
|
||||
|
||||
$sb->load_file('chan_master1', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
||||
$sb->load_file('chan_master2', "sandbox/gtid_on.sql", undef, no_wait => 1);
|
||||
$sb->load_file('chan_slave1', "sandbox/slave_channels.sql", undef, no_wait => 1);
|
||||
$sb->load_file('chan_slave1', "sandbox/slave_channels_t.sql", undef, no_wait => 1);
|
||||
|
||||
my $slave_cnf = "/tmp/$slave1_port/my.sandbox.cnf";
|
||||
my $cmd = "$trunk/bin/pt-stalk --no-stalk --iterations=1 --host=127.0.0.1 --port=$slave1_port --user=msandbox "
|
||||
. "--password=msandbox --sleep 0 --run-time=10 --dest $dest --log $log_file --iterations=1 "
|
||||
. "--run-time=2 --pid $pid_file --defaults-file=$cnf >$log_file 2>&1";
|
||||
. "--run-time=2 --pid $pid_file --defaults-file=$slave_cnf >$log_file 2>&1";
|
||||
diag ($cmd);
|
||||
system($cmd);
|
||||
sleep 5;
|
||||
PerconaTest::kill_program(pid_file => $pid_file);
|
||||
@@ -502,9 +504,9 @@ SKIP: {
|
||||
|
||||
like(
|
||||
$output,
|
||||
qr/FROM performance_schema.replication_connection_configuration JOIN performance_schema.replication_applier_configuration USING/,
|
||||
qr/Slave has read all relay log; waiting for more updates/,
|
||||
"MySQL 5.7 SLAVE STATUS"
|
||||
);
|
||||
) or diag ($output);
|
||||
$sb->stop_sandbox(qw(chan_master1 chan_master2 chan_slave1));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user