handle segments not tracked by partition mgr and add skipUpsertView query option #13415
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.
The upsert partition manager doesn't necessarily track all segments belonging to a table partition, e.g. segments out of metadata TTL are not tracked. So after getting validDocIds bitmaps from upsert partition managers, we should double check if any segment doesn't get its bitmap.
For segments still missing their validDocIds bitmaps, we use those tracked by the segment objects themselves, as bitmaps from those segments are not updated since loaded anyway, otherwise, they'd be tracked in one partition mgr.
Added a query option
skipUpsertView
to help debug the consistent upsert view feature, or bypass it cleanly in case.Also fixed an issue when a new segment is tracked but didn't update any existing bitmaps, and we should include such segment's bitmap in the upsert snapshot view as well.
Refactored the code to separate the locking logic for different consistency modes more clearly.
=== Release Note ===
a new query option
skipUpsertView
was added in this PR. It's false by default. When setting true for a query, it bypasses the new feature used to provide a consistent data view for the upsert table.