fix: spurious bug during compaction#1829
Merged
eddyxu merged 1 commit intolance-format:mainfrom Jan 14, 2024
Merged
Conversation
eddyxu
approved these changes
Jan 14, 2024
wjones127
reviewed
Jan 15, 2024
| scanner.with_fragments(fragments.clone()).with_row_id(); | ||
| scanner | ||
| .with_fragments(fragments.clone()) | ||
| .scan_in_order(true) |
Contributor
There was a problem hiding this comment.
I'm not sure this impacts the bug, but I should point out that scan_in_order guarantees that results will be in order of local row ids, but not in order of fragment ids. This is because the fragment list in the manifest is not guaranteed to be sorted by row_id. You should be able to force a scan to be globally sorted by row_id by passing in the .fragments() parameter with the list of fragments sorted by fragment id.
eddyxu
pushed a commit
that referenced
this pull request
Jan 16, 2024
During compaction we read in the row ids so we can use them for remapping. We read the row ids into a tree map which is most efficient if we can read them in order and the current code is in fact assuming that the row ids arrive in order. However, we weren't actually scanning in order and this could lead to failures during compaction.
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
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.
During compaction we read in the row ids so we can use them for remapping. We read the row ids into a tree map which is most efficient if we can read them in order and the current code is in fact assuming that the row ids arrive in order. However, we weren't actually scanning in order and this could lead to failures during compaction.