mirror of
git://git.proxmox.com/git/proxmox-backup.git
synced 2025-01-06 13:18:00 +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:
parent
6bd63b0e71
commit
c5c7fd3482
@ -551,21 +551,23 @@ async fn pull_group(
|
||||
.store
|
||||
.backup_dir(target_ns.clone(), dir.clone());
|
||||
if let Ok(local_dir) = local_dir {
|
||||
match local_dir.verify_state() {
|
||||
Ok(Some(state)) => {
|
||||
if state == VerifyState::Failed {
|
||||
if local_dir.full_path().exists() {
|
||||
match local_dir.verify_state() {
|
||||
Ok(Some(state)) => {
|
||||
if state == VerifyState::Failed {
|
||||
return Some((dir, true));
|
||||
}
|
||||
}
|
||||
Ok(None) => {
|
||||
// The verify_state item was not found in the manifest, this means the
|
||||
// snapshot is new.
|
||||
}
|
||||
Err(_) => {
|
||||
// There was an error loading the manifest, probably better if we
|
||||
// resync.
|
||||
return Some((dir, true));
|
||||
}
|
||||
}
|
||||
Ok(None) => {
|
||||
// The verify_state item was not found in the manifest, this means the
|
||||
// snapshot is new.
|
||||
}
|
||||
Err(_) => {
|
||||
// There was an error loading the manifest, probably better if we
|
||||
// resync.
|
||||
return Some((dir, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user