You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by bo...@apache.org on 2026/05/15 12:53:56 UTC

(impala) 02/02: IMPALA-14992: Deflake test_cancelled_nodes_in_exec_summary

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

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

commit f927e8e77320f09c0e3e3995d674e249d55a2196
Author: stiga-huang <hu...@gmail.com>
AuthorDate: Fri May 15 14:37:53 2026 +0800

    IMPALA-14992: Deflake test_cancelled_nodes_in_exec_summary
    
    The failed query has 3 scan nodes:
      with l as (
        select * from tpch.lineitem UNION ALL select * from tpch.lineitem
      )
      select STRAIGHT_JOIN count(*) from
        (select * from tpch.lineitem a LIMIT 1) a
      join
        (select * from l LIMIT 125000) b
      on a.l_orderkey = -b.l_orderkey;
    
    The test expects the two scan nodes under UNION have the CANCELLED
    marker and the other scan node on "tpch.lineitem a LIMIT 1" can complete
    so won't have the CANCELLED marker. However, "LIMIT 1" is also applied
    to the ExchangeNode on top of that scan, and the ExchangeNode is the
    leaf of the coordinator fragment:
    
      F01:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
      ...
      06:EXCHANGE [UNPARTITIONED]
      |  limit: 1
      |  in pipelines: 00(GETNEXT)
      |
      F00:PLAN FRAGMENT [RANDOM] hosts=3 instances=3
      00:SCAN HDFS [tpch.lineitem a, RANDOM]
         HDFS partitions=1/1 files=1 size=718.94MB
         ...
         limit: 1
    
    There are 3 scan node instances for this HdfsScanNode. Any of them
    returns a row leads the coordinator to mark the query as finished and
    cancels all running fragment instances, which might cancel the other 2
    scan node instances. Usually they finish quickly since they have limit=1
    so won't be cancelled. The test is flaky when the cluster is busy so
    those scan node instances run slow.
    
    This patch deflakes the test by not using "LIMIT 1" on the scan to
    ensure it can finish.
    
    Testing
     - Ran the test 1000 times.
    
    Change-Id: I00d0b81051c864f76060ae7ebcafb635da37ab1e
    Reviewed-on: http://gerrit.cloudera.org:8080/24306
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Reviewed-by: Surya Hebbar <sh...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 tests/query_test/test_observability.py | 33 ++++++++++++++++++---------------
 1 file changed, 18 insertions(+), 15 deletions(-)

diff --git a/tests/query_test/test_observability.py b/tests/query_test/test_observability.py
index d1e190d76..6fe956979 100644
--- a/tests/query_test/test_observability.py
+++ b/tests/query_test/test_observability.py
@@ -190,7 +190,7 @@ class TestObservability(ImpalaTestSuite):
     query = """
         with l as (select * from tpch.lineitem UNION ALL select * from tpch.lineitem)
         select STRAIGHT_JOIN count(*) from
-          (select * from tpch.lineitem a LIMIT 1) a
+          (select * from tpch.lineitem a where l_orderkey = 1) a
         join
           (select * from l LIMIT 125000) b
         on a.l_orderkey = -b.l_orderkey"""
@@ -198,27 +198,30 @@ class TestObservability(ImpalaTestSuite):
     # ExecSummary:
     # Operator                   #Rows  Est. #Rows  Detail
     # -----------------------------------------------------------------------
-    # F01:ROOT
-    # 05:AGGREGATE                   1           1  FINALIZE
-    # 04:HASH JOIN                   0           1  INNER JOIN, BROADCAST
-    # |--08:EXCHANGE           125.00K     125.00K  UNPARTITIONED
-    # |  F05:EXCHANGE SENDER
-    # |  07:EXCHANGE           125.00K     125.00K  UNPARTITIONED
+    # F06:ROOT
+    # 10:AGGREGATE                   1           1  FINALIZE
+    # 09:EXCHANGE                    3           3  UNPARTITIONED
+    # F05:EXCHANGE SENDER
+    # 05:AGGREGATE                   3           3
+    # 04:HASH JOIN                   0           4  INNER JOIN, PARTITIONED
+    # |--08:EXCHANGE           125.00K     125.00K  HASH(-1 * l_orderkey)
     # |  F04:EXCHANGE SENDER
+    # |  06:EXCHANGE           125.00K     125.00K  UNPARTITIONED
+    # |  F03:EXCHANGE SENDER
     # |  01:UNION              375.00K     125.00K
     # |  |--03:SCAN HDFS             0       6.00M  tpch.lineitem, CANCELLED
     # |  02:SCAN HDFS          377.86K       6.00M  tpch.lineitem, CANCELLED
-    # 06:EXCHANGE                    1           1  UNPARTITIONED
+    # 07:EXCHANGE                    6           4  HASH(a.l_orderkey)
     # F00:EXCHANGE SENDER
-    # 00:SCAN HDFS                   3           1  tpch.lineitem a
-    assert result.exec_summary[8]['operator'] == '03:' + scan_op, result.runtime_profile
-    assert result.exec_summary[8]['detail'] == 'tpch.lineitem, CANCELLED', \
+    # 00:SCAN HDFS                   6           4  tpch.lineitem a
+    assert result.exec_summary[11]['operator'] == '03:' + scan_op, result.runtime_profile
+    assert result.exec_summary[11]['detail'] == 'tpch.lineitem, CANCELLED', \
         result.runtime_profile
-    assert result.exec_summary[9]['operator'] == '02:' + scan_op, result.runtime_profile
-    assert result.exec_summary[9]['detail'] == 'tpch.lineitem, CANCELLED', \
+    assert result.exec_summary[12]['operator'] == '02:' + scan_op, result.runtime_profile
+    assert result.exec_summary[12]['detail'] == 'tpch.lineitem, CANCELLED', \
         result.runtime_profile
-    assert result.exec_summary[12]['operator'] == '00:' + scan_op, result.runtime_profile
-    assert result.exec_summary[12]['detail'] == 'tpch.lineitem a', result.runtime_profile
+    assert result.exec_summary[15]['operator'] == '00:' + scan_op, result.runtime_profile
+    assert result.exec_summary[15]['detail'] == 'tpch.lineitem a', result.runtime_profile
 
     # Test on other node types
     query = """