PT-2340 - Support MySQL 8.4

- Removed all unneeded occuriences of the word "master" in lib
This commit is contained in:
Sveta Smirnova
2024-07-25 23:12:43 +03:00
parent e2207ea232
commit b9a5231c9b
16 changed files with 186 additions and 114 deletions

View File

@@ -702,18 +702,25 @@ sub normalize_checksum_results {
return $normal_output;
}
sub get_master_binlog_pos {
sub get_source_binlog_pos {
my ($dbh) = @_;
my $sql = "SHOW MASTER STATUS";
my $vp = VersionParser->new($dbh);
my $source_name = 'source';
if ( $vp->cmp('8.1') < 0 || $vp->flavor() =~ m/maria/i ) {
$source_name = 'master';
}
my $sql = "SHOW ${source_name} STATUS";
my $ms = $dbh->selectrow_hashref($sql);
return $ms->{position};
}
sub get_slave_pos_relative_to_master {
sub get_slave_pos_relative_to_source {
my ($dbh) = @_;
my $sql = "SHOW SLAVE STATUS";
my $ss = $dbh->selectrow_hashref($sql);
return $ss->{exec_master_log_pos};
return $ss->{exec_source_log_pos};
}
# Like output(), but forks a process to execute the coderef.

View File

@@ -112,7 +112,7 @@ sub find_cluster_nodes {
# If there wasn't a port, that means that this bug
# https://bugs.launchpad.net/percona-toolkit/+bug/1082406
# isn't fixed on this version of PXC. We tried using the
# master's port, but that didn't work. So try again, using
# source's port, but that didn't work. So try again, using
# the default port.
if ( !$port && $dsn->{P} != 3306 ) {
$address .= ":3306";