You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Yida Wu (Code Review)" <ge...@cloudera.org> on 2022/12/22 17:42:15 UTC

[Impala-ASF-CR] IMPALA-7969: Always admit trivial queries immediately

Yida Wu has uploaded a new patch set (#2). ( http://gerrit.cloudera.org:8080/19214 )

Change subject: IMPALA-7969: Always admit trivial queries immediately
......................................................................

IMPALA-7969: Always admit trivial queries immediately

The idea of trivial query is to allow certain queries to bypass the
admission control, and therefore accelerating the query execution
even when the server resource is at capacity. It could benefit
the queries that require a fast response while consuming the
minimum resources.

This patch adds support for the trivial query detection and allows
an immediate admission for the trivial query. We define the trivial
query as a subset of the coordinator-only query, and returns no more
than one row. The definition is as below:
  - Must have PLAN ROOT SINK as the root
  - Can contain UNION and EMPTYSET nodes only
  - Results can not be over one row

Examples of a trivial query:
  - select 1;
  - select * from table limit 0;
  - select * from table limit 0 union all select 1;
  - select 1, (2 + 3);

Also, we restrict the parallelism of execution of the trivial
query, each resource pool can execute no more than three trivial
queries at the same time. If the maximum parallelism is reached,
the admission controller would try to admit the trivial query
via normal process.

As the first patch, we try to keep the trivial query as simple as
possible, and it might be able to extend in future.

Tests:
Passed exhaustive tests.
Added test_trivial_query and test_trivial_query_low_mem.

Change-Id: I2a729764e3055d7eb11900c96c82ff53eb261f91
---
M be/src/scheduling/admission-controller-test.cc
M be/src/scheduling/admission-controller.cc
M be/src/scheduling/admission-controller.h
M be/src/scheduling/schedule-state.cc
M be/src/scheduling/schedule-state.h
M be/src/service/query-options.cc
M be/src/service/query-options.h
M common/thrift/ImpalaService.thrift
M common/thrift/Query.thrift
M fe/src/main/java/org/apache/impala/planner/Planner.java
A fe/src/main/java/org/apache/impala/planner/TrivialQueryChecker.java
M tests/common/resource_pool_config.py
M tests/custom_cluster/test_admission_controller.py
M tests/custom_cluster/test_session_expiration.py
M tests/custom_cluster/test_shell_interactive.py
15 files changed, 302 insertions(+), 31 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/14/19214/2
-- 
To view, visit http://gerrit.cloudera.org:8080/19214
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2a729764e3055d7eb11900c96c82ff53eb261f91
Gerrit-Change-Number: 19214
Gerrit-PatchSet: 2
Gerrit-Owner: Yida Wu <wy...@gmail.com>
Gerrit-Reviewer: Abhishek Rawat <ar...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>