-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Track segments consistently for consistent upsert view #13677
Merged
klsince
merged 5 commits into
apache:master
from
klsince:track_segments_consistently_for_upsertview
Aug 16, 2024
Merged
Track segments consistently for consistent upsert view #13677
klsince
merged 5 commits into
apache:master
from
klsince:track_segments_consistently_for_upsertview
Aug 16, 2024
Conversation
This file contains 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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13677 +/- ##
============================================
+ Coverage 61.75% 61.90% +0.14%
+ Complexity 207 198 -9
============================================
Files 2436 2568 +132
Lines 133233 141926 +8693
Branches 20636 22080 +1444
============================================
+ Hits 82274 87854 +5580
- Misses 44911 47368 +2457
- Partials 6048 6704 +656
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d6d7959
to
da3d226
Compare
da3d226
to
742b633
Compare
c6194fc
to
144f15a
Compare
Jackie-Jiang
approved these changes
Aug 15, 2024
6054a70
to
c8f30bd
Compare
extract upsert view related logic to a util class UpsertViewManager
c8f30bd
to
8861396
Compare
rajagopr
pushed a commit
to rajagopr/pinot
that referenced
this pull request
Sep 11, 2024
* track segments consistently for consistent upsert view and * add util class UpsertViewManager * fix a sutble race condition for SNAPSHOT mode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
release-notes
Referenced by PRs that need attention when compiling the next release notes
upsert
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.
Recently, we added support for consistent upsert view by synchronizing between updates on segments' validDocIds bitmaps and queries reading those bitmaps in PR #12976. But from recent tests, we find that's not enough. Other than that, we also need to track segments belonging to a table partition completely and consistently.
The current segment tracking logic for upsert view is broken in those places:
_trackedSegments
is not right to ensure the consistent upsert view, because this Set is updated after the segment is registered to table manager. So query can see a segment before it is included in the upsert view. If so, today, the query falls back to get segment's bitmap outside the locking logic used to ensure consistency;To address those issues
A few other misc fixes
All the new changes in this PR are supposed to be enabled via the new feature flag upsertConfig.consistencyMode added in PR #12976, so upsert tables not using this feature shouldn't be affected.
As to tests: