From f37d8540e11757348578dd18056ec16cc5385591 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Thu, 21 Apr 2022 15:54:59 +0200 Subject: [PATCH] server pull: fix comment w.r.t. initial downloaded chunk capacity > The hash set will be able to hold at least capacity elements > without reallocating. If capacity is 0, the hash set will not > allocate. -- rustdoc, HashSet::with_capacity So, the number we pass is the amount of chunk "IDs" we safe, which is then 64Ki, not 16Ki and thus the size we can reference too is also 256 GiB, not 64 GiB. Signed-off-by: Thomas Lamprecht --- src/server/pull.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/pull.rs b/src/server/pull.rs index 09d3e45a..097bd5cb 100644 --- a/src/server/pull.rs +++ b/src/server/pull.rs @@ -586,7 +586,7 @@ pub async fn pull_group( let mut remote_snapshots = std::collections::HashSet::new(); - // start with 16384 chunks (up to 65GB) + // start with 65536 chunks (up to 256 GiB) let downloaded_chunks = Arc::new(Mutex::new(HashSet::with_capacity(1024 * 64))); progress.group_snapshots = list.len() as u64;