]> git.proxmox.com Git - pve-guest-common.git/commit - src/PVE/Replication.pm
partially fix #3111: replication: be less picky when selecting incremental base
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 12 Aug 2021 11:01:10 +0000 (13:01 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Mon, 8 Nov 2021 09:34:00 +0000 (10:34 +0100)
commit8d1cd443459d95431a3235d0bf18ec1de491e87a
tree19d2f604ddc6ec733141bad0afde4496d9297cfa
parentc05dc937d4e5e303802a182361abe832db0c4231
partially fix #3111: replication: be less picky when selecting incremental base

After rollback, it might be necessary to start the replication from an
earlier, possibly non-replication, snapshot, because the replication
snapshot might have been removed from the source node. Previously,
replication could only recover in case the current parent snapshot was
already replicated.

To get into the bad situation (with no replication happening between
the steps):
1. have existing replication
2. take new snapshot
3. rollback to that snapshot
In case the partial fix to only remove blocking replication snapshots
for rollback was already applied, an additional step is necessary to
get into the bad situation:
4. take a second new snapshot

Since non-replication snapshots are now also included, where no
timestamp is readily available, it is necessary to filter them out
when probing for replication snapshots.

If no common replication snapshot is present, iterate backwards
through the config snapshots.

The changes are backwards compatible:

If one side is running the old code, and the other the new code,
the fact that one of the two prepare() calls does not return the
new additional snapshot candidates, means that no new match is
possible. Since the new prepare() returns a superset, no previously
possible match is now impossible.

The branch with @desc_sorted_snap is now taken more often, but
it can still only be taken when the volume exists on the remote side
(and has snapshots). In such cases, it is safe to die if no
incremental base snapshot can be found, because a full sync would not
be possible.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
src/PVE/Replication.pm