[pbs-devel] [PATCH proxmox-backup v3 0/3] fix #3786: resync corrupt chunks in sync-job

Gabriel Goller g.goller at proxmox.com
Tue Nov 5 11:40:12 CET 2024


Add an option `resync-corrupt` that resyncs corrupt snapshots when running
sync-job. This option checks if the local snapshot failed the last
verification and if it did, overwrites the local snapshot with the
remote one.

This is quite useful, as we currently don't have an option to "fix" 
broken chunks/snapshots in any way, even if a healthy version is on 
another (e.g. offsite) instance.

Important things to note are also: this has a slight performance 
penalty, as all the manifests have to be looked through, and a 
verification job has to be run beforehand, otherwise we do not know 
if the snapshot is healthy.

Note: This series was originally written by Shannon! I just picked it 
up, rebased, and fixed the obvious comments on the last series.

Changelog v3 (thanks @Fabian)
 - filter out snapshots earlier in the pull_group function
 - move verify_state to BackupManifest and fixed invocations
 - reverted verify_state Option -> Result state (It doesn't matter if we get an
   error, we get that quite often f.e. in new backups)
 - removed some unnecessary log lines
 - removed some unnecessary imports and modifications
 - rebase to current master

Changelog v2 (thanks @Thomas):
 - order git trailers
 - adjusted schema description to include broken indexes
 - change verify_state to return a Result<_,_>
 - print error if verify_state is not able to read the state
 - update docs on pull_snapshot function
 - simplify logic by combining flags
 - move log line out of loop to only print once that we resync the snapshot

Changelog since RFC (Shannon's work):
 - rename option from deep-sync to resync-corrupt
 - rebase on latest master (and change implementation details, as a 
     lot has changed around sync-jobs)

proxmox-backup:

Gabriel Goller (3):
  fix #3786: api: add resync-corrupt option to sync jobs
  fix #3786: ui/cli: add resync-corrupt option on sync-jobs
  fix #3786: docs: add resync-corrupt option to sync-job

 docs/managing-remotes.rst         |  6 +++
 pbs-api-types/src/jobs.rs         | 10 +++++
 pbs-datastore/src/backup_info.rs  | 12 +++++-
 pbs-datastore/src/manifest.rs     | 13 ++++++-
 src/api2/config/sync.rs           |  4 ++
 src/api2/pull.rs                  |  9 ++++-
 src/bin/proxmox-backup-manager.rs | 13 ++++++-
 src/server/pull.rs                | 62 +++++++++++++++++++++++--------
 www/window/SyncJobEdit.js         | 11 ++++++
 9 files changed, 119 insertions(+), 21 deletions(-)


Summary over all repositories:
  9 files changed, 119 insertions(+), 21 deletions(-)

-- 
Generated by git-murpp 0.7.1




More information about the pbs-devel mailing list