Repository navigation
Switch to sparse tar implementation - #4943
Merged
Merged
Conversation
timvisee
approved these changes
Aug 26, 2024
timvisee
left a comment
Member
There was a problem hiding this comment.
Great results. Thanks!
Please see my review comment before merging.
xzfc
force-pushed
the
enable-sparse-tar
branch
from
September 10, 2024 13:29
9fcfcde to
7c0bfa7
Compare
xzfc
force-pushed
the
enable-sparse-tar
branch
from
September 10, 2024 13:34
7c0bfa7 to
952fc7a
Compare
timvisee
pushed a commit
that referenced
this pull request
Sep 17, 2024
Merged
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.
This PR enables sparse tar implementation from our
tar-rsfork.It provides two main benefits:
How it works
When you create an empty file and set it size, but do not explicitly write bytes into it, the file will be filled with zeroes. The modern filesystems do not store these zeroes. Instead, they efficiently store ranges of zeroed blocks as "holes".
Qdrant uses sparse files extensively. In particular, empty collections have a high sparse-to-dense ratio. For example, WAL1 files by default are 32MiB filled with zeroes. Or any storage file created by
create_and_ensure_length()is sparse.If we naively copy these files bytewise, we'll lose their sparseness, blowing their size. In my branch of
tar-rsI've madetar::Builderto properly store the sparseness of files. Upstream PR: composefs/tar-rs#375Comparison for empty collection
du -sh)du -sh --apparent-size)Footnotes
Arguably, we don't even need to put the whole WAL into a snapshot. As @generall explained, we need to story only the last sequence ID, an could potentially optimize it away. But it's out of the scope of this PR. ↩