Skip to content
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

Batch kill in azure #15770

Merged
merged 19 commits into from
Jan 31, 2024
Merged

Batch kill in azure #15770

merged 19 commits into from
Jan 31, 2024

Conversation

georgew5656
Copy link
Contributor

Description

Implement batch kill in azure to speed up segment killing.

I ran a quick test with 50k segments and kill sped up from 35 mins to ~2 minutes.

Fixed the bug ...

Renamed the class ...

Added a forbidden-apis entry ...

I tried to keep this implementation analagous to the S3DataSegmentKiller. I used the azure batch api to do this. One thing I had to do was ignore the descriptor.json files but I think this is okay because those were discontinued in 2019 and the azure extension was made core in 2020. If someone happens to have segments with descriptor.json from that period the descriptor.json will be left in deep storage and have to get killed manually.

I think this is worth it because otherwise I would have to fire off 2x as many batches to azure to delete all the descriptor.json files which generally don't exist. These failed requests also mess up the logs.

Release note

Speed up killing of segments in azure

Key changed/added classes in this PR
  • AzureDataSegmentKiller
  • AzureStorage
  • TheirBaz

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.
  • been tested in a test Druid cluster.

georgew5656 and others added 2 commits January 29, 2024 16:34
…d/storage/azure/AzureDataSegmentKiller.java

Co-authored-by: Suneet Saldanha <suneet@apache.org>
Copy link
Contributor

@suneet-s suneet-s left a comment

Choose a reason for hiding this comment

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

Mostly looks good. 1 clarifying question

);
}

@Test(expected = RuntimeException.class)
Copy link
Contributor

Choose a reason for hiding this comment

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

I tried tracing the code to understand when azureStorage#batchDeleteFiles can throw a runtime exception, but couldn't figure it out. Can you elaborate on when that is possible and why we would want the data segment killer to re-throw the runtime exception instead of wrapping it in a SegmentLoadingException. The interface says a SegmentLoadingException should be thrown if there is an issue with deleting the segments.

Suggested change
@Test(expected = RuntimeException.class)
@Test(expected = SegmentLoadingException.class)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried tracing the code to understand when azureStorage#batchDeleteFiles can throw a runtime exception, but couldn't figure it out. Can you elaborate on when that is possible and why we would want the data segment killer to re-throw the runtime exception instead of wrapping it in a SegmentLoadingException. The interface says a SegmentLoadingException should be thrown if there is an issue with deleting the segments.

it could potentially throw a exception when trying to construct the client (before making the requests to azure), those exceptions would not get caught and should propagate up. it's probably not that common of a scenario though

georgew5656 and others added 3 commits January 30, 2024 19:40
…d/storage/azure/AzureStorageTest.java

Co-authored-by: Suneet Saldanha <suneet@apache.org>
@georgew5656 georgew5656 merged commit 5edfa94 into apache:master Jan 31, 2024
53 checks passed
@adarshsanjeev adarshsanjeev added this to the 30.0.0 milestone May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants