]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rbd-mirror: don't prune non-primary snapshot when restarting delta sync 46589/head
authorIlya Dryomov <idryomov@gmail.com>
Sat, 28 May 2022 18:06:22 +0000 (20:06 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 9 Jun 2022 09:00:40 +0000 (11:00 +0200)
commit2ba05cb028a4b3a9f6ec74aacd28758bb74619e8
tree61f1965b1aa899853ae8e9b55ae6106b828c4603
parent40974b03edef1429a38173ea4149309e9f93d61e
rbd-mirror: don't prune non-primary snapshot when restarting delta sync

When restarting interrupted sync (signified by the "end" non-primary
snapshot with last_copied_object_number > 0), preserve the "start"
non-primary snapshot until the sync is completed, like it would have
been done had the sync not been interrupted.  This ensures that the
same m_local_snap_id_start is passed to scan_remote_mirror_snapshots()
and ultimately ImageCopyRequest state machine on restart as on initial
start.

This ends up being yet another fixup for 281af0de86b1 ("rbd-mirror:
prune unnecessary non-primary mirror snapshots"), following earlier
7ba9214ea5b7 ("rbd-mirror: don't prune older mirror snapshots when
pruning incomplete snapshot") and ecd3778a6f9a ("rbd-mirror: ensure
that the last non-primary snapshot cannot be pruned").

Fixes: https://tracker.ceph.com/issues/55796
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 3ba82f2aa73871af9ef190c06e2c99eed6d21e7b)
src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc
src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc