Repository navigation
crimson/os/seastore/lba_manager: cleanups for indirect lba mappings - #57891
xxhdx1985126 wants to merge 2 commits into
Conversation
lba mappings Indirect mappings may or may not contain information about the corresponding direct(intermediate) mappings. Distinguishing the two cases makes the code more clear. Signed-off-by: Xuehan Xu <[email protected]>
74096fe to
dc8e1e5
Compare
dc8e1e5 to
68a1320
Compare
mappings Signed-off-by: Xuehan Xu <[email protected]>
| extent_len_t len, | ||
| laddr_t intermediate_key, | ||
| laddr_t intermediate_base) = 0; | ||
| laddr_t intermediate_key) = 0; |
There was a problem hiding this comment.
Seems to me currently, the "half-indirect" pin are not exposed to the lba-manager users.
If that's correct, who can pass the "half-indirect" pin to LBAM::clone_mapping() or TM::clone_pin()?
There was a problem hiding this comment.
Um, actually, it's used by CLONE_RANGE, perhaps I should merge this PR into the clone_range PR.
| c, addr | ||
| ).si_then([&btree, f=std::move(f), c, addr, nextent](auto iter) | ||
| -> _update_mapping_ret { | ||
| if (iter.is_end() || iter.get_key() != addr) { |
There was a problem hiding this comment.
The original accurate lookup is safer because it can detect the bug when user somehow holds an invalid key, and can fail immediately.
If the new scenario (sub-extent lookup) isn't possible yet, how about stashing this commit (as a draft) until necessary?
If really needed, I think split the interface for accurate and subextent lookups can make the intention more explicit and the code more robust.
There was a problem hiding this comment.
I've just modified the code according to your suggestions in #57735. Closing this PR:-)
| // FULL_INDIRECT. | ||
| // 1. HALF_INDIRECT mappings: indirect mappings that don't have information from | ||
| // the intermediate mapping. Specifically, they don't have valid intermediate_base, | ||
| // intermediate_offset or intermediate_length. |
There was a problem hiding this comment.
See my another comment that "the 'half-indirect' pin is not exposed to the lba-manager users".
BtreeLBAMapping has a broader users above LBAManager. If they don't need to worry about "half-indirect" pins, how about keeping the original interfaces, and hide the complexity only inside the LBAManager, for example:
is_full_indirect()->is_indirect().is_half_indirect()->is_raw/incomplete_indirect().is_indirect()->is_indirect() || is_raw/incomplete_indirect()// Seems the path that need to accept both cases is currently very special, and inside LBAManager.
| // FULL_INDIRECT. | ||
| // 1. HALF_INDIRECT mappings: indirect mappings that don't have information from | ||
| // the intermediate mapping. Specifically, they don't have valid intermediate_base, | ||
| // intermediate_offset or intermediate_length. |
There was a problem hiding this comment.
Similarly,
HALF_INDIRECT -> RAW/INCOMPLETE_INDIRECT
FULL_INDIRECT -> INDIRECT
- RAW/INCOMPLETE_INDIRECT mappings: they don't have information from the intermediate mapping and should not be exposed outside LBAManager. Specifically, they don't have valid intermediate_base, intermediate_offset, intermediate_length or attached to a logical cached extent.
- INDIRECT mappings: they have the complete information from intermediate mappings for LBAManager users.
Signed-off-by: Xuehan Xu [email protected]
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