From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 550D61FF136 for ; Mon, 09 Mar 2026 17:21:43 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8140C3A18; Mon, 9 Mar 2026 17:21:35 +0100 (CET) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup v5 03/11] sync: pull: revert avoiding reinstantiation for encountered chunks map Date: Mon, 9 Mar 2026 17:20:42 +0100 Message-ID: <20260309162050.1047341-5-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260309162050.1047341-1-c.ebner@proxmox.com> References: <20260309162050.1047341-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1773073228601 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.010 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.408 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.819 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.903 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: AFSVXPP7FXTDHMGYCH3QC3SOYQKR5XQV X-Message-ID-Hash: AFSVXPP7FXTDHMGYCH3QC3SOYQKR5XQV X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: While keeping a store wide instance to avoid reinstantiation on each group is desired when iteratively processing groups, this cannot work when performing the sync of multiple groups in parallel. This is in preparation for parallel group syncs and reverts commit ecdec5bc ("sync: pull: avoid reinstantiation for encountered chunks map"). Signed-off-by: Christian Ebner --- src/server/pull.rs | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/server/pull.rs b/src/server/pull.rs index ddb59db54..254b36759 100644 --- a/src/server/pull.rs +++ b/src/server/pull.rs @@ -617,7 +617,6 @@ async fn pull_group( source_namespace: &BackupNamespace, group: &BackupGroup, progress: &mut StoreProgress, - encountered_chunks: Arc>, ) -> Result { let mut already_synced_skip_info = SkipInfo::new(SkipReason::AlreadySynced); let mut transfer_last_skip_info = SkipInfo::new(SkipReason::TransferLast); @@ -718,6 +717,9 @@ async fn pull_group( transfer_last_skip_info.reset(); } + // start with 65536 chunks (up to 256 GiB) + let encountered_chunks = Arc::new(Mutex::new(EncounteredChunks::with_capacity(1024 * 64))); + let backup_group = params .target .store @@ -981,9 +983,6 @@ pub(crate) async fn pull_store(mut params: PullParameters) -> Result Result { errors |= ns_errors; @@ -1063,7 +1062,6 @@ pub(crate) async fn pull_store(mut params: PullParameters) -> Result>, ) -> Result<(StoreProgress, SyncStats, bool), Error> { let list: Vec = params.source.list_groups(namespace, ¶ms.owner).await?; @@ -1122,16 +1120,7 @@ async fn pull_ns( ); errors = true; // do not stop here, instead continue } else { - encountered_chunks.lock().unwrap().clear(); - match pull_group( - params, - namespace, - &group, - &mut progress, - encountered_chunks.clone(), - ) - .await - { + match pull_group(params, namespace, &group, &mut progress).await { Ok(stats) => sync_stats.add(stats), Err(err) => { info!("sync group {} failed - {err:#}", &group); @@ -1252,9 +1241,4 @@ impl EncounteredChunks { } } } - - /// Clear all entries - fn clear(&mut self) { - self.chunk_set.clear(); - } } -- 2.47.3