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 4B45B1FF141 for ; Fri, 13 Feb 2026 09:53:21 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1286230995; Fri, 13 Feb 2026 09:54:08 +0100 (CET) Message-ID: Date: Fri, 13 Feb 2026 09:54:03 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup] fix #7305: client: restore: filter out last snapshot if not finished To: =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= , pbs-devel@lists.proxmox.com References: <20260211152452.894157-1-c.ebner@proxmox.com> <1770907549.yrzyvu2z27.astroid@yuna.none> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <1770907549.yrzyvu2z27.astroid@yuna.none> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1770972841064 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.047 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.001 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.001 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.001 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: W4C73Z2L7FPWPZ5AQ2ZENDSVRTE4X5XJ X-Message-ID-Hash: W4C73Z2L7FPWPZ5AQ2ZENDSVRTE4X5XJ 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: On 2/12/26 3:54 PM, Fabian Grünbichler wrote: > On February 11, 2026 4:24 pm, Christian Ebner wrote: >> + // only once a snapshots contains the manifest it is considered finished >> + let last_is_finished = list[0] >> + .files >> + .iter() >> + .any(|content| content.filename == MANIFEST_BLOB_NAME.as_ref()); >> + >> + if !last_is_finished { >> + if list.len() > 1 { >> + log::info!("last snapshot of group {group} not finished, use previous instead"); >> + return Ok((group, list[1].backup.time).into()); >> + } else { >> + bail!("backup group {group} does not contain finished snapshots."); >> + } >> + } > > couldn't this be a combinator instead? > > i.e., something like > > let last_finished_time = list > .iter() > .find_map(|snap| { > snap.files.iter().find_map(|content| { > if content.filename == MANIFEST_BLOB_NAME.as_ref() { > Some(snap.backup.time) > } else { > None > } > }) > }) > .ok_or_else(|| { > format_err!("backup group {group} does not contain any finished snapshots.") > })?; > > to account for multiple snapshots with missing manifests? those should > not occur "naturally", but might exist cause of accidents/.. Yes, good point! Would however opt for logging each skipped snapshot instead of silently progressing to the next one. This might help debug in cases where such issues come up. Will send version 2 shortly, thanks!