From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Gabriel Goller <g.goller@proxmox.com>
Cc: pbs-devel@lists.proxmox.com
Subject: Re: [pbs-devel] [PATCH proxmox-backup v4 1/4] snapshot: add helper function to retrieve verify_state
Date: Fri, 22 Nov 2024 10:08:21 +0100 (CET) [thread overview]
Message-ID: <1650154714.8259.1732266501681@webmail.proxmox.com> (raw)
In-Reply-To: <2pz4wpna4u4fkvtdpblj4xj62o4n746zbnsfqepw76jyphmp6d@djir34ghshw5>
> Gabriel Goller <g.goller@proxmox.com> hat am 22.11.2024 10:02 CET geschrieben:
> On 21.11.2024 20:17, Fabian Grünbichler wrote:
> >> Gabriel Goller <g.goller@proxmox.com> hat am 21.11.2024 14:35 CET geschrieben:
> >> @@ -159,13 +159,12 @@ fn upgrade_to_backup_protocol(
> >> let info = backup_group.last_backup(true).unwrap_or(None);
> >> if let Some(info) = info {
> >> let (manifest, _) = info.backup_dir.load_manifest()?;
> >> - let verify = manifest.unprotected["verify_state"].clone();
> >> - match serde_json::from_value::<SnapshotVerifyState>(verify) {
> >> - Ok(verify) => match verify.state {
> >> + match manifest.verify_state() {
> >> + Ok(Some(verify)) => match verify.state {
> >> VerifyState::Ok => Some(info),
> >> VerifyState::Failed => None,
> >> },
> >> - Err(_) => {
> >> + Ok(None) | Err(_) => {
> >> // no verify state found, treat as valid
> >
> >this as well, although it might make sense to log this here as well (pre-existing)
>
> You mean separating the Ok(None) and Err(_) arm and `warn()` on the
> Err(_) one?
yes, exactly.. this should hopefully never trigger, but if it does, not logging it just causes confusion - with log output, there's a chance that additional information gives the deciding clue what's going on :)
> >> Some(info)
> >> }
> >> diff --git a/src/backup/verify.rs b/src/backup/verify.rs
> >> index 6ef7e8eb3ebb..20c605c4dde6 100644
> >> --- a/src/backup/verify.rs
> >> +++ b/src/backup/verify.rs
> >> @@ -553,10 +553,9 @@ pub fn verify_filter(
> >> return true;
> >> }
> >>
> >> - let raw_verify_state = manifest.unprotected["verify_state"].clone();
> >> - match serde_json::from_value::<SnapshotVerifyState>(raw_verify_state) {
> >> - Err(_) => true, // no last verification, always include
> >> - Ok(last_verify) => {
> >> + match manifest.verify_state() {
> >> + Ok(None) | Err(_) => true, // no last verification, always include
> >
> >same here! I think/hope the Err path for these should only trigger when somebody messes up manifests, but..
>
> Yep.
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
next prev parent reply other threads:[~2024-11-22 9:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-21 13:35 [pbs-devel] [PATCH proxmox-backup v4 0/4] fix #3786: resync corrupt chunks in sync-job Gabriel Goller
2024-11-21 13:35 ` [pbs-devel] [PATCH proxmox-backup v4 1/4] snapshot: add helper function to retrieve verify_state Gabriel Goller
2024-11-21 19:17 ` Fabian Grünbichler
2024-11-22 9:02 ` Gabriel Goller
2024-11-22 9:08 ` Fabian Grünbichler [this message]
2024-11-21 13:35 ` [pbs-devel] [PATCH proxmox-backup v4 2/4] fix #3786: api: add resync-corrupt option to sync jobs Gabriel Goller
2024-11-21 13:35 ` [pbs-devel] [PATCH proxmox-backup v4 3/4] fix #3786: ui/cli: add resync-corrupt option on sync-jobs Gabriel Goller
2024-11-21 13:35 ` [pbs-devel] [PATCH proxmox-backup v4 4/4] fix #3786: docs: add resync-corrupt option to sync-job Gabriel Goller
2024-11-21 19:21 ` [pbs-devel] [PATCH proxmox-backup v4 0/4] fix #3786: resync corrupt chunks in sync-job Fabian Grünbichler
2024-11-22 9:39 ` Gabriel Goller
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=1650154714.8259.1732266501681@webmail.proxmox.com \
--to=f.gruenbichler@proxmox.com \
--cc=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