Pranay Singh has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/8215


Change subject: IMPALA-5142 EventSequence displays negative elapsed time.
......................................................................

IMPALA-5142 EventSequence displays negative elapsed time.

EventSequence may display a negative elapsed time if ClientRequestState is done
while EventSequence::MarkEvent() is in progress.

The time is calculated based on POSIX clock_gettime() which uses 
CLOCK_MONOTONIC that
will always give a time in increasing time order. In this case the cause of 
negative
delay is start time becoming greater than end time, as the difference of latter 
and
the former is used to compute the delay.

The negative delay case can happen if EventSequence::Start() is called on the 
same
EventSequence for which EventSequence::MarkEvent() is in progress.It can be 
serialized
by reordering the lock in EventSequence::MarkEvent() but that may be a 
performance
overhead, calling ElapsedTime() with lock held.So this patch fixes the issue by 
returning
a 0 delay value when such an issue ever happens rather than returning a 
negative delay
value.

Testing:
-------
Ran all the front-end/backend and end-end tests.

Change-Id: I8c944396d96473b17b453da3e913ffc56680a896
---
M be/src/util/stopwatch.h
1 file changed, 6 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/15/8215/1
--
To view, visit http://gerrit.cloudera.org:8080/8215
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c944396d96473b17b453da3e913ffc56680a896
Gerrit-Change-Number: 8215
Gerrit-PatchSet: 1
Gerrit-Owner: Pranay Singh

Reply via email to