This is an automated email from the ASF dual-hosted git repository.

arawat pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 1932654252491e1e65cde06b54615a7a0fc2a8e1
Author: Riza Suminto <[email protected]>
AuthorDate: Thu Sep 29 00:04:38 2022 -0700

    IMPALA-11637: Add DCHECK in AdmissionController::UpdateExecGroupMetric
    
    There has been occurrences where an impala backend crash and lead to
    metric admission-controller.executor-group.num-queries-executing.*
    goes negative. While we still investigating the exact scenario leading
    into this negative metric issue, this patch add a DCHECK in
    AdmissionController::UpdateExecGroupMetric to ensure that such case
    does not happen in regular nightly tests.
    
    Testing:
    - Run and pass exhaustive test.
    
    Change-Id: Icee9ae58d14d69a1548da3eccb51a00a7d727c13
    Reviewed-on: http://gerrit.cloudera.org:8080/19095
    Reviewed-by: Abhishek Rawat <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 be/src/scheduling/admission-controller.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/be/src/scheduling/admission-controller.cc 
b/be/src/scheduling/admission-controller.cc
index 432f3196e..1e31813ba 100644
--- a/be/src/scheduling/admission-controller.cc
+++ b/be/src/scheduling/admission-controller.cc
@@ -2571,7 +2571,10 @@ void AdmissionController::UpdateExecGroupMetricMap(
 void AdmissionController::UpdateExecGroupMetric(
     const string& grp_name, int64_t delta) {
   auto entry = exec_group_query_load_map_.find(grp_name);
-  if (entry != exec_group_query_load_map_.end()) 
entry->second->Increment(delta);
+  if (entry != exec_group_query_load_map_.end()) {
+    DCHECK_GE(entry->second->GetValue() + delta, 0);
+    entry->second->Increment(delta);
+  }
 }
 
 } // namespace impala

Reply via email to