Processlist.pm: Skip checking for a restarted query if looking at a replication thread

This commit is contained in:
Brian Fraser
2013-04-16 11:37:32 -03:00
parent f8999689b5
commit c80c5c38a8
3 changed files with 163 additions and 18 deletions

View File

@@ -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 ) {