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

wzhou 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 922ee7f9e IMPALA-13378: Verify tuple ids in descriptor table received 
in executor side
922ee7f9e is described below

commit 922ee7f9eaac2b3d66ab2b12cf8bcf9b3f14cbb8
Author: stiga-huang <[email protected]>
AuthorDate: Thu Sep 12 18:46:08 2024 +0800

    IMPALA-13378: Verify tuple ids in descriptor table received in executor side
    
    It's suspicious that KRPC could receive incomplete sidecar data
    (KUDU-3582). TQueryCtx and TExecPlanFragmentInfo are both sent as
    sidecars. Executors should check whether tuple ids in
    TExecPlanFragmentInfo are consistent with the descriptor table
    deserialized from TQueryCtx.
    
    This patch adds the check when launching the fragment instance threads.
    
    Tests
     - ran CORE tests
    
    Change-Id: I0c489d3bff7ae08813271c65086ea6b238420e47
    Reviewed-on: http://gerrit.cloudera.org:8080/21794
    Reviewed-by: Wenzhe Zhou <[email protected]>
    Reviewed-by: Michael Smith <[email protected]>
    Tested-by: Michael Smith <[email protected]>
---
 be/src/runtime/query-state.cc | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/be/src/runtime/query-state.cc b/be/src/runtime/query-state.cc
index 60c043ccf..8cce660eb 100644
--- a/be/src/runtime/query-state.cc
+++ b/be/src/runtime/query-state.cc
@@ -863,6 +863,23 @@ bool QueryState::StartFInstances() {
   if (UNLIKELY(!start_finstances_status.ok())) goto error;
   VLOG(2) << "descriptor table for query=" << PrintId(query_id())
           << "\n" << desc_tbl_->DebugString();
+  // IMPALA-13378: Verify that tuple ids in all PlanNode exist in the 
descriptor table.
+  for (TPlanFragment f : fragment_info_.fragments) {
+    for (TPlanNode node : f.plan.nodes) {
+      for (TTupleId tuple_id : node.row_tuples) {
+        if (UNLIKELY(desc_tbl_->GetTupleDescriptor(tuple_id) == nullptr)) {
+          string msg = Substitute(
+              "Tuple id $0 of PlanNode $1 not found in descriptor table",
+              tuple_id, node.node_id);
+          // It'd be helpful to also print 'fragment_info_' but it might lead 
to crash
+          // if it's corrupt.
+          LOG(ERROR) << msg << ": " << desc_tbl_->DebugString();
+          start_finstances_status = Status(msg);
+          goto error;
+        }
+      }
+    }
+  }
 
   start_finstances_status = FragmentState::CreateFragmentStateMap(
       fragment_info_, exec_rpc_params_, this, fragment_state_map_);

Reply via email to