public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH guest-common] replication: avoid "expected snapshot missing warning" when irrelevant
@ 2022-09-22 11:00 Fiona Ebner
  2022-09-22 11:13 ` Fiona Ebner
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Ebner @ 2022-09-22 11:00 UTC (permalink / raw)
  To: pve-devel

Namely, when there are no snapshots at all on the volume, which also
is the case when the volume doesn't exist. This happens when a fresh
volume is added to an already replicated guest.

Fixes replication tests in pve-manager, which didn't like the additional
output.

Fixes: c0b2948 ("replication: prepare: safeguard against removal if expected snapshot is missing")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 src/PVE/Replication.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/Replication.pm b/src/PVE/Replication.pm
index 8591d0e..680ffe1 100644
--- a/src/PVE/Replication.pm
+++ b/src/PVE/Replication.pm
@@ -178,7 +178,7 @@ sub prepare {
 	$removal_ok = 0 if $last_sync == 0; # last_sync=0 if the VM was stolen, don't remove!
 	$removal_ok = 1 if $last_sync == 1; # last_sync=1 is a special value used to remove all
 	$logfunc->("expected snapshot $snapname not present for $volid, not removing others")
-	    if !$removal_ok && $last_sync > 1;
+	    if !$removal_ok && $last_sync > 1 && scalar(keys $info->%*) > 0;
 
 	for my $snap (keys $info->%*) {
 	    if ( # check if it's a stale replication snapshot
-- 
2.30.2





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

end of thread, other threads:[~2022-09-22 11:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 11:00 [pve-devel] [PATCH guest-common] replication: avoid "expected snapshot missing warning" when irrelevant Fiona Ebner
2022-09-22 11:13 ` Fiona 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