Repository navigation
librbd: disallow group snap rollback if memberships don't match - #58074
Conversation
The rollback assert doesn't really test anything -- because orig_data and test_data are written to non-overlapping areas, the test would pass even if rbd_group_snap_rollback() does nothing (i.e. rollback isn't performed) as long as the call returns 0. Signed-off-by: Ilya Dryomov <[email protected]>
After the rollback assert in TestGroup.add_snapshot{,PP} was made
meaningful in the previous commit, it fails in mock tests which means
that rollback has never been exercised properly...
While I confess to not following file->snap_id == CEPH_NOSNAP branch
especially given how file variable is shadowed, it's pretty clear that
get_snap_read() doesn't belong here -- the snapshot selected for reads
has nothing to do with rollback. Replacing it with the rollback snap
ID makes sense of the other branches and makes the tests in question
pass.
Signed-off-by: Ilya Dryomov <[email protected]>
Before proceeding with group rollback, ensure that the set of images that took part in the group snapshot matches the set of images that are currently part of the group. Otherwise, because we preserve affected snapshots when an image is removed from the group, data loss can ensue where an image gets rolled back while part of another group or not part of any group but long repurposed for something else. Similarly, ensure that the group snapshot is complete. Fixes: https://tracker.ceph.com/issues/66300 Signed-off-by: Ilya Dryomov <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
|
jenkins test make check |
| } | ||
| } | ||
|
|
||
| if (rollback_images != current_images) { |
There was a problem hiding this comment.
This would effectively mean that any older snaps taken before a membership change could not be used for a rollback. Wouldn't that defeat the purpose of having the snap?
There was a problem hiding this comment.
If the image(s) in question are around, the user can trivially restore membership before issuing rollback.
Putting the potential data loss aside, conceptually, we want post-rollback group to look exactly the same as it looked when the rollback snapshot was taken. If the group is going to be missing some images, denying the rollback request seems prudent.
|
Reviewed the commits. I couldn't make full sense of 91a0632 . Maybe we want to core to approve it? The code in the other 3 commits look good. I've a question regarding disallowing group snap rollback due to mismatch in group membership. |
There was a problem hiding this comment.
I've a question regarding disallowing group snap rollback due to mismatch in group membership. Why deny rolling back to a group snapshot whose image membership is a subset of current group's image membership?
For images that are not part of the group snapshot being roll-backed to,
can we roll them back to their first .group snapshot ID, since the first .group snapshot was created when the image was added to the group?
librados_test_stub is used exclusively by RBD, so we don't. |
Because post-rollback the group would be a mixed bag: that subset of images would be "as of rollback snapshot", while the rest would stay "in the future". I don't know how one can be expected to make sense of that, especially over time. With this change, the user would need to remove any extra images from the group before rollback. As a consequence, post-rollback group would look exactly the same as it looked when the rollback snapshot was taken. |
I strongly believe that such images shouldn't be touched at all -- that is really the point of this change.
No .group snapshots are created when an image is added to the group -- you are probably confusing this with the on-going work on mirroring. And if they were created, doing this would still make the group a mixed bag since those snapshots would be in the future relative to the rollback snapshot. |
Makes sense
I mixed this up with mirroring work here. |
ajarr
left a comment
There was a problem hiding this comment.
LGTM
As mentioned before, I didn't completely follow what's happening in TestMemIoCtxImpl::selfmanaged_snap_rollback()
|
With exclusive lock disabled and RBD cache either in writethrough or writeback mode, e.g. this fails as follows:
|
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e