This is an automated email from the ASF dual-hosted git repository.
dbecker 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 967ed1840 IMPALA-12528: Deflake
test_hdfs_scanner_thread_non_reserved_bytes
967ed1840 is described below
commit 967ed184074ac82bf0fe1ef78c12cfee4ededc38
Author: Riza Suminto <[email protected]>
AuthorDate: Tue Oct 31 14:20:16 2023 -0700
IMPALA-12528: Deflake test_hdfs_scanner_thread_non_reserved_bytes
Prior deflake attempt at IMPALA-12499 does not seem sufficient. There
are still sporadic failures happening in
test_hdfs_scanner_thread_non_reserved_bytes. This patch further attempt
to deflake it by:
- Injecting 100ms sleep every time scanner thread obtain new scan range.
- Running it serially.
- Skip it in dockerized environment.
This patch also fix small comment mistakes in hdfs-scan-node.cc.
Testing:
- Loop and pass the test 100 times in local minicluster environment.
Change-Id: I5715cf16c87ff0de51afd2fa778c5b591409d376
Reviewed-on: http://gerrit.cloudera.org:8080/20640
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
be/src/exec/hdfs-scan-node.cc | 4 +++-
.../queries/QueryTest/hdfs-scanner-thread-non-reserved-bytes.test | 3 +++
tests/common/skip.py | 2 ++
tests/query_test/test_mem_usage_scaling.py | 8 +++++++-
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/be/src/exec/hdfs-scan-node.cc b/be/src/exec/hdfs-scan-node.cc
index 0c23ecbe4..37ee1350c 100644
--- a/be/src/exec/hdfs-scan-node.cc
+++ b/be/src/exec/hdfs-scan-node.cc
@@ -261,7 +261,7 @@ void
HdfsScanNode::ThreadTokenAvailableCb(ThreadResourcePool* pool) {
// 3. Don't start up if the number of ranges left is less than the number of
// active scanner threads.
// 4. Don't start up if no initial ranges have been issued (see
IMPALA-1722).
- // 5. Don't start up a ScannerThread if the row batch queue is not full
since
+ // 5. Don't start up a ScannerThread if the row batch queue is full since
// we are not scanner bound.
// 6. Don't start up a thread if there is not enough memory available for
the
// estimated memory consumption (include reservation and non-reserved
memory).
@@ -416,6 +416,8 @@ void HdfsScanNode::ScannerThread(bool first_thread, int64_t
scanner_thread_reser
break;
}
if (scan_range != nullptr) {
+ discard_result(DebugAction(
+ runtime_state_->query_options(),
"HDFS_SCANNER_THREAD_OBTAINED_RANGE"));
// Got a scan range. Process the range end to end (in this thread).
ProcessSplit(filter_status.ok() ? filter_ctxs : vector<FilterContext>(),
&expr_results_pool, scan_range, &scanner_thread_reservation);
diff --git
a/testdata/workloads/functional-query/queries/QueryTest/hdfs-scanner-thread-non-reserved-bytes.test
b/testdata/workloads/functional-query/queries/QueryTest/hdfs-scanner-thread-non-reserved-bytes.test
index f333209ed..5e2b61bee 100644
---
a/testdata/workloads/functional-query/queries/QueryTest/hdfs-scanner-thread-non-reserved-bytes.test
+++
b/testdata/workloads/functional-query/queries/QueryTest/hdfs-scanner-thread-non-reserved-bytes.test
@@ -4,6 +4,7 @@
# up to 3 threads (compressed_text_est_bytes ~ 211MB).
set num_nodes=1;
set mem_limit=750m;
+set debug_action="HDFS_SCANNER_THREAD_OBTAINED_RANGE:SLEEP@100";
select count(*) from tpch_text_gzip.lineitem where l_comment = 'telets.
quickly ';
---- RESULTS:
4
@@ -15,6 +16,7 @@ aggregation(SUM, NumScannerThreadsStarted): 3
# will reduce NumScannerThreadsStarted.
set num_nodes=1;
set mem_limit=750m;
+set debug_action="HDFS_SCANNER_THREAD_OBTAINED_RANGE:SLEEP@100";
set hdfs_scanner_non_reserved_bytes=320m;
select count(*) from tpch_text_gzip.lineitem where l_comment = 'telets.
quickly ';
---- RESULTS:
@@ -27,6 +29,7 @@ aggregation(SUM, NumScannerThreadsStarted): 2
# thread.
set num_nodes=1;
set mem_limit=750m;
+set debug_action="HDFS_SCANNER_THREAD_OBTAINED_RANGE:SLEEP@100";
set hdfs_scanner_non_reserved_bytes=2g;
select count(*) from tpch_text_gzip.lineitem where l_comment = 'telets.
quickly ';
---- RESULTS:
diff --git a/tests/common/skip.py b/tests/common/skip.py
index a5980d5e9..51dcdcf6e 100644
--- a/tests/common/skip.py
+++ b/tests/common/skip.py
@@ -179,6 +179,8 @@ class SkipIfDockerizedCluster:
reason="IMPALA-8384: insert ACL tests are broken on dockerised
minicluster.")
insufficient_mem_limit = pytest.mark.skipif(
IS_DOCKERIZED_TEST_CLUSTER, reason="Test require high per-process
mem_limit.")
+ runs_slowly = pytest.mark.skipif(
+ IS_DOCKERIZED_TEST_CLUSTER, reason="Dockerized env too slow for test.")
jira = partial(pytest.mark.skipif, IS_DOCKERIZED_TEST_CLUSTER)
diff --git a/tests/query_test/test_mem_usage_scaling.py
b/tests/query_test/test_mem_usage_scaling.py
index edf13ba3f..180f515ef 100644
--- a/tests/query_test/test_mem_usage_scaling.py
+++ b/tests/query_test/test_mem_usage_scaling.py
@@ -26,7 +26,11 @@ from tests.common.test_dimensions import
(create_avro_snappy_dimension,
create_parquet_dimension)
from tests.common.impala_cluster import ImpalaCluster
from tests.common.impala_test_suite import ImpalaTestSuite
-from tests.common.skip import SkipIfNotHdfsMinicluster, SkipIfFS, SkipIf
+from tests.common.skip import (
+ SkipIfNotHdfsMinicluster,
+ SkipIfFS,
+ SkipIf,
+ SkipIfDockerizedCluster)
from tests.common.test_dimensions import create_single_exec_option_dimension
from tests.common.test_vector import ImpalaTestDimension
from tests.verifiers.metric_verifier import MetricVerifier
@@ -376,6 +380,8 @@ class TestScanMemLimit(ImpalaTestSuite):
self.run_test_case('QueryTest/hdfs-scanner-thread-mem-scaling', vector)
@SkipIf.runs_slowly
+ @SkipIfDockerizedCluster.runs_slowly
+ @pytest.mark.execute_serially
def test_hdfs_scanner_thread_non_reserved_bytes(self, vector):
"""Test that HDFS_SCANNER_NON_RESERVED_BYTES can limit the scale up of
scanner threads
properly."""