Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/collection/src/shards/remote_shard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ impl RemoteShard {
shard_id: ShardId,
url: &Url,
snapshot_priority: SnapshotPriority,
checksum: Option<String>,
api_key: Option<&str>,
) -> CollectionResult<RecoverSnapshotResponse> {
let res = self
Expand All @@ -938,7 +939,7 @@ impl RemoteShard {
snapshot_priority: api::grpc::qdrant::ShardSnapshotPriority::from(
snapshot_priority,
) as i32,
checksum: None,
checksum,
api_key: api_key.map(Into::into),
})
.await
Expand Down
4 changes: 4 additions & 0 deletions lib/collection/src/shards/transfer/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ pub(super) async fn transfer_snapshot(

let mut snapshot_temp_paths = Vec::new();
let mut shard_download_url = local_rest_address;
let mut snapshot_checksum = None;

let encoded_collection_name = urlencoding::encode(collection_id);
if use_streaming_endpoint {
Expand All @@ -215,6 +216,8 @@ pub(super) async fn transfer_snapshot(
.await?
.await?;

snapshot_checksum = snapshot_description.checksum;

// TODO: If future is cancelled until `get_shard_snapshot_path` resolves, shard snapshot may not be cleaned up...
let snapshot_temp_path = shard_holder_read
.get_shard_snapshot_path(snapshots_path, shard_id, &snapshot_description.name)
Expand Down Expand Up @@ -253,6 +256,7 @@ pub(super) async fn transfer_snapshot(
shard_id,
&shard_download_url,
SnapshotPriority::ShardTransfer,
snapshot_checksum,
// Provide API key here so the remote can access our snapshot
local_api_key,
)
Expand Down