From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 386611FF0AB for ; Wed, 09 Sep 2026 14:32:12 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 58CE6215C1; Wed, 09 Sep 2026 14:32:11 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [PATCH proxmox-backup 17/28] api: backup: provide retain-until timestamp for extended prune protection From: Robert Obkircher To: Christian Ebner In-Reply-To: <20260813171002.809441-18-c.ebner@proxmox.com> References: <20260813171002.809441-1-c.ebner@proxmox.com> <20260813171002.809441-18-c.ebner@proxmox.com> Date: Wed, 09 Sep 2026 14:32:04 +0200 Message-Id: <178895712462.166875.4647352726813067932.b4-review@b4> X-Mailer: b4 0.16-dev X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788957117821 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.578 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust 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: PSA7KQA73CB7HR3CKOUMNDFB3JFPPM7D X-Message-ID-Hash: PSA7KQA73CB7HR3CKOUMNDFB3JFPPM7D X-MailFrom: r.obkircher@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 CC: pbs-devel@lists.proxmox.com 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: > Allows to protect snapshots from being pruned by providing a retention > timestamp during backup. > > Pruning must now also parse the manifest if present, which adds some > additional overhead on snapshot forget operations. This is however not > a performance critical code path as prunes run either in a job anyways, > where a slight delay for each prune is acceptable or a single snapshot > forget via API/CLI. > > However, as a side effect manifests which cannot be parsed can no > longer be pruned without manual intervention. > > Signed-off-by: Christian Ebner > > diff --git a/pbs-datastore/src/backup_info.rs b/pbs-datastore/src/backup_info.rs > index f476d4469..13eb0cdf6 100644 > --- a/pbs-datastore/src/backup_info.rs > +++ b/pbs-datastore/src/backup_info.rs > @@ -924,6 +924,17 @@ impl BackupDir { > bail!("cannot remove protected snapshot"); // use special error type? > } > > + if let Some((manifest, _size)) = self.load_manifest_optionally(false)? { > + if let Some(retain_until) = manifest.retention_timestamp()? { > + if retain_until > proxmox_time::epoch_i64() { Probably completely irrelevant, but using `>` here shortens the orignal timespan by up to 1 second (if retain_until was computed right before epoch_i64 increased). -- Robert Obkircher