Skip to content

crimson/os/seastore/lba_manager: cleanups for indirect lba mappings - #57891

Closed
xxhdx1985126 wants to merge 2 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-indirect-mapping-clarify
Closed

xxhdx1985126 wants to merge 2 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-indirect-mapping-clarify

Conversation

@xxhdx1985126

Copy link
Copy Markdown
Member

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@xxhdx1985126
xxhdx1985126 requested a review from cyx1231st June 5, 2024 08:47
@xxhdx1985126
xxhdx1985126 requested a review from a team as a code owner June 5, 2024 08:47
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]>
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-indirect-mapping-clarify branch from 74096fe to dc8e1e5 Compare June 5, 2024 09:12
@xxhdx1985126 xxhdx1985126 added DNM and removed DNM labels Jun 5, 2024
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-indirect-mapping-clarify branch from dc8e1e5 to 68a1320 Compare June 5, 2024 13:07
@xxhdx1985126 xxhdx1985126 removed the DNM label Jun 5, 2024
extent_len_t len,
laddr_t intermediate_key,
laddr_t intermediate_base) = 0;
laddr_t intermediate_key) = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, actually, it's used by CLONE_RANGE, perhaps I should merge this PR into the clone_range PR.

@cyx1231st cyx1231st Jun 6, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and let's proceed the dependent PRs #57709 #57818 first.

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) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly,

HALF_INDIRECT -> RAW/INCOMPLETE_INDIRECT
FULL_INDIRECT -> INDIRECT

  1. 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.
  2. INDIRECT mappings: they have the complete information from intermediate mappings for LBAManager users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants