mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-26 01:02:25 +08:00
Tweak warning. Enhance docu around --check-binlog-format.
This commit is contained in:
+20
-9
@@ -8586,17 +8586,21 @@ sub main {
|
|||||||
);
|
);
|
||||||
PTDEBUG && _d(scalar @$slaves, 'slaves found');
|
PTDEBUG && _d(scalar @$slaves, 'slaves found');
|
||||||
|
|
||||||
|
# https://bugs.launchpad.net/percona-toolkit/+bug/938068
|
||||||
if ( $o->get('check-binlog-format') ) {
|
if ( $o->get('check-binlog-format') ) {
|
||||||
my ($master_binlog) = $master_dbh->selectrow_array('SELECT @@binlog_format');
|
my ($master_binlog) = $master_dbh->selectrow_array(
|
||||||
|
'SELECT @@binlog_format');
|
||||||
my $err = '';
|
my $err = '';
|
||||||
for my $slave_cxn (@$slaves) {
|
for my $slave_cxn (@$slaves) {
|
||||||
my ($slave_binlog) = $slave_cxn->dbh->selectrow_array('SELECT @@binlog_format');
|
my ($slave_binlog) = $slave_cxn->dbh->selectrow_array(
|
||||||
|
'SELECT @@binlog_format');
|
||||||
if ( $master_binlog ne $slave_binlog ) {
|
if ( $master_binlog ne $slave_binlog ) {
|
||||||
$err .= $master_cxn->name() . " has binlog_format $master_binlog "
|
$err .= $master_cxn->name() . " has binlog_format "
|
||||||
. "but its slave " . $slave_cxn->name() . " has format "
|
. $master_binlog . " but replica " . $slave_cxn->name()
|
||||||
. $slave_binlog . ". This can break replication. If you "
|
. " has binlog_format $slave_binlog. This could cause "
|
||||||
. "understand the risks, you can specify "
|
. "pt-table-checksum to break replication. "
|
||||||
. "--no-check-binlog-format to avoid this error.\n"
|
. "If understand the risks, specify "
|
||||||
|
. "--no-check-binlog-format to disable this check.\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
die $err if $err;
|
die $err if $err;
|
||||||
@@ -10526,7 +10530,9 @@ Sleep time between checks for L<"--max-lag">.
|
|||||||
|
|
||||||
default: yes
|
default: yes
|
||||||
|
|
||||||
Check that the binlog_format is the same in all servers.
|
Check that the C<binlog_format> is the same on all servers.
|
||||||
|
|
||||||
|
See "Replicas using row-based replication" under L<"LIMITATIONS">.
|
||||||
|
|
||||||
=item --[no]check-plan
|
=item --[no]check-plan
|
||||||
|
|
||||||
@@ -11344,7 +11350,12 @@ pt-table-checksum requires statement-based replication, and it sets
|
|||||||
C<binlog_format=STATEMENT> on the master, but due to a MySQL limitation
|
C<binlog_format=STATEMENT> on the master, but due to a MySQL limitation
|
||||||
replicas do not honor this change. Therefore, checksums will not replicate
|
replicas do not honor this change. Therefore, checksums will not replicate
|
||||||
past any replicas using row-based replication that are masters for
|
past any replicas using row-based replication that are masters for
|
||||||
further replicas. (L<Bug 899415|https://bugs.launchpad.net/percona-toolkit/+bug/899415>)
|
further replicas.
|
||||||
|
|
||||||
|
The tool automatically checks the C<binlog_format> on all servers.
|
||||||
|
See L<"--[no]check-binlog-format">
|
||||||
|
|
||||||
|
(L<Bug 899415|https://bugs.launchpad.net/percona-toolkit/+bug/899415>)
|
||||||
|
|
||||||
=item Percona XtraDB Cluster
|
=item Percona XtraDB Cluster
|
||||||
|
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ diag(`$trunk/sandbox/start-sandbox slave 12349 12348`);
|
|||||||
|
|
||||||
$output = output( sub { pt_table_checksum::main(@args) }, stderr => 1 );
|
$output = output( sub { pt_table_checksum::main(@args) }, stderr => 1 );
|
||||||
|
|
||||||
my $re = qr/ has binlog_format .*? has format (\S+)\. This can break replication/msi;
|
my $re = qr/ has binlog_format .*? has binlog_format (\S+)\./msi;
|
||||||
like(
|
like(
|
||||||
$output,
|
$output,
|
||||||
$re,
|
$re,
|
||||||
@@ -218,7 +218,7 @@ is_deeply(
|
|||||||
"...and warns for both level 1 and level 2 slaves"
|
"...and warns for both level 1 and level 2 slaves"
|
||||||
) or diag($output);
|
) or diag($output);
|
||||||
|
|
||||||
diag(`$trunk/sandbox/stop-sandbox slave 12348 12349`);
|
diag(`$trunk/sandbox/stop-sandbox 12348 12349`);
|
||||||
}
|
}
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
# Done.
|
# Done.
|
||||||
|
|||||||
Reference in New Issue
Block a user