This is an automated email from the ASF dual-hosted git repository.
stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
The following commit(s) were added to refs/heads/master by this push:
new c936f95af IMPALA-13678: Validate remote_submit_time against
coordinator time
c936f95af is described below
commit c936f95af2b3efef685aee095e4ecfd550472f3c
Author: Riza Suminto <[email protected]>
AuthorDate: Wed Jan 15 22:45:02 2025 -0800
IMPALA-13678: Validate remote_submit_time against coordinator time
Impala with External frontend hit a DCHECK in
RuntimeProfile::EventSequence::Start(int64_t start_time_ns) because
frontend report remote_submit_time that is more than 3ns ahead of
Coordinator time. This can happen if there is a clock skew between
Frontend node and Impala Coordinator node.
This patch fix the issue by taking the minimum between given
remote_submit_time vs Coordinator's MonotonicStopWatch::Now().
Change-Id: If6e04219c515fddff07bfbee43bb93babb3d307b
Reviewed-on: http://gerrit.cloudera.org:8080/22360
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
be/src/service/client-request-state.cc | 8 +++++++-
be/src/service/client-request-state.h | 4 +++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/be/src/service/client-request-state.cc
b/be/src/service/client-request-state.cc
index c3fb8a13b..eedef67a7 100644
--- a/be/src/service/client-request-state.cc
+++ b/be/src/service/client-request-state.cc
@@ -214,7 +214,13 @@ Status ClientRequestState::SetResultCache(QueryResultSet*
cache,
}
void ClientRequestState::SetRemoteSubmitTime(int64_t remote_submit_time) {
- query_events_->Start(remote_submit_time);
+ int64_t ack_submit_time = min(MonotonicStopWatch::Now(), remote_submit_time);
+ if (ack_submit_time < remote_submit_time) {
+ VLOG_QUERY << "Ignoring remote_submit_time (" << remote_submit_time
+ << " ns) that is more than coordinator time (" <<
ack_submit_time
+ << " ns) for query id=" << PrintId(query_id());
+ }
+ query_events_->Start(ack_submit_time);
}
void ClientRequestState::SetFrontendProfile(const TExecRequest& exec_request) {
diff --git a/be/src/service/client-request-state.h
b/be/src/service/client-request-state.h
index f3c6d8369..e91f041c5 100644
--- a/be/src/service/client-request-state.h
+++ b/be/src/service/client-request-state.h
@@ -99,7 +99,9 @@ class ClientRequestState {
void SetFrontendProfile(const TExecRequest& exec_request);
/// Sets the coordinator time that the plan request was submitted at so that
- /// the backend timeline starts where the frontend timeline ends
+ /// the backend timeline starts where the frontend timeline ends.
+ /// remote_submit_time will be ignored and replaced with internal
+ /// MonotonicStopWatch::Now() if the later is greater than the former.
void SetRemoteSubmitTime(int64_t remote_submit_time);
/// Based on query type, this either initiates execution of this
ClientRequestState's