Zoltán Borók-Nagy created IMPALA-15857:
------------------------------------------
Summary: COMPUTE_PROCESSING_COST fails with "/ by zero" in a
coordinator-only request pool
Key: IMPALA-15857
URL: https://issues.apache.org/jira/browse/IMPALA-15857
Project: IMPALA
Issue Type: Bug
Components: Frontend
Reporter: Zoltán Borók-Nagy
When REQUEST_POOL names a pool with onlyCoordinators set to true,
Frontend.getTExecRequest() replaces the executor group sets with one empty
TExecutorGroupSet. setupThresholdsForExecutorGroupSets() treats it as a default
group with no executors and sets its curr_num_executors to
expected_num_executors, which is also 0, so expectedNumExecutor() and
expectedTotalCores() both return 0. With COMPUTE_PROCESSING_COST=true,
getTExecRequest() then sets the available cores per node to
lastExecutorGroupTotalCores / expectedNumExecutor(group_set), the integer
division 0 / 0, and planning fails with "ArithmeticException: / by zero". The
division runs before the plan is created, so EXPLAIN fails too. Without
COMPUTE_PROCESSING_COST the cores per node come from MT_DOP and the query plans.
Example on master: start the cluster with fair-scheduler-onlycoords.xml and
llama-site-onlycoords.xml, as
TestAdmissionController.test_coord_only_pool_happy_path does, and run:
{code:sql}
set request_pool=onlycoords;
set compute_processing_cost=true;
select count(*) from functional.alltypes;
{code}
None of the coordinator-only pool tests sets COMPUTE_PROCESSING_COST.
Fix: divide by Math.max(1, expectedNumExecutor(group_set)). The total core
count of this group set is 0, so the cores per node then fall back to
PROCESSING_COST_MIN_THREADS, as for any group set with fewer cores per node
than that. Add a planner test that plans in this pool with
COMPUTE_PROCESSING_COST=true.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)