Skip to content

crimson/seatore: rework lba_manager to use LBACursor rather than LBAMapping - #66245

Merged
Matan-B merged 59 commits into
ceph:mainfrom
athanatos:wip-sjust-seastore-conflict
Mar 12, 2026
Merged

Matan-B merged 59 commits into
ceph:mainfrom
athanatos:wip-sjust-seastore-conflict

Conversation

@athanatos

Copy link
Copy Markdown
Contributor
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@athanatos

Copy link
Copy Markdown
Contributor Author

Replaces #66208 to avoid slashes in branch name.

@xxhdx1985126 xxhdx1985126 self-assigned this Nov 14, 2025
@athanatos
athanatos force-pushed the wip-sjust-seastore-conflict branch 2 times, most recently from b0a0309 to 9c4454b Compare December 9, 2025 04:22
@github-actions

github-actions Bot commented Dec 9, 2025

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@athanatos
athanatos force-pushed the wip-sjust-seastore-conflict branch from 9c4454b to 9c81ef3 Compare December 9, 2025 23:36
@Matan-B Matan-B added this to Crimson Dec 11, 2025
@Matan-B Matan-B moved this to Unassigned / Drafts / Discussion in Crimson Dec 11, 2025
@athanatos
athanatos force-pushed the wip-sjust-seastore-conflict branch from 9c81ef3 to fffbc62 Compare December 12, 2025 22:43
@Matan-B
Matan-B self-requested a review December 18, 2025 16:27
@xxhdx1985126

Copy link
Copy Markdown
Member

LGTM otherwise:-)

@@ -856,46 +856,39 @@ BtreeLBAManager::_update_mapping_ret
BtreeLBAManager::_update_mapping(
Transaction &t,
LBACursor &cursor,
update_func_t &&f,
update_func_t f,

@Matan-B Matan-B Jan 4, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should LBACursor &cursor param be used by value or LBACursorRef as its passed to a coroutine?

@athanatos athanatos Jan 5, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's owner is responsible for ensuring lifetime. I could have chosen to pass it as a value, but this is safe provided that the caller handles it correctly.

return std::move(ret);
});
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LBABtree& btree passed as reference to BtreeLBAManager::get_cursors coroutine. The users of this method would be moved out of the with_btree_state.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's a reference, so the caller is responsible for lifetime. I don't see any problematic callers? Looks like

BtreeLBAManager::get_cursors(
  Transaction &t,
  laddr_t laddr,
  extent_len_t length)

retains btree as an autovariable during the call?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The caller of this override of get_cursors is:

BtreeLBAManager::resolve_indirect_cursor(
  op_context_t c,
  LBABtree& btree,
  const LBACursor &indirect_cursor)

which takes LBABtree as a reference, it looks like resolve_indirect_cursor users would retain btree correctly.
However, wouldn't this be tricky for new users to know that they should be responsible for retaining lifetime? Passing a <type>Ref seems to help us avoid this kind of issues. I understand there are specific cases such as Transaction &t raw ref usage. But in other cases, is there a reason not to default to <type>Ref to make ownership and lifetime handling easier?

@Matan-B Matan-B moved this from Unassigned / Drafts / Discussion to Needs QA in Crimson Jan 6, 2026
@athanatos
athanatos marked this pull request as ready for review January 13, 2026 22:57
@athanatos
athanatos requested a review from a team as a code owner January 13, 2026 22:57
@athanatos

Copy link
Copy Markdown
Contributor Author

Just waiting on testing.

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@athanatos
athanatos force-pushed the wip-sjust-seastore-conflict branch from 0e44968 to dfda0da Compare March 10, 2026 17:12
@Matan-B Matan-B moved this from In Progress to Needs QA in Crimson Mar 11, 2026
@Matan-B Matan-B moved this from Needs QA to Tested in Crimson Mar 11, 2026
@Matan-B
Matan-B merged commit 777b323 into ceph:main Mar 12, 2026
4 checks passed
@Matan-B Matan-B moved this from Tested to Merged (Main) in Crimson Mar 12, 2026
@Matan-B Matan-B mentioned this pull request Mar 12, 2026
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged (Pre Umbrella cutoff)

Development

Successfully merging this pull request may close these issues.

5 participants