[pve-devel] [PATCH proxmox-offline-mirror v2 0/5] remove snapshot directories vanished on source also on medium

Stoiko Ivanov s.ivanov at proxmox.com
Tue Jul 9 12:47:00 CEST 2024


supersedes: https://lists.proxmox.com/pipermail/pve-devel/2024-June/064278.html

v1->v2:
* had quite a few chats with Fabian off-list, as noted by him - Thanks!
* noticed that the core-issue was probably an error in using path.is_empty
  (which checks for an empty path '', not for an empty directory) fixed with
  patch 3/5
* noticed that the current gc-code removes orphaned files (a.k.a. files
  not hardlinked to a checksum file) in any case - so dropped the idea of
  an explicit command-line switch (as sync_pool calls gc on the target
  pool as well) - can gladly rework both to add this as explicit
  safe-guard, but currently do not think it has much merit
* patch 1/5 addresses the recent changes to proxmox-apt - I hope it's ok
  as is.
* patch 2/5 is unrelated, but it confused me enough while going through
  the code.

tested with a local setup.

original cover-letter for v1:

This patchset fixes a small glitch that we noticed in a pom-setup, creating
regular snapshots, without cleaning them up regularly.

Eventually medium sync becomes quite slow.
After removing many snapshots and running garbage collection both on the
mirror as well as on the medium the run-time for the sync still took quite
long. strace showed that the process still walked through the directories
for each snapshot on the medium - they were not cleaned up after all the
files inside were removed.

tested the patch locally (which is the reason for patch 1/2).


Stoiko Ivanov (5):
  bump proxmox-apt to 0.11 and adapt to changes.
  pool: drop superfluous check for impossible path combination
  pool: unlink_file: fix check for empty directory
  pool: gc: remove empty directories under link_dir
  pool: remove unused imports

 Cargo.toml     |  3 ++-
 debian/control |  3 ++-
 src/lib.rs     |  5 +++--
 src/mirror.rs  | 11 +++++------
 src/pool.rs    | 24 ++++++++++++++----------
 5 files changed, 26 insertions(+), 20 deletions(-)

-- 
2.39.2





More information about the pve-devel mailing list