This is an automated email from the ASF dual-hosted git repository. joemcdonnell pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit 4d9612f514183c239ea43d179b569eb6649d30fa Author: Riza Suminto <[email protected]> AuthorDate: Sat May 24 18:56:26 2025 -0700 IMPALA-14097: Fix test_log_fragments.py test_log_fragments.py broken after HS2 switch in IMPALA-13916. The test look for log line from ImpalaServer::QueryToTQueryContext in impala-beeswax-server.cc. VLOG_QUERY << "query: " << ThriftDebugString(query); This log line does not appear when using HS2 protocol. The equivalent log line in impala-hs2-server.cc is in ImpalaServer::ExecuteStatement VLOG_QUERY << "ExecuteStatement(): request=" << ... This patch also remove redundant TExecuteStatementReq logging in ImpalaServer::TExecuteStatementReqToTQueryContext. Either of ImpalaServer::ExecuteStatement or ImpalaServer::ExecutePlannedStatement has log the same TExecuteStatementReq already. Testing: - Run and pass test_log_fragments.py by itself. Change-Id: I93e1fb6c7ba50f47023ca0c382a884093187b847 Reviewed-on: http://gerrit.cloudera.org:8080/22947 Reviewed-by: Quanlong Huang <[email protected]> Tested-by: Impala Public Jenkins <[email protected]> --- be/src/service/impala-hs2-server.cc | 1 - tests/observability/test_log_fragments.py | 26 +++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/be/src/service/impala-hs2-server.cc b/be/src/service/impala-hs2-server.cc index c18e83a86..fe52c9cbf 100644 --- a/be/src/service/impala-hs2-server.cc +++ b/be/src/service/impala-hs2-server.cc @@ -256,7 +256,6 @@ Status ImpalaServer::FetchInternal(const TUniqueId& query_id, SessionState* sess Status ImpalaServer::TExecuteStatementReqToTQueryContext( const TExecuteStatementReq execute_request, TQueryCtx* query_ctx) { query_ctx->client_request.stmt = execute_request.statement; - VLOG_QUERY << "TExecuteStatementReq: " << RedactedDebugString(execute_request); QueryOptionsMask set_query_options_mask; { shared_ptr<SessionState> session_state; diff --git a/tests/observability/test_log_fragments.py b/tests/observability/test_log_fragments.py index f1172efad..28451c36c 100644 --- a/tests/observability/test_log_fragments.py +++ b/tests/observability/test_log_fragments.py @@ -16,12 +16,11 @@ # under the License. from __future__ import absolute_import, division, print_function +import re + from tests.common.impala_test_suite import ImpalaTestSuite from tests.common.skip import SkipIfDockerizedCluster -import re -import time - class TestLogFragments(ImpalaTestSuite): """Checks that logging includes query/fragment ids when available.""" @@ -37,24 +36,25 @@ class TestLogFragments(ImpalaTestSuite): """ # This query produces more than one fragment when there # is more than one impalad running. - result = self.execute_query("select count(*) from functional.alltypes") + result = self.hs2_client.execute("select count(*) from functional.alltypes") query_id = re.search("id=([0-9a-f]+:[0-9a-f]+)", result.runtime_profile).groups()[0] - self.execute_query("select 1") - self.assert_impalad_log_contains('INFO', query_id + - "] Analysis and authorization finished.") + self.hs2_client.execute("select 1") + self.assert_impalad_log_contains( + 'INFO', query_id + "] Analysis and authorization finished.") assert query_id.endswith("000") # Looks for a fragment instance that doesn't end with "0" to make sure instances # are getting propagated too. - self.assert_impalad_log_contains('INFO', - query_id[:-1] + "[1-9]" + "] Instance completed") + self.assert_impalad_log_contains( + 'INFO', query_id[:-1] + "[1-9]" + "] Instance completed") # This log entry should exist (many times), but not be tagged - self.assert_impalad_log_contains('INFO', - "impala-beeswax-server.cc:[0-9]+\] query: Query", -1) + self.assert_impalad_log_contains( + 'INFO', r"impala-hs2-server.cc:[0-9]+\] ExecuteStatement\(\): request", -1) # Check that the version with the query_id doesn't exist! try: - self.assert_impalad_log_contains('INFO', - "impala-beeswax-server.*" + query_id + "].*query: Query") + self.assert_impalad_log_contains( + 'INFO', + r"impala-hs2-server.*" + query_id + r"].*ExecuteStatement\(\): request") raise Exception("query-id still attached to thread after query finished") except AssertionError: pass
