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 segment deletes triggered by DropRules #14559

Closed
wants to merge 3 commits into from

Conversation

kfaraz
Copy link
Contributor

@kfaraz kfaraz commented Jul 9, 2023

If several segments become eligible for a DropRule in a single coordinator run, multiple metadata update statements are fired which could have potentially been batched.

Changes:

  • Collect segment delete operations in StrategicSegmentAssigner during RunRules duty
  • Perform batch delete for each datasource at the end of RunRules duty
  • Move collection of some stats from CollectSegmentAndServerStats to the respective duties generating those stats for clarity
  • Clean up SqlSegmentsMetadataQuery API for marking segments as used/unused
  • Add basic simulation test for Coordinator runs
  • Add simulation test to verify that segment moves are cancelled if the target server disappears

Classes to review:

  • DruidCoordinator
  • CollectSegmentAndServerStats
  • StrategicSegmentAssigner
  • RunRules

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.

@kfaraz
Copy link
Contributor Author

kfaraz commented Jul 16, 2023

Batching doesn't seem to mitigate the problem either as the real problem here is contention while acquiring a connection. I guess we should perform the deletes asynchronously. I will update this PR accordingly.

@kfaraz
Copy link
Contributor Author

kfaraz commented Jul 27, 2023

Closing this in favor of #14644 .

@kfaraz kfaraz closed this Jul 27, 2023
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.

1 participant