public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH proxmox-backup 0/4] server: pull: reduce lock contention on unchanged snapshots
@ 2026-12-01 14:13 Christian Ebner
  2026-12-01 14:13 ` [PATCH proxmox-backup 1/4] pbs-config: add helper to try upgrade shared lock to exclusive lock Christian Ebner
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christian Ebner @ 2026-12-01 14:13 UTC (permalink / raw)
  To: pbs-devel

Each pull re-syncs the newest snapshot of a group already present on
the target, to pick up a client log that was not yet available during
the previous run. Currently this acquires an exclusive snapshot lock
up front, even though the snapshot is usually unchanged.

Since commit 7241811f7 ("fix #6990: server: drop verify state on
non-decrypt pull job"), pull jobs no longer inherit the source's
verify state, so verify jobs on the target check every newly synced
snapshot while holding a shared lock. Concurrent pull jobs then fail
to acquire the exclusive lock and abort the whole group, delaying
newer snapshots until the next run.

This series checks existing, non-corrupt snapshots under a shared
lock first and upgrades the lock in place to exclusive only when
target changes are actually required:

- Patch 1 adds a BackupLockGuard::try_upgrade() helper for upgrading
  a shared lock to exclusive in place.
- Patch 2 implements SyncSourceReader::load_file_bytes() and loads
  the source manifest into memory only during pull instead of writing
  the temporary index.json.tmp into the target snapshot directory.
- Patch 3 refactors the initial sync/re-sync logging
- Patch 4 finally adapts snapshot checks to start under a shared lock
  and only upgrade to an exclusive lock when modifications to the
  snapshot are needed.

Based on a report in the community forum:
https://forum.proxmox.com/threads/187896/

Christian Ebner (4):
  pbs-config: add helper to try upgrade shared lock to exclusive lock
  server: pull: load source manifest into memory instead of a temp file
  server: pull: log snapshot sync start in pull_snapshot_from
  server: pull: check unchanged snapshots under a shared lock

 pbs-config/Cargo.toml |   3 +
 pbs-config/src/lib.rs |  80 +++++++++++++++++
 src/server/pull.rs    | 201 +++++++++++++++++++++++++++++-------------
 src/server/sync.rs    |  89 +++++++++++++------
 4 files changed, 286 insertions(+), 87 deletions(-)

-- 
2.47.3





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-01 14:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 14:13 [PATCH proxmox-backup 0/4] server: pull: reduce lock contention on unchanged snapshots Christian Ebner
2026-12-01 14:13 ` [PATCH proxmox-backup 1/4] pbs-config: add helper to try upgrade shared lock to exclusive lock Christian Ebner
2026-12-01 14:13 ` [PATCH proxmox-backup 2/4] server: pull: load source manifest into memory instead of a temp file Christian Ebner
2026-12-01 14:14 ` [PATCH proxmox-backup 3/4] server: pull: log snapshot sync start in pull_snapshot_from Christian Ebner
2026-12-01 14:14 ` [PATCH proxmox-backup 4/4] server: pull: check unchanged snapshots under a shared lock Christian Ebner

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