Default value of --recursion-method, "processlist,hosts" is actually same as "processlist"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Option of recursion-method's implicit default value is "processlist,
In lib/MasterSlave.pm,
240 sub find_slave_hosts {
241 my ( $self, $dsn_parser, $dbh, $dsn, $methods ) = @_;
242
243 PTDEBUG && _d('Looking for slaves on', $dsn_parser-
244 'using methods', @$methods);
245
246 my @slaves;
247 METHOD:
248 foreach my $method ( @$methods ) {
249 my $find_slaves = "_find_
250 PTDEBUG && _d('Finding slaves with', $find_slaves);
251 @slaves = $self->
252 last METHOD if @slaves;
253 }
254
255 PTDEBUG && _d('Found', scalar(@slaves), 'slaves');
256 return @slaves;
257 }
At first, line:248 calls _find_slaves_
After that, line:252, @slaves has always value, thus "hosts" in @methods will never process even when slave uses non-standard port and @slaves from "processlist" in @methods can't use.
Indeed, document says "The processlist method is the default, because SHOW SLAVE HOSTS is not reliable.", but default-value "processlist,hosts" made me misunderstanding the tool picks slaves both of "processlist" and "hosts".
And there may be no case when SHOW PROCESSLIST doesn't return nothing(Binlog Dump thread is not there) and SHOW SLAVE HOSTS returns something.
Default value should be just "processlist".