Repository navigation
RGW: Remove RGWObjState and get_obj_state()/put_obj_state() from the SAL API - #57377
Conversation
There was a problem hiding this comment.
this is the read-from-cache case, so i don't think we actually want to load anything from the backend here. can we call the setters below without this part?
There was a problem hiding this comment.
I admit, I don't know. @samarahu do you have an opinion here? Do we need to load info from the backend or is it already in the object?
There was a problem hiding this comment.
This is not needed in case of the read cache, because the attrs will anyway be fetched from the backend store (since the head/attrs are not being cached) and I believe get_obj_attrs() of the store anyway invokes get_obj_state internally.
But we need to get the object state in case of unified (write-back and read cache) where we are caching the head/attrs. If the block/object is not in the cache (could have been evicted/multipart object), we get the object from the cache get the object state, and store some state variables as part of the cached head as attrs (like object_size, mtime, epoch etc), and those attrs will be read back while reading the head in case of the next get and the the object state is set using set_obj_state. Setting the object state helps, because the ReadOp::prepare method can read the cached head now and the saved object state. The PR is is still in progress. I have a related scenario to discuss that I plan to bring up in the next d4n meeting.
There was a problem hiding this comment.
I can see that related getters/setters have been provided - they can be used in the PR that is in progress.
There was a problem hiding this comment.
I don't believe this method call is integral to any of the upstreamed D4N functionality. I just added this code as a temporary implementation for handling attributes within D4N. As Pritha mentioned, she is working on this part of the unified single-node cache for the next PR and based on her most recent response, it seems we can remove the call to the get_obj_state method and replace it with specific getters and setters for handling the head metadata.
There was a problem hiding this comment.
Okay, I'll leave this as is, and let you guys work it out in future work.
There was a problem hiding this comment.
nit: name should be const ref
There was a problem hiding this comment.
Yeah, this was copied from RGWObjState::get_attr(). I'll fix this.
There was a problem hiding this comment.
nit: name should be const ref
|
I think aesthetically, get_obj_state() without the RGWObjState* parameter is preferable to load_obj_state(); we never had "load" operations in the codebase prior to this, and even in zipper, most code was using get_obj_state(). |
My issue with this is that "get_foo" should return foo, and this is specifically not returning obj_state. "load_foo" has been added to the SAL api already in the form of "load_bucket" and "load_user", so that's why I picked this naming scheme. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
RGWObjState is the state for the StoreObject class. It has historically been accessible via get_obj_state()/set_obj_state(), but the double pointer nature of this access has caused multiple bugs, and the RGWObjState itself is an implementation detail that doesn't need to be exposed. Instead, add a load_obj_state() that loads the state from the store, and use proper getters/setters for the data. Signed-off-by: Daniel Gryniewicz <[email protected]>
Signed-off-by: Daniel Gryniewicz <[email protected]>
|
jenkins test windows |
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