-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for OOM in the Tombstone generating logic in MSQ #13893
Conversation
...vice/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/TombstoneHelper.java
Outdated
Show resolved
Hide resolved
@@ -147,7 +147,7 @@ public void tombstoneIntervalsCreatedForReplaceWhenReplaceIsContainedInUsedInter | |||
replaceGranularity | |||
); | |||
Assert.assertEquals( | |||
ImmutableSet.of(Intervals.of("2020-03-05/2020-03-06"), Intervals.of("2020-03-06/2020-03-07")), | |||
ImmutableSet.of(Intervals.of("2020-03-05/2020-03-07")), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the tests complete? That is, do we have, say replace a day into ALL?
Replace a day into YEAR with:
- Day as Jan 1. (I.e. one tombstone on the right)
- Day as Feb. 1. (Two tombstones)
- Day as Dec. 31. (One tombstone on the left)
Do we have a case for the non-aligned case? Original is month, target is week. (Although, I know we don't want to support week. It is still a useful non-aligned test case.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, the aligned test cases were there. Added a few test cases with the abovementioned criteria, and added the case which would have caused OOM earlier.
…n/task/batch/parallel/TombstoneHelper.java Co-authored-by: Paul Rogers <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! LGTM.
fix OOMs using a different logic for generating tombstones --------- Co-authored-by: Paul Rogers <[email protected]>
While generating tombstones for MSQ (#13706) the controller might run into OOM while trying to compute the intervals for which the tombstones need to be generated because we are materializing all the intervals which need to be marked by a tombstone, partitioned by granularity. So for a query that replaces over all, and the existing data source contains a segment for the eternity, this would generate a large number of intervals (given a finite granularity such as DAY).
This PR changes the behavior of the tombstones generating logic wherein for the overlap, we only generate completely disjointed tombstones so that the number of intervals for which tombstones need to be generated do not explode.
Release note
(none)
Key changed/added classes in this PR
TombstoneHelper
TombstoneHelperTest
This PR has: