]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
librbd/mirror: tweak which snapshot is unlinked when at capacity
authorJason Dillaman <dillaman@redhat.com>
Thu, 10 Dec 2020 22:32:16 +0000 (17:32 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 11 Dec 2020 15:41:34 +0000 (10:41 -0500)
commita888bff8d00e3e496ec80e4273e01a47b67da5dc
treeb2dda1c1e8d2592bd104c43dea34eed33c6cb1ef
parent529d3c9a073b6ab11f469fd54c72de2d3650cf18
librbd/mirror: tweak which snapshot is unlinked when at capacity

The rbd-mirror daemon will attempt to sync from the last synced
snapshot to the next mirror snapshot. When the limit is at 3, this
currently can result in a situation where an in-use sync snapshot is
deleted. Instead of unlinking the second oldest snapshot, always
unlink the third oldest.

Fixes: https://tracker.ceph.com/issues/48553
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/mirror/snapshot/CreatePrimaryRequest.cc
src/test/librbd/mirror/snapshot/test_mock_CreatePrimaryRequest.cc
src/test/librbd/test_mirroring.cc