mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-08 11:07:58 +00:00
Processlist.pm: Skip checking for a restarted query if looking at a replication thread
This commit is contained in:
@@ -245,14 +245,29 @@ sub parse_event {
|
||||
$new_query = 1;
|
||||
}
|
||||
elsif ( $curr->[INFO] && defined $curr->[TIME]
|
||||
&& $query_start - $etime - $prev->[START] > $fudge ) {
|
||||
&& $query_start - $etime - $prev->[START] > $fudge)
|
||||
{
|
||||
# If the query's recalculated start time minus its previously
|
||||
# calculated start time is greater than the fudge factor, then
|
||||
# the query has restarted. I.e. the new start time is after
|
||||
# the previous start time.
|
||||
PTDEBUG && _d('Query restarted; new query',
|
||||
$query_start, $etime, $prev->[START], $fudge);
|
||||
$new_query = 1;
|
||||
my $ms = $self->{MasterSlave};
|
||||
|
||||
my $is_repl_thread = $ms->is_replication_thread({
|
||||
Command => $curr->[COMMAND],
|
||||
User => $curr->[USER],
|
||||
State => $curr->[STATE],
|
||||
Id => $curr->[ID]});
|
||||
if ( !$is_repl_thread ) {
|
||||
PTDEBUG && _d('Query restarted; new query',
|
||||
$query_start, $etime, $prev->[START], $fudge);
|
||||
$new_query = 1;
|
||||
}
|
||||
elsif ( PTDEBUG ) {
|
||||
_d(q'Query has a start time beyond the fudge factor, ',
|
||||
q'but not counting it as a new query because, ',
|
||||
q{it's a replication thread});
|
||||
}
|
||||
}
|
||||
|
||||
if ( $new_query ) {
|
||||
|
Reference in New Issue
Block a user