crimson/osd/object_context_loader: Simplify interface#56752
Closed
crimson/osd/object_context_loader: Simplify interface#56752
Conversation
Previously, only the head obc had ssc reference. Let clone obc also reference it's head ssc. Fixes: https://tracker.ceph.com/issues/65203 Fixes: https://tracker.ceph.com/issues/65201 Signed-off-by: Matan Breizman <mbreizma@redhat.com>
…case
Resolve_oid on a clone object may actually return the head:
```
// Because oid.snap > ss.seq, we are trying to read from a snapshot
// taken after the most recent write to this object. Read from head.
```
In this case, with_clone_obc should apply `func` same as with_head_obc would have.
Meaning, with_clone_obc_only shouldn't not be called because there is no actual
clone object (yet).
Note: previously, with_clone_obc_only was called on the resolved head object.
While it didn't cause any errors, using the head_obc as clone is wrong.
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
// Classic can load the obc using a given attrset, Crimson doesn't // load obc using existing attrset yet (consults disk by default instead). We already load the obc using `with_obc` without using `push_op.attrset`. Signed-off-by: Matan Breizman <mbreizma@redhat.com>
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
ObjectContextLoader interface provides two variants: * with_obc: // Use this variant by default // If oid is a clone object, the clone obc *and* it's // matching head obc will be locked and can be used in func. * with_clone_obc_only: // Use this variant in the case where the head object // obc is already locked and only the clone obc is needed. // Avoid nesting with_head_obc() calls by using with_clone_obc() // with an already locked head. with_clone_obc_direct variant is equal to with_obc on a clone obc since both the head and the clone obcs will be locked and can be used. Signed-off-by: Matan Breizman <mbreizma@redhat.com>
No change in behavior Signed-off-by: Matan Breizman <mbreizma@redhat.com>
No change in behavior, improved readability Signed-off-by: Matan Breizman <mbreizma@redhat.com>
14 tasks
SnapTrimObjSubEvent::remove_or_update partially resolves the to be
trimmed clone taking into account in_removed_snaps_queue.
The general resolve_oid is not suitable for this scenario.
Specifically the following check:
```
if (std::find(
citer->second.begin(),
citer->second.end(),
oid.snap) == citer->second.end()) {
logger().debug("{} {} does not contain {} -- DNE",
__func__, ss.clone_snaps, oid.snap);
return std::nullopt;
}
```
because of earlier snap_map_modify call.
Example:
```
INFO 2024-04-07 13:44:01,118 [shard 0:main] osd - SnapTrimObjSubEvent(coid=2:e8855410:::folio011816418-576:8 snapid=8): 2:e8855410:::folio011816418-576:8 snaps [8, 7] -> {7}
DEBUG 2024-04-07 13:44:01,118 [shard 0:main] osd - snap_map_modify: soid 2:e8855410:::folio011816418-576:8, snaps {7}
...
This case will fail:
INFO 2024-04-07 13:44:04,139 [shard 0:main] osd - SnapTrimObjSubEvent(coid=2:e8855410:::folio011816418-576:8 snapid=7): 2:e8855410:::folio011816418-576:8 snaps [7] -> {} ... deleting
DEBUG 2024-04-07 13:44:04,139 [shard 0:main] osd - snap_map_remove: soid 2:e8855410:::folio011816418-576:8
```
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
302e6b9 to
93b0f0a
Compare
Contributor
Author
|
jenkins test make check |
xxhdx1985126
reviewed
Apr 9, 2024
xxhdx1985126
reviewed
Apr 9, 2024
Contributor
Author
|
Once #56610 is merged I'll go back to this PR. This component may also be a good candidate to use coroutines. |
Contributor
Author
|
Some of the changes here are essential for #56610. Moving back and closing. |
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.
Originated and blocked by: #56610
This PR includes comments, cleanups and improved readability to object_context_loader.
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