Skip to content

Fix mmless ingestion and index tasks#15372

Merged
georgew5656 merged 3 commits intoapache:masterfrom
georgew5656:fixIndexTask
Nov 28, 2023
Merged

Fix mmless ingestion and index tasks#15372
georgew5656 merged 3 commits intoapache:masterfrom
georgew5656:fixIndexTask

Conversation

@georgew5656
Copy link
Contributor

@georgew5656 georgew5656 commented Nov 14, 2023

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
  • IndexTask
  • ParallelIndexSupervisorTask

This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • [ X ] been tested in a test Druid cluster.

null,
0,
false
).cleanUp(null, null);
Copy link
Contributor

@cryptoe cryptoe Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@georgew5656 georgew5656 requested a review from cryptoe November 15, 2023 19:15
@Test
public void testCleanupIndexTask() throws Exception
{
new IndexTask(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you mention in a comment that since taskLockBox is empty, we would throw a NPE if shouldCleanUp is true.

@georgew5656 georgew5656 merged commit 3d1d26f into apache:master 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
@LakshSingla LakshSingla added this to the 29.0.0 milestone Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants