public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH v3 proxmox-backup] fix #5710: api: backup: stat known chunks on backup finish
Date: Tue, 8 Oct 2024 10:41:45 +0200	[thread overview]
Message-ID: <20241008084145.kr3qrohtesthwvev@luna.proxmox.com> (raw)
In-Reply-To: <20241007113211.129770-1-c.ebner@proxmox.com>

>diff --git a/src/api2/backup/mod.rs b/src/api2/backup/mod.rs
>index ea0d0292e..664e24d99 100644
>--- a/src/api2/backup/mod.rs
>+++ b/src/api2/backup/mod.rs
>@@ -785,6 +785,26 @@ fn finish_backup(
> ) -> Result<Value, Error> {
>     let env: &BackupEnvironment = rpcenv.as_ref();
>
>+    if let Err(err) = env.stat_prev_known_chunks() {
>+        env.debug(format!("stat registered chunks failed - {err:?}"));
>+
>+        if let Some(last) = env.last_backup.as_ref() {
>+            // No need to acquire snapshot lock, already locked when starting the backup
>+            let verify_state = SnapshotVerifyState {
>+                state: VerifyState::Failed,
>+                upid: env.worker.upid().clone(), // backup writer UPID
>+            };
>+            let verify_state = serde_json::to_value(verify_state)?;
>+            last.backup_dir
>+                .update_manifest(|manifest| {
>+                    manifest.unprotected["verify_state"] = verify_state;
>+                })
>+                .map_err(|err| format_err!("manifest update failed - {err:?}"))?;

Can't we add this line here to the error context as well?

>+        }
>+
>+        bail!("stat known chunks failed - {err:?}");
>+    }
>+
>     env.finish_backup()?;
>     env.log("successfully finished backup");
>

Everything else is perfect!


_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


  reply	other threads:[~2024-10-08  8:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 11:32 Christian Ebner
2024-10-08  8:41 ` Gabriel Goller [this message]
2024-10-08  9:11   ` Christian Ebner

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=20241008084145.kr3qrohtesthwvev@luna.proxmox.com \
    --to=g.goller@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal