-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Fix batch segment allocation failure with replicas #17262
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
Merged
kfaraz
merged 1 commit into
apache:master
from
AmatyaAvadhanula:batch_segment_allocation_bug_with_replicas
Oct 7, 2024
Merged
Fix batch segment allocation failure with replicas #17262
kfaraz
merged 1 commit into
apache:master
from
AmatyaAvadhanula:batch_segment_allocation_bug_with_replicas
Oct 7, 2024
Conversation
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
kfaraz
approved these changes
Oct 7, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this, @AmatyaAvadhanula !
@@ -1326,7 +1326,8 @@ public UniqueAllocateRequest( | |||
{ | |||
this.interval = interval; | |||
this.sequenceName = request.getSequenceName(); | |||
this.previousSegmentId = request.getPreviousSegmentId(); | |||
// Even if the previousSegmentId is set, disregard it when skipping lineage check for streaming ingestion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
// Even if the previousSegmentId is set, disregard it when skipping lineage check for streaming ingestion | |
// Even if the previousSegmentId is set, disregard it when skipping lineage check |
...ervice/src/test/java/org/apache/druid/indexing/common/actions/SegmentAllocateActionTest.java
Show resolved
Hide resolved
kfaraz
pushed a commit
to kfaraz/druid
that referenced
this pull request
Oct 7, 2024
Fixes apache#16587 Streaming ingestion tasks operate by allocating segments before ingesting rows. These allocations happen across replicas which may send different requests but must get the same segment id for a given (datasource, interval, version, sequenceName) across replicas. This patch fixes the bug by ignoring the previousSegmentId when skipLineageCheck is true.
kfaraz
added a commit
that referenced
this pull request
Oct 8, 2024
Fixes #16587 Streaming ingestion tasks operate by allocating segments before ingesting rows. These allocations happen across replicas which may send different requests but must get the same segment id for a given (datasource, interval, version, sequenceName) across replicas. This patch fixes the bug by ignoring the previousSegmentId when skipLineageCheck is true. Co-authored-by: AmatyaAvadhanula <amatya.avadhanula@imply.io>
vivek807
pushed a commit
to deep-bi/druid
that referenced
this pull request
Nov 23, 2024
…ache#17267) Fixes apache#16587 Streaming ingestion tasks operate by allocating segments before ingesting rows. These allocations happen across replicas which may send different requests but must get the same segment id for a given (datasource, interval, version, sequenceName) across replicas. This patch fixes the bug by ignoring the previousSegmentId when skipLineageCheck is true. Co-authored-by: AmatyaAvadhanula <amatya.avadhanula@imply.io>
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.
Fixes #16587
Streaming ingestion tasks operate by allocating segments before ingesting rows.
These allocations happen across replicas which may send different requests but must get the same segment id for a given (datasource, interval, version, sequenceName) across replicas.
The previousSegmentId despite being set in the SegmentAllocateAction must play no role in determining the segment id as streaming ingestion works by skipping lineage check.
This PR fixes a bug that arises because the above is not considered while checking for existing allocated segments for a given request.
Alternative approach:
(Perhaps the best solution is to always set previousSegmentId to null when lineage check is being skipped in the SegmentAllocateRequest.)
TODO: cluster testing
This PR has: