Fix mmless ingestion and index tasks#15372
Merged
georgew5656 merged 3 commits intoapache:masterfrom Nov 28, 2023
Merged
Conversation
cryptoe
reviewed
Nov 15, 2023
| null, | ||
| 0, | ||
| false | ||
| ).cleanUp(null, null); |
Contributor
There was a problem hiding this comment.
What do these tests check ?
I would expect a EasyMock here where the IndexTask method cleanup is called but AbtractBatchTaskMethod clean up is not called.
Contributor
Author
There was a problem hiding this comment.
the tests are checking the shouldCleanup variable. I couldn't think of a way to mock the AbstractBatchTask.cleanup method only so I just treat the lack of a exception as the test succeeding, do you have a better idea?
cryptoe
reviewed
Nov 15, 2023
...n/java/org/apache/druid/indexing/common/task/batch/parallel/ParallelIndexSupervisorTask.java
Show resolved
Hide resolved
cryptoe
reviewed
Nov 28, 2023
| @Test | ||
| public void testCleanupIndexTask() throws Exception | ||
| { | ||
| new IndexTask( |
Contributor
There was a problem hiding this comment.
Could you mention in a comment that since taskLockBox is empty, we would throw a NPE if shouldCleanUp is true.
cryptoe
approved these changes
Nov 28, 2023
yashdeep97
pushed a commit
to yashdeep97/druid
that referenced
this pull request
Dec 1, 2023
* Fix mmless ingestion and index tasks * Move comment * remove dup test
yashdeep97
pushed a commit
to yashdeep97/druid
that referenced
this pull request
Dec 1, 2023
* Fix mmless ingestion and index tasks * Move comment * remove dup test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Currently, AbstractTask.cleanup is run twice when running a small index_parallel task with mmless ingestion because the ParallelIndexSupervisorTask statically creates a IndexTask and call .run() on it in its own .run() implementation.
Since both ParallelIndexSupervisorTask and IndexTask both subclass AbstractTask, they both get .cleanup called in their .run implementation. Because of this, task reports get uploaded twice (once by the IndexTask and once by the ParallelIndexSupervisorTask). This is not technically a issue if using S3 deep storage since ParallelIndexSupervisorTask gets its task status from IndexTask and S3 just does a no-op overwrite of the report, but this seems weird and practice and causes issues in Azure deep storage since it doesn't support overwriting by default.
Fixed the bug ...
Renamed the class ...
Added a forbidden-apis entry ...
When creating the IndexTask, set shouldCleanup to false. Cleanup is handled by the parent task.
Release note
Fix cleanup bug with index tasks and mmless ingestion.
Key changed/added classes in this PR
IndexTaskParallelIndexSupervisorTaskThis PR has: