PT-2340 - Support MySQL 8.4

- s/slave lag/replica lag/ in tests
- reverted rename of COM_REGISTER_SLAVE to COM_REGISTER_REPLICA, because the constant still named COM_REGISTER_SLAVE in 8.4
- removed some slave leftovers from pt-replica-find
This commit is contained in:
Sveta Smirnova
2024-11-12 02:35:15 +03:00
parent a2102efb86
commit a1093ff12c
9 changed files with 31 additions and 31 deletions

View File

@@ -3812,7 +3812,7 @@ use constant {
COM_BINLOG_DUMP => '12',
COM_TABLE_DUMP => '13',
COM_CONNECT_OUT => '14',
COM_REGISTER_REPLICA => '15',
COM_REGISTER_SLAVE => '15',
COM_STMT_PREPARE => '16',
COM_STMT_EXECUTE => '17',
COM_STMT_SEND_LONG_DATA => '18',
@@ -3846,7 +3846,7 @@ my %com_for = (
'12' => 'COM_BINLOG_DUMP',
'13' => 'COM_TABLE_DUMP',
'14' => 'COM_CONNECT_OUT',
'15' => 'COM_REGISTER_REPLICA',
'15' => 'COM_REGISTER_SLAVE',
'16' => 'COM_STMT_PREPARE',
'17' => 'COM_STMT_EXECUTE',
'18' => 'COM_STMT_SEND_LONG_DATA',

View File

@@ -4038,7 +4038,7 @@ sub _d {
# Check at the end of this package for the call to main() which actually runs
# the program.
# ###########################################################################
package pt_slave_find;
package pt_replica_find;
use strict;
use warnings FATAL => 'all';
@@ -4161,7 +4161,7 @@ sub main {
summary => \&print_node_summary,
);
my $print_node = $print_node_sub_for{lc($o->get('report-format'))};
print_slaves(
print_replicas(
node => $root,
print_node => $print_node,
MasterSlave => $ms,
@@ -4185,7 +4185,7 @@ sub main {
# +- 1
# +- 2
# +- 1
sub print_slaves {
sub print_replicas {
my ( %args ) = @_;
my ($ms, $node, $level, $print_node)
= @args{qw(MasterSlave node level print_node)};
@@ -4202,7 +4202,7 @@ sub print_slaves {
PTDEBUG && _d($ms->short_host($node), "has slaves");
my @slaves = reverse @{$node->{children}};
foreach my $slave ( @slaves ) {
print_slaves(%args, node=>$slave, level=>$level + 1);
print_replicas(%args, node=>$slave, level=>$level + 1);
}
}
@@ -4278,8 +4278,8 @@ sub print_node_summary {
}
push @lines, [
'Replication',
($ss ? "Is a slave, " : "Is not a slave, ")
. "has $n_slaves slaves connected, "
($ss ? "Is a replica, " : "Is not a replica, ")
. "has $n_slaves replicas connected, "
. "is " . (($vars->{read_only}->{value} || "") eq "ON" ? "" : "not ")
. "read_only"
];
@@ -4556,7 +4556,7 @@ about each replica, like:
Version 5.1.34-log
Server ID 12345
Uptime 04:56 (started 2010-06-17T11:21:22)
Replication Is not a slave, has 1 slaves connected
Replication Is not a replica, has 1 replicas connected
Filters
Binary logging STATEMENT
Slave status
@@ -4566,7 +4566,7 @@ about each replica, like:
Version 5.1.34-log
Server ID 12346
Uptime 04:54 (started 2010-06-17T11:21:24)
Replication Is a slave, has 1 slaves connected
Replication Is a replica, has 1 replicas connected
Filters
Binary logging STATEMENT
Slave status 0 seconds behind, running, no errors

View File

@@ -7958,7 +7958,7 @@ use constant {
COM_BINLOG_DUMP => '12',
COM_TABLE_DUMP => '13',
COM_CONNECT_OUT => '14',
COM_REGISTER_REPLICA => '15',
COM_REGISTER_SLAVE => '15',
COM_STMT_PREPARE => '16',
COM_STMT_EXECUTE => '17',
COM_STMT_SEND_LONG_DATA => '18',
@@ -7992,7 +7992,7 @@ my %com_for = (
'12' => 'COM_BINLOG_DUMP',
'13' => 'COM_TABLE_DUMP',
'14' => 'COM_CONNECT_OUT',
'15' => 'COM_REGISTER_REPLICA',
'15' => 'COM_REGISTER_SLAVE',
'16' => 'COM_STMT_PREPARE',
'17' => 'COM_STMT_EXECUTE',
'18' => 'COM_STMT_SEND_LONG_DATA',

View File

@@ -75,7 +75,7 @@ use constant {
COM_BINLOG_DUMP => '12',
COM_TABLE_DUMP => '13',
COM_CONNECT_OUT => '14',
COM_REGISTER_REPLICA => '15',
COM_REGISTER_SLAVE => '15',
COM_STMT_PREPARE => '16',
COM_STMT_EXECUTE => '17',
COM_STMT_SEND_LONG_DATA => '18',
@@ -109,7 +109,7 @@ my %com_for = (
'12' => 'COM_BINLOG_DUMP',
'13' => 'COM_TABLE_DUMP',
'14' => 'COM_CONNECT_OUT',
'15' => 'COM_REGISTER_REPLICA',
'15' => 'COM_REGISTER_SLAVE',
'16' => 'COM_STMT_PREPARE',
'17' => 'COM_STMT_EXECUTE',
'18' => 'COM_STMT_SEND_LONG_DATA',

View File

@@ -70,7 +70,7 @@ $output = output(
like(
$output,
qr/Sleeping: slave lag for server/,
qr/Sleeping: replica lag for server/,
'Lag check works'
) or diag($output);
@@ -98,7 +98,7 @@ $output = output(
like(
$output,
qr/Sleeping: slave lag for server/,
qr/Sleeping: replica lag for server/,
'Lag check works when --check-replica-lag provided two times'
) or diag($output);
@@ -126,7 +126,7 @@ $output = output(
like(
$output,
qr/Sleeping: slave lag for server/,
qr/Sleeping: replica lag for server/,
'Test 2: Lag check works when --check-replica-lag provided two times'
) or diag($output);
@@ -153,7 +153,7 @@ $output = output(
like(
$output,
qr/Sleeping: slave lag for server/,
qr/Sleeping: replica lag for server/,
'Lag check works for deprecated option'
) or diag($output);
@@ -181,7 +181,7 @@ $output = output(
like(
$output,
qr/Sleeping: slave lag for server/,
qr/Sleeping: replica lag for server/,
'Lag check works when option --check-slave-lag provided two times'
) or diag($output);
@@ -209,7 +209,7 @@ $output = output(
like(
$output,
qr/Sleeping: slave lag for server/,
qr/Sleeping: replica lag for server/,
'Lag check works for --check-replica-lag when --check-slave-lag also provided'
) or diag($output);
@@ -237,7 +237,7 @@ $output = output(
like(
$output,
qr/Sleeping: slave lag for server/,
qr/Sleeping: replica lag for server/,
'Lag check works for --check-slave-lag when --check-replica-lag also provided'
) or diag($output);

View File

@@ -157,7 +157,7 @@ my $outfile = "/tmp/mk-replica-find-output.txt";
diag(`rm -rf $outfile`);
$output = output(
sub { pt_slave_find::main(@args) },
sub { pt_replica_find::main(@args) },
file => $outfile,
);
@@ -203,7 +203,7 @@ ok(
? "t/pt-replica-find/samples/summary001.txt"
: "t/pt-replica-find/samples/summary001-5.0.txt"), cmd_output => 1, keep_output => 1, update_samples => 1),
"Summary report format",
);
) or diag($result);
# #############################################################################
# Done.

View File

@@ -165,7 +165,7 @@ my $outfile = "/tmp/mk-replica-find-output.txt";
diag(`rm -rf $outfile`);
$output = output(
sub { pt_slave_find::main(@args) },
sub { pt_replica_find::main(@args) },
file => $outfile,
);
@@ -211,7 +211,7 @@ ok(
? "t/pt-replica-find/samples/summary001.txt"
: "t/pt-replica-find/samples/summary001-5.0.txt"), cmd_output => 1, keep_output => 1, update_samples => 1),
"Summary report format",
);
) or diag($result);
# #############################################################################
# Done.

View File

@@ -2,7 +2,7 @@
Version
Server ID 12345
Uptime
Replication Is not a slave, has 1 slaves connected, is not read_only
Replication Is not a replica, has 1 replicas connected, is not read_only
Filters
Binary logging unknown
Slave status
@@ -13,7 +13,7 @@ InnoDB version BUILTIN
Version
Server ID 12346
Uptime
Replication Is a slave, has 1 slaves connected, is
Replication Is a replica, has 1 replicas connected, is
Filters
Binary logging unknown
Slave status 0 seconds behind, running, no errors
@@ -24,7 +24,7 @@ InnoDB version BUILTIN
Version
Server ID 12347
Uptime
Replication Is a slave, has 0 slaves connected, is
Replication Is a replica, has 0 replicas connected, is
Filters
Binary logging unknown
Slave status 0 seconds behind, running, no errors

View File

@@ -2,7 +2,7 @@
Version
Server ID 12345
Uptime
Replication Is not a slave, has 1 slaves connected, is not read_only
Replication Is not a replica, has 1 replicas connected, is not read_only
Filters
Binary logging
Slave status
@@ -13,7 +13,7 @@ InnoDB version BUILTIN
Version
Server ID 12346
Uptime
Replication Is a slave, has 1 slaves connected, is
Replication Is a replica, has 1 replicas connected, is
Filters
Binary logging
Slave status 0 seconds behind, running, no errors
@@ -24,7 +24,7 @@ InnoDB version BUILTIN
Version
Server ID 12347
Uptime
Replication Is a slave, has 0 slaves connected, is read_only
Replication Is a replica, has 0 replicas connected, is read_only
Filters
Binary logging
Slave status 0 seconds behind, running, no errors