Repository navigation
Direct snapshot creation - #5061
Conversation
4fb9d27 to
1e9ab57
Compare
timvisee
left a comment
There was a problem hiding this comment.
Thanks!
While reviewing I did my very best to ensure both implementations are equal, but some parts are hard to track so I hope I didn't miss anything. In any case, the new implementation looks a lot better without the intermediate archive.
I did some local testing and manually compared a snapshot created with and without this PR. Both seem exactly the same to the eye in terms of contents. The snapshot created with this PR is a bit smaller. 👍
I did notice a . directory having no contents when creating a snapshot before this PR. Not quite sure why that was there.
| )) | ||
| })?; | ||
| let shard_snapshot_path = | ||
| shard_versioning::versioned_shard_path(Path::new(""), *shard_id, 0); |
There was a problem hiding this comment.
I'm a bit confused on this empty path string, could you elaborate?
There was a problem hiding this comment.
The following approach is frequently encountered in our codebase: XXX_path(base_path: &Path, YYY) is defined as base_path.join(something(YYY)).
If I need only the something(YYY) part, but not the base_path.join(…) part, I pass base_path to be an empty path, i.e. XXX_path(Path::new(""), YYY).
This includes versioned_shard_path:
qdrant/lib/collection/src/shards/shard_versioning.rs
Lines 47 to 57 in 9fa8610
I need only
{shard_id}-{version} here.
1e9ab57 to
72d5300
Compare
This PR updates the snapshot creation logic.
Previously, the snapshot were created in two steps: (1) put files into a temporary directory, then (2) put this directory contents into an archive.
In this PR, the snapshot is written directly into an archive without an intermediate step.
Follow-up for #4943.