Repository navigation
Conversation
The circular-pushdown guard in CalciteLogicalIndexScan.pushDownProject compared the new field-name list against pushdown digests, but project digests have been ProjectDigest records since opensearch-project#4992, so the guard never fired. Stacked stats with dc() then looped in the Volcano planner until the node ran out of heap. Match on ProjectDigest names instead. Resolves opensearch-project#6007 Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Planner rules that don't converge loop until the node runs out of heap, and planning can't be cancelled (opensearch-project#6007, opensearch-project#5966). Count Volcano rule calls per query with a RelOptListener and stop at plugins.calcite.planner.rule_call_limit (default 100000, 0 disables). plugins.calcite.planner.rule_call_limit_enforcement picks what happens: truncate (default) raises the planner's CancelFlag so Volcano keeps the cheapest plan found so far; reject fails the query with a 400 RESOURCE_LIMIT_EXCEEDED that names the setting. The scope lives on CalcitePlanContext because prepareStatement reuses the planner the context creates. Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
With an aggregate pushed and offset > 0, pushDownLimit keeps the sort above the new scan, so LimitIndexScanRule matched it again and pushed the same limit forever. The scan digest grows with every pass, so the node ran out of heap before the rule call limit tripped (`stats avg(l) as a1 | head 1 from 1`). Apply the existing same-limit-on-top guard to the aggregate branch too. Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
Two bugs found by property-based testing (ppl-hegel):
1. An Error thrown by generated query code on the complex worker pool
(ExceptionInInitializerError, e.g. `top 1 l | eval e = floor('')`
where the constant fails to fold) was not caught, so OpenSearch's
uncaught handler exited the node. Catch Throwable there, map it as
QueryService does, and still rethrow VirtualMachineError.
2. `head 1 | head 6 from 2` pushed a negative size into the search
request and failed with 500 "[size] parameter cannot be negative".
Clamp the remaining size at 0, so the query returns no rows.
Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
PR Reviewer Guide 🔍(Review updated until commit 7ea41e2)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 7ea41e2 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit ec8b06c
Suggestions up to commit 8c75dac
Suggestions up to commit 43aa8b9
Suggestions up to commit 61a19f2
|
|
Persistent review updated to latest commit 43aa8b9 |
|
Persistent review updated to latest commit 8c75dac |
8c75dac to
ec8b06c
Compare
|
Persistent review updated to latest commit ec8b06c |
- ThreadPoolExecutionDispatcher: catch only ExceptionInInitializerError and Exception, so other Errors reach the uncaught-exception handler. - Add tests pinning how SysLimit builds the budget: 0 disables, unset settings use the defaults, an invalid enforcement is rejected. Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
ec8b06c to
7ea41e2
Compare
|
Persistent review updated to latest commit 7ea41e2 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #6011 +/- ##
==========================================
Coverage 89.49% 89.49%
- Complexity 12269 12284 +15
==========================================
Files 980 981 +1
Lines 42018 42138 +120
Branches 4836 4855 +19
==========================================
+ Hits 37604 37713 +109
- Misses 2940 2943 +3
- Partials 1474 1482 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Builds on #6008 with 3 more fixes:
stats avg(l) | head 1 from 1hits a loop with limit-offsets and causes OOMtop 1 l | eval e = floor('')cleanly kills the node via the unhandledErrortypeExceptionInInitializerErrorhead 1 | head 6 from 2returned a 500 with[size] parameter cannot be negativeAdditionally, adds settings
plugins.calcite.planner.rule_call_limitandplugins.calcite.planner.rule_call_limit_enforcementwhich can be used to force volcano planning to truncate at a specific point, which will mitigate future impacts of these rule loops. Setting an intentionally low limit withrejectenforcement can help automatically find more rule call bugs.Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
--signoffor-s.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.