Repository navigation
quincy: librbd: remove previous incomplete primary snapshot after successfully creating a new one - #51173
Merged
Conversation
…y creating a new one Problem: ------- At a high level, creating a primary snapshot consists of three steps: 1. actually creating a snapshot in the mirror namespace 2. generating a set of image state objects with additional metadata for the snapshot 3. marking the snapshot as complete after the image state objects are written out Depending on the circumstances, a request to create a primary snapshot can be forwarded to rbd-mirror daemon. If that happens and rbd-mirror daemon gets axed for some practical reason after completing steps (1) and/or (2) but before completing step (3), we are left with a permanently incomplete primary snapshot because upon retrying that primary snapshot creation request, librbd notices that such snapshot already exists. It does not check whether this "pre-existing" snapshot is complete. Solution: -------- As part of the next mirror snapshot create (say triggered by the scheduler) the unlink_peer() is called, it checks if there exists any incomplete snapshot and delete them accordingly. Fixes: https://tracker.ceph.com/issues/58887 Signed-off-by: Prasanna Kumar Kalever <[email protected]> (cherry picked from commit 165c9a4) Conflicts: src/test/librbd/mirror/snapshot/test_mock_CreatePrimaryRequest.cc [ commit 3a93b40 ("librbd: s/boost::variant/std::variant/") not in quincy ]
Up until now this was conditioned on whether the caller expressed interest in the ID of the created snapshot and happened to work only because CreatePrimaryRequest wasn't actually consulting any mirror snapshot metadata. This has just changed with unlink_peer() needing to see an up-to-date complete flag which is set in SetImageStateRequest following the write out of image state object(s). Signed-off-by: Ilya Dryomov <[email protected]> (cherry picked from commit df2bb13)
chrisphoffman
approved these changes
Apr 24, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
backport tracker: https://tracker.ceph.com/issues/59507
backport of #50324
parent tracker: https://tracker.ceph.com/issues/58887