5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-07 17:18:03 +03:00

pull-sync: do not interpret older missing snapshots as needs-resync

when loading the verification state for a local snapshot, it must
first be ensured that it actually exists, else the lack of manifest
will be interpreted as corrupt snapshot triggering a "resync" that is
actually a sync of all missing snapshots, not just the newer ones,
which is what's actually wanted here.

The diff is best seen by telling git to ignore the whitespace changes.

Fixes: 0974ddfa ("fix #3786: api: add resync-corrupt option to sync jobs")
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
 [ TL: reword subject and add a bit to commit message ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2024-11-27 09:26:04 +01:00 committed by Thomas Lamprecht
parent 6bd63b0e71
commit c5c7fd3482

View File

@ -551,6 +551,7 @@ async fn pull_group(
.store
.backup_dir(target_ns.clone(), dir.clone());
if let Ok(local_dir) = local_dir {
if local_dir.full_path().exists() {
match local_dir.verify_state() {
Ok(Some(state)) => {
if state == VerifyState::Failed {
@ -569,6 +570,7 @@ async fn pull_group(
}
}
}
}
// Note: the snapshot represented by `last_sync_time` might be missing its backup log
// or post-backup verification state if those were not yet available during the last
// sync run, always resync it