You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/03/15 01:07:00 UTC

[jira] [Commented] (IMPALA-10565) Validate max_spilled_result_spooling_mem against scratch_limit

    [ https://issues.apache.org/jira/browse/IMPALA-10565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17301304#comment-17301304 ] 

ASF subversion and git services commented on IMPALA-10565:
----------------------------------------------------------

Commit 47219ec3663fa8e27ea16b826425b139c94580da in impala's branch refs/heads/master from Riza Suminto
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=47219ec ]

IMPALA-10565: Adjust result spooling memory based on scratch_limit

IMPALA-9856 enables result spooling by default. Result spooling depends
on the ability to spill its entire BufferedTupleStream to disk once it
hits maximum memory reservation. However, if the query option
scratch_limit is set lower than max_spilled_result_spooling_mem, the
query might fail in the middle of execution due to insufficient scratch
space. This patch adds planner change to consider scratch_limit and
scratch_dirs query option when computing resource used by result
spooling. The algorithm is as follow:

* If scratch_dirs is empty or scratch_limit < minMemReservationBytes
  required to use BufferedPlanRootSink, we set spool_query_results to
  false and fallback to use BlockingPlanRootSink.

* If scratch_limit > minMemReservationBytes but still fairly low, we
  lower the max_result_spooling_mem (default is 100MB) and
  max_spilled_result_spooling_mem (default is 1GB) to fit scratch_limit.

* if scratch_limit > max_spilled_result_spooling_mem, do nothing.

Testing:
- Add TestScratchLimit::test_result_spooling_and_varying_scratch_limit
- Verify that spool_query_results query option is disabled in
  TestScratchDir::test_no_dirs
- Pass exhaustive tests.

Change-Id: I541f46e6911694e14c0fc25be1a6982fd929d3a9
Reviewed-on: http://gerrit.cloudera.org:8080/17166
Reviewed-by: Aman Sinha <am...@cloudera.com>
Tested-by: Aman Sinha <am...@cloudera.com>


> Validate max_spilled_result_spooling_mem against scratch_limit
> --------------------------------------------------------------
>
>                 Key: IMPALA-10565
>                 URL: https://issues.apache.org/jira/browse/IMPALA-10565
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 4.0
>            Reporter: Riza Suminto
>            Assignee: Riza Suminto
>            Priority: Major
>
> IMPALA-9856 enable result spooling by default. However, if query option scratch_limit is set lower than the default max_spilled_result_spooling_mem, the query might fail in the middle of execution due to insufficient scratch space.
> This is shown in intermittent failure of TestScratchLimit::test_with_zero_scratch_limit_no_memory_limit:
> {code:java}
> E   ImpalaBeeswaxException: ImpalaBeeswaxException:
> E    INNER EXCEPTION: <class 'beeswaxd.ttypes.BeeswaxException'>
> E    MESSAGE: Memory limit exceeded: Could not free memory by spilling to disk: scratch_limit is 0
> E   Error occurred on backend impala-ec2-centos74-m5-4xlarge-ondemand-1827.vpc.cloudera.com:27000 by fragment 6f44a34948c173dd:a1a63d8000000000
> E   Memory left in process limit: 8.69 GB
> E   Query(6f44a34948c173dd:a1a63d8000000000): Reservation=100.00 MB ReservationLimit=9.60 GB OtherMemory=14.25 MB Total=114.25 MB Peak=114.25 MB
> E     Fragment 6f44a34948c173dd:a1a63d8000000000: Reservation=100.00 MB OtherMemory=14.25 MB Total=114.25 MB Peak=114.25 MB
> E       EXCHANGE_NODE (id=2): Reservation=14.23 MB OtherMemory=0 Total=14.23 MB Peak=14.32 MB
> E         KrpcDeferredRpcs: Total=0 Peak=90.53 KB
> E       PLAN_ROOT_SINK: Reservation=100.00 MB ReservationLimit=100.00 MB OtherMemory=8.00 KB Total=100.01 MB Peak=100.01 MB
> E     CodeGen: Total=263.00 B Peak=387.00 KB{code}
>  Before the query run, we need to validate that max_spilled_result_spooling_mem <= scratch_limit.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org