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

Add new index on datasource and task_allocator_id for pending segments #16355

Conversation

AmatyaAvadhanula
Copy link
Contributor

Adds a new index on (datasource, task_allocator_id) for the druid_pendingSegments table to optimize fetching of pending segments by task_allocator_id for cleanup and transaction append / replace actions.

The index is added on columns that are (mostly) null, and is not expected to hinder the startup of the Overlord.
I have locally tested this out on a pending segments table with > 2M rows and this operation took 2.14s.

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.

Copy link
Contributor

@kfaraz kfaraz left a comment

Choose a reason for hiding this comment

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

Thanks for the changes, @AmatyaAvadhanula !
Since the index is on datasource + taskAllocatorId, the method IndexerMetadataStorageCoordinator.deletePendingSegmentsForTaskAllocatorId() should accept datasource as an argument too.

@kfaraz kfaraz added this to the 30.0.0 milestone Apr 30, 2024
@AmatyaAvadhanula AmatyaAvadhanula merged commit 42e99bf into apache:master Apr 30, 2024
87 checks passed
@AmatyaAvadhanula
Copy link
Contributor Author

Thanks for the review, @kfaraz

AmatyaAvadhanula added a commit to AmatyaAvadhanula/druid that referenced this pull request Apr 30, 2024
apache#16355)

* Add pending segments index on datasource and task_allocator_id

* Use both datasource and task_allocator_id in queries
@kfaraz kfaraz deleted the pending_segment_allocator_index branch April 30, 2024 12:26
AmatyaAvadhanula added a commit that referenced this pull request Apr 30, 2024
#16355) (#16357)

* Add pending segments index on datasource and task_allocator_id

* Use both datasource and task_allocator_id in queries
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.

None yet

2 participants