mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-03-01 02:00:46 +08:00
Docu limitations of using ptc with PXC. Update Cxn to get is_cluster_node(). Fix SELECT to make tests happy.
This commit is contained in:
@@ -2987,6 +2987,7 @@ sub new {
|
||||
dbh_set => 0,
|
||||
OptionParser => $o,
|
||||
DSNParser => $dp,
|
||||
is_cluster_node => undef,
|
||||
};
|
||||
|
||||
return bless $self, $class;
|
||||
@@ -3056,6 +3057,19 @@ sub name {
|
||||
return $self->{hostname} || $self->{dsn_name} || 'unknown host';
|
||||
}
|
||||
|
||||
sub is_cluster_node {
|
||||
my ($self) = @_;
|
||||
return $self->{is_cluster_node} if defined $self->{is_cluster_node};
|
||||
|
||||
my $sql = "SHOW VARIABLES LIKE 'wsrep_on'";
|
||||
PTDEBUG && _d($sql);
|
||||
my $row = $self->{dbh}->selectrow_arrayref($sql);
|
||||
PTDEBUG && _d(defined $row ? @$row : 'undef');
|
||||
$self->{is_cluster_node} = $row && $row->[0] ? 1 : 0;
|
||||
|
||||
return $self->{is_cluster_node};
|
||||
}
|
||||
|
||||
sub DESTROY {
|
||||
my ($self) = @_;
|
||||
if ( $self->{dbh}
|
||||
@@ -8533,7 +8547,7 @@ sub main {
|
||||
my $checksum_dml = "REPLACE INTO $repl_table "
|
||||
. "(db, tbl, chunk, chunk_index,"
|
||||
. " lower_boundary, upper_boundary, this_cnt, this_crc) "
|
||||
. "SELECT "
|
||||
. "SELECT"
|
||||
. ($master_cxn->is_cluster_node() ? '/*!99997*/' : '')
|
||||
. " ?, ?, ?, ?, ?, ?,";
|
||||
my $past_cols = " COUNT(*), '0'";
|
||||
@@ -11028,6 +11042,14 @@ replicas do not honor this change. Therefore, checksums will not replicate
|
||||
past any replicas using row-based replication that are masters for
|
||||
further replicas. (L<Bug 899415|https://bugs.launchpad.net/percona-toolkit/+bug/899415>)
|
||||
|
||||
=item Percona XtraDB Cluster
|
||||
|
||||
pt-table-checksum works with Percona XtraDB Cluster 5.5.27-23.6 and newer.
|
||||
The C<dsn> method for L<"--recursion-method"> must be used to specify cluster
|
||||
nodes and regular replicas because nodes are not regular replicas so they
|
||||
cannot be detected automatically. The lag check (see L<"REPLICA CHECKS">)
|
||||
is not performed for cluster nodes.
|
||||
|
||||
=back
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
Reference in New Issue
Block a user