all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>,
	pbs-devel@lists.proxmox.com
Subject: Re: [PATCH proxmox-backup] fix #7305: client: restore: filter out last snapshot if not finished
Date: Fri, 13 Feb 2026 09:54:03 +0100	[thread overview]
Message-ID: <b30080a3-b79c-4e62-954c-5ad1af32a662@proxmox.com> (raw)
In-Reply-To: <1770907549.yrzyvu2z27.astroid@yuna.none>

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!




  reply	other threads:[~2026-02-13  8:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 15:24 Christian Ebner
2026-02-12 14:54 ` Fabian Grünbichler
2026-02-13  8:54   ` Christian Ebner [this message]
2026-02-13 10:44 ` superseded: " Christian Ebner
2026-02-13 10:43 Christian Ebner
2026-02-13 10:45 ` Christian Ebner
2026-02-13 10:51 ` Fabian Grünbichler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b30080a3-b79c-4e62-954c-5ad1af32a662@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=f.gruenbichler@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal