[pve-devel] [PATCH guest-common 4/6] Get snapshots when no state is available.

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Dec 14 08:24:50 CET 2017


On 12/13/2017 03:46 PM, Wolfgang Link wrote:
> ---
>  PVE/Replication.pm | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/PVE/Replication.pm b/PVE/Replication.pm
> index dac0994..e69b0c2 100644
> --- a/PVE/Replication.pm
> +++ b/PVE/Replication.pm
> @@ -54,6 +54,13 @@ sub find_common_replication_snapshot {
>  		     ($last_snapshots->{$volid}->{$parent_snapname} &&
>  		      $remote_snapshots->{$volid}->{$parent_snapname})) {
>  		$base_snapshots->{$volid} = $parent_snapname;
> +	    } elsif ($last_sync == 0) {
> +		foreach my $remote_snap (keys %{$remote_snapshots->{$volid}}) {
> +		    # There should only be one snapshot which is equals;

But in theory there can be more? At least it seems so when looking at prepare
below.
Patch 3/6 changes prepare() to only deletes replication snapshots if $last_sync
is set - which contradicts then the comment at the start of the prepare sub
(please address that with 3/6), so the remote side may return more, which one
is used then and why?
Note, I'm not to deep into the replica stack as I wasn't present at most of the
internal design talks and there seems no general design document available, so
I may also just miss something :)

> +		    if (defined($last_snapshots->{$volid}->{$remote_snap})) {
> +			$base_snapshots->{$volid} = $remote_snap;
> +		    }
> +		}
>  	    }
>  	}
>      }
> 





More information about the pve-devel mailing list