Repository navigation
librbd: create rbd_trash object during pool initialization and namespace creation - #56310
Conversation
idryomov
left a comment
There was a problem hiding this comment.
These changes to ValidatePoolRequest look fine, but we aren't handling the case of images in namespaces here. RBD trash is per-namespace, so I think we are also going to need to create the trash object as part of creating a namespace in src/librbd/api/Namespace.cc and cover that with additional RemoveFullTry-like tests.
Thanks! I didn't think about this case earlier. |
... of rbd namespace creation. During rbd namespace creation, the image directory object may leak if the initalization of the image directory fails. Initialization of image directory involves creation of the rbd_directory object and a state being set in the object's omap. After creation of the object, error can occur when setting the state in the object's omap. This would fail the rbd namespace creation and leave behind the rbd_directory object. So try to remove the rbd_directory object when rolling back namespace creation. Signed-off-by: Ramana Raja <[email protected]>
|
ValidatePoolRequest will not be called if rbd_validate_pool is set to false. Would be better to do this as part of the Pool->init method itself? |
Good point! I think your suggestion makes sense to me. OTOH, wondering if "rbd_validate_pool" is still a useful config option? The config option was introduced in 2015, #6925 . Not sure if we want to bypass the pool validations (snapshot and overwrite support validations) anymore. Let's check with @idryomov next week |
It's used in tests, beyond that I don't expect it to ever be set to false. The config option is marked as advanced, but to signify that it's there purely for testing purposes, we could bump it to
The reasons I suggested to place rbd_trash object creation in
|
Added a commit to fix this in the latest update.
Thanks a lot for the explanation. Makes sense to me. |
Sigh, what I missed is that when
|
This wasn't caught by |
Made changes to |
... and RBD namespace creation. It was not possible to remove a RBD image when OSDs were full and the 'rbd_trash' object was not already created in the image's pool or pool namespace. The 'rbd_trash' object was created in a pool or namespace during the first instance of image removal from the pool or namespace. If no images were ever removed from a RBD pool or namespace and the OSDs became full, removal of images using the CLI failed. The failure occured when trying to move the images to trash since the 'rbd_trash' object was missing in the pool or namespace. Fix this issue by creating the rbd_trash object in a pool when initalizing the pool as a RBD pool and when creating a RBD namespace. Fixes: https://tracker.ceph.com/issues/64800 Signed-off-by: Ramana Raja <[email protected]>
'rbd_validate_pool' option is for testing purposes only. So change its level appropriately to 'dev'. Signed-off-by: Ramana Raja <[email protected]>
Fixes: https://tracker.ceph.com/issues/64800
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