]> git.proxmox.com Git - pve-guest-common.git/commit
replication: snapshot cleanup: only attempt to remove snapshots that exist
authorFiona Ebner <f.ebner@proxmox.com>
Thu, 18 Apr 2024 07:06:47 +0000 (09:06 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 18 Apr 2024 08:19:59 +0000 (10:19 +0200)
commit45c355356282d860b9f8b835a4221a3ef95549df
tree57f01767f1361aff3db964ceb78d75263bfa778e
parentbfc998e0f03984cf22f3884184e550d348a09441
replication: snapshot cleanup: only attempt to remove snapshots that exist

Since commit a6f5b35 ("replication: prepare: include volumes without
snapshots in the result"), attempts would be made to remove previous
replication snapshots from volumes on which they didn't exist. This
was noticed by Thomas since the output of a replication test in
pve-manager changed.

The issue is not completely new, i.e. there was no check that the
(previous) replication snapshot acutally exists before attempting
removal during the cleanup phase. Fix the issue by adding such a
check.

The $replicate_snapshots hash is only used for this, so the change
there is fine.

Fixes: a6f5b35 ("replication: prepare: include volumes without snapshots in the result")
Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
src/PVE/Replication.pm