]> git-server-git.apps.pok.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>
Tue, 9 Mar 2021 21:13:58 +0000 (16:13 -0500)
commit2f042666004930c702aaafef1740c41f84b4e765
tree83d58e7148912b4e43c9f253d34e58b1530bc608
parentefacb8d261fd853fc9956e462cc508d16b84b444
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>
(cherry picked from commit a888bff8d00e3e496ec80e4273e01a47b67da5dc)
src/librbd/mirror/snapshot/CreatePrimaryRequest.cc
src/test/librbd/mirror/snapshot/test_mock_CreatePrimaryRequest.cc
src/test/librbd/test_mirroring.cc