]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rbd-mirror: don't prune non-primary snapshot when restarting delta sync
authorIlya Dryomov <idryomov@gmail.com>
Sat, 28 May 2022 18:06:22 +0000 (20:06 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 30 May 2022 19:57:14 +0000 (21:57 +0200)
commit3ba82f2aa73871af9ef190c06e2c99eed6d21e7b
treea58d4c85feaa0c011a6ae1b37822f89c3b711c0a
parent8ddce107d02bbf3021a53a2861024f66a3ec0918
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>
src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc
src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc