mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-26 01:02:25 +08:00
Update MasterSlave in all tools and add "none" to --recursion-method docs. Tools pass their tests.
This commit is contained in:
+10
-1
@@ -73,6 +73,9 @@ sub get_slaves {
|
||||
dsn_table_dsn => $dsn_table_dsn,
|
||||
);
|
||||
}
|
||||
elsif ( $method =~ m/none/i ) {
|
||||
PTDEBUG && _d('Not getting to slaves');
|
||||
}
|
||||
else {
|
||||
die "Invalid --recursion-method: $method. Valid values are: "
|
||||
. "dsn=DSN, hosts, or processlist.\n";
|
||||
@@ -87,6 +90,11 @@ sub recurse_to_slaves {
|
||||
my $dp = $args->{dsn_parser};
|
||||
my $dsn = $args->{dsn};
|
||||
|
||||
if ( lc($args->{method} || '') eq 'none' ) {
|
||||
PTDEBUG && _d('Not recursing to slaves');
|
||||
return;
|
||||
}
|
||||
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
@@ -4131,9 +4139,10 @@ Preferred recursion method used to find slaves.
|
||||
Possible methods are:
|
||||
|
||||
METHOD USES
|
||||
=========== ================
|
||||
=========== ==================
|
||||
processlist SHOW PROCESSLIST
|
||||
hosts SHOW SLAVE HOSTS
|
||||
none Do not find slaves
|
||||
|
||||
The processlist method is preferred because SHOW SLAVE HOSTS is not reliable.
|
||||
However, the hosts method is required if the server uses a non-standard
|
||||
|
||||
@@ -2901,6 +2901,9 @@ sub get_slaves {
|
||||
dsn_table_dsn => $dsn_table_dsn,
|
||||
);
|
||||
}
|
||||
elsif ( $method =~ m/none/i ) {
|
||||
PTDEBUG && _d('Not getting to slaves');
|
||||
}
|
||||
else {
|
||||
die "Invalid --recursion-method: $method. Valid values are: "
|
||||
. "dsn=DSN, hosts, or processlist.\n";
|
||||
@@ -2915,6 +2918,11 @@ sub recurse_to_slaves {
|
||||
my $dp = $args->{dsn_parser};
|
||||
my $dsn = $args->{dsn};
|
||||
|
||||
if ( lc($args->{method} || '') eq 'none' ) {
|
||||
PTDEBUG && _d('Not recursing to slaves');
|
||||
return;
|
||||
}
|
||||
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
@@ -7295,6 +7303,7 @@ Preferred recursion method for discovering replicas. Possible methods are:
|
||||
processlist SHOW PROCESSLIST
|
||||
hosts SHOW SLAVE HOSTS
|
||||
dsn=DSN DSNs from a table
|
||||
none Do not find slaves
|
||||
|
||||
The processlist method is the default, because SHOW SLAVE HOSTS is not
|
||||
reliable. However, the hosts method can work better if the server uses a
|
||||
|
||||
+10
-1
@@ -1454,6 +1454,9 @@ sub get_slaves {
|
||||
dsn_table_dsn => $dsn_table_dsn,
|
||||
);
|
||||
}
|
||||
elsif ( $method =~ m/none/i ) {
|
||||
PTDEBUG && _d('Not getting to slaves');
|
||||
}
|
||||
else {
|
||||
die "Invalid --recursion-method: $method. Valid values are: "
|
||||
. "dsn=DSN, hosts, or processlist.\n";
|
||||
@@ -1468,6 +1471,11 @@ sub recurse_to_slaves {
|
||||
my $dp = $args->{dsn_parser};
|
||||
my $dsn = $args->{dsn};
|
||||
|
||||
if ( lc($args->{method} || '') eq 'none' ) {
|
||||
PTDEBUG && _d('Not recursing to slaves');
|
||||
return;
|
||||
}
|
||||
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
@@ -3048,9 +3056,10 @@ Preferred recursion method used to find slaves.
|
||||
Possible methods are:
|
||||
|
||||
METHOD USES
|
||||
=========== ================
|
||||
=========== ==================
|
||||
processlist SHOW PROCESSLIST
|
||||
hosts SHOW SLAVE HOSTS
|
||||
none Do not find slaves
|
||||
|
||||
The processlist method is preferred because SHOW SLAVE HOSTS is not reliable.
|
||||
However, the hosts method is required if the server uses a non-standard
|
||||
|
||||
+10
-1
@@ -1614,6 +1614,9 @@ sub get_slaves {
|
||||
dsn_table_dsn => $dsn_table_dsn,
|
||||
);
|
||||
}
|
||||
elsif ( $method =~ m/none/i ) {
|
||||
PTDEBUG && _d('Not getting to slaves');
|
||||
}
|
||||
else {
|
||||
die "Invalid --recursion-method: $method. Valid values are: "
|
||||
. "dsn=DSN, hosts, or processlist.\n";
|
||||
@@ -1628,6 +1631,11 @@ sub recurse_to_slaves {
|
||||
my $dp = $args->{dsn_parser};
|
||||
my $dsn = $args->{dsn};
|
||||
|
||||
if ( lc($args->{method} || '') eq 'none' ) {
|
||||
PTDEBUG && _d('Not recursing to slaves');
|
||||
return;
|
||||
}
|
||||
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
@@ -3179,9 +3187,10 @@ Preferred recursion method used to find slaves.
|
||||
Possible methods are:
|
||||
|
||||
METHOD USES
|
||||
=========== ================
|
||||
=========== ==================
|
||||
processlist SHOW PROCESSLIST
|
||||
hosts SHOW SLAVE HOSTS
|
||||
none Do not find slaves
|
||||
|
||||
The processlist method is preferred because SHOW SLAVE HOSTS is not reliable.
|
||||
However, the hosts method is required if the server uses a non-standard
|
||||
|
||||
@@ -8240,6 +8240,7 @@ Preferred recursion method for discovering replicas. Possible methods are:
|
||||
processlist SHOW PROCESSLIST
|
||||
hosts SHOW SLAVE HOSTS
|
||||
dsn=DSN DSNs from a table
|
||||
none Do not find slaves
|
||||
|
||||
The processlist method is the default, because SHOW SLAVE HOSTS is not
|
||||
reliable. However, the hosts method can work better if the server uses a
|
||||
|
||||
+10
-1
@@ -5924,6 +5924,9 @@ sub get_slaves {
|
||||
dsn_table_dsn => $dsn_table_dsn,
|
||||
);
|
||||
}
|
||||
elsif ( $method =~ m/none/i ) {
|
||||
PTDEBUG && _d('Not getting to slaves');
|
||||
}
|
||||
else {
|
||||
die "Invalid --recursion-method: $method. Valid values are: "
|
||||
. "dsn=DSN, hosts, or processlist.\n";
|
||||
@@ -5938,6 +5941,11 @@ sub recurse_to_slaves {
|
||||
my $dp = $args->{dsn_parser};
|
||||
my $dsn = $args->{dsn};
|
||||
|
||||
if ( lc($args->{method} || '') eq 'none' ) {
|
||||
PTDEBUG && _d('Not recursing to slaves');
|
||||
return;
|
||||
}
|
||||
|
||||
my $dbh;
|
||||
eval {
|
||||
$dbh = $args->{dbh} || $dp->get_dbh(
|
||||
@@ -10050,9 +10058,10 @@ Preferred recursion method used to find slaves.
|
||||
Possible methods are:
|
||||
|
||||
METHOD USES
|
||||
=========== ================
|
||||
=========== ==================
|
||||
processlist SHOW PROCESSLIST
|
||||
hosts SHOW SLAVE HOSTS
|
||||
none Do not find slaves
|
||||
|
||||
The processlist method is preferred because SHOW SLAVE HOSTS is not reliable.
|
||||
However, the hosts method is required if the server uses a non-standard
|
||||
|
||||
@@ -51,7 +51,7 @@ unlike($output, qr/Table 'test.t' doesn't exist'/, 'It is not busted');
|
||||
ok(-f '/tmp/pt-slave-restart.pid', 'PID file created');
|
||||
ok(-f '/tmp/pt-slave-restart.log', 'Log file created');
|
||||
|
||||
my ($pid) = $output =~ /\s+(\d+)\s+/;
|
||||
my ($pid) = $output =~ /^\s+\d+\s+(\d+)\s+/;
|
||||
$output = `cat /tmp/pt-slave-restart.pid`;
|
||||
is($output, $pid, 'PID file has correct PID');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user