Skip to content

crimson/os/seastore: OP_CLONE in seastore - #51141

Merged
cyx1231st merged 12 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-clone
Aug 14, 2023
Merged

cyx1231st merged 12 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-clone

Conversation

@xxhdx1985126

@xxhdx1985126 xxhdx1985126 commented Apr 19, 2023 •

Copy link
Copy Markdown
Member

Signed-off-by: Xuehan Xu [email protected]

Contribution Guidelines

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

@xxhdx1985126
xxhdx1985126 requested a review from a team as a code owner April 19, 2023 04:54
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone branch 3 times, most recently from 014988e to d6e6870 Compare April 20, 2023 10:27
@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

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone branch 4 times, most recently from f1684e0 to 6726101 Compare April 22, 2023 02:40
@xxhdx1985126 xxhdx1985126 removed the DNM label Apr 22, 2023

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.

///< physical addr of mapping : should be physical addr or logic addr of mapping.

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.

better if (val.pladdr.is_paddr()) as other places use.

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.

in prepare_data_reservation already do object_data.update_reserved,right?

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.

Ah, yes.

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.

clone_extent_ret clone_extent(
Transaction &t,
laddr_t hint,
laddr_t clone_offset,
extent_len_t len) { only 4 parameters, what P_ADDR_NULL mean here?

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.

Looks the commit "implement OP_CLONE" is inconsistent about TM::clone_extent()

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 be BtreeLBAManager::alloc_extent_ret .

@liu-chunmei

Copy link
Copy Markdown
Contributor

could you add some explanation how indirect mapping relative to OP_CLONE?

@cyx1231st cyx1231st left a comment

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.

Still looking, some outdated comments seem to be fixed in the followup commits.

An important goal to split a large PR into smaller commits is to make reviewers easier to consume the changes following the commit order, but back-and-forth fixes and inconsistent commit will make things harder and have to fallback to look at the PR as-a-whole.

Inclusive commits are also helpful to do inplace improvements to keep the commit history clean, so one can join the review at any time. Rebasing will also be easier.

However, this is generally a suggestion as it is somewhat subjective about whether the history is clean enough and reorganizing commits cost extra efforts.

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.

i->get_val().is_paddr() && i->get_val().pladdr.get_paddr().is_relative()

Comment thread src/crimson/os/seastore/cached_extent.h Outdated

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.

looks unused.

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.

Doesn't need to hold a reference for consistency:

Onode *dest_onode = nullptr; // The destination onode in case of clone.

Comment thread src/crimson/os/seastore/seastore.cc Resolved

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.

ObjectDataHandler::clone hit invalid error

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.

Looks the commit "implement OP_CLONE" is inconsistent about TM::clone_extent()

@xxhdx1985126

Copy link
Copy Markdown
Member Author

An important goal to split a large PR into smaller commits is to make reviewers easier to consume the changes following the commit order, but back-and-forth fixes and inconsistent commit will make things harder and have to fallback to look at the PR as-a-whole.

Sorry, for this inconvenience, I'll try to merge fixes into original commits.

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone branch from 0934b27 to c1605a8 Compare May 6, 2023 05:33
@xxhdx1985126
xxhdx1985126 requested a review from a team as a code owner May 6, 2023 05:33
@github-actions github-actions Bot added the rbd label May 6, 2023
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone branch from c1605a8 to abf1f94 Compare May 6, 2023 05:34
@xxhdx1985126 xxhdx1985126 removed the rbd label May 6, 2023
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone branch from abf1f94 to da363b4 Compare May 6, 2023 06:02
@cyx1231st

Copy link
Copy Markdown
Member

Probably worth @athanatos's inputs as the changes to support clone are architectural.

@cyx1231st

Copy link
Copy Markdown
Member

@myoungwon looks that cloning will also impact ObjectDataBlock in supporting deltas.

@cyx1231st
cyx1231st requested a review from myoungwon July 25, 2023 03:15
Comment thread src/crimson/os/seastore/lba_manager.h Resolved
Comment thread src/crimson/os/seastore/lba_manager.h Resolved

@cyx1231st cyx1231st left a comment

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.

Generally looks good except for the comments!

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone branch 2 times, most recently from 61ed786 to e40c05a Compare August 9, 2023 01:46
@xxhdx1985126

Copy link
Copy Markdown
Member Author

@cyx1231st All comments are addressed, please take a look again, thanks.

@cyx1231st cyx1231st left a comment

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.

LGTM except for the comments below.

I think we finally need:

  • TransactionManager level synthetic UT to verify that remap_pin/read_pin/clone_extent/alloc_extent are keeping working with each other.
  • Early detection and failure when there is any attempt to mutate a shared (ref > 1) clone extent.

Might need @athanatos's approval.

Comment thread src/crimson/os/seastore/lba_manager.h Resolved
Comment thread src/crimson/os/seastore/lba_manager.h Resolved
Comment thread src/crimson/os/seastore/lba_manager.h Resolved
@xxhdx1985126

Copy link
Copy Markdown
Member Author
  • TransactionManager level synthetic UT to verify that remap_pin/read_pin/clone_extent/alloc_extent are keeping working with each other.

Yeah, I'll add this later in a follow-up PR.

  • Early detection and failure when there is any attempt to mutate a shared (ref > 1) clone extent.

I don't quite follow, could you elaborate this point a little bit?

@cyx1231st

Copy link
Copy Markdown
Member

Early detection and failure when there is any attempt to mutate a shared (ref > 1) clone extent.

I don't quite follow, could you elaborate this point a little bit?

This is currently an impossible case right now because we only clone ObjectDataBlock and it won't mutate. But @myoungwon has a proposal to introduce mutate & delta to ObjectDataBlock. And I guess we want to clone other extent types as well in the future.

So I think it will be finally important to generally make sure that we won't mistakenly mutate a shared LogicalCachedExtent and expose the data corruption mistake as early as possible. Specifically, at the time of duplicate_for_write().

Is that reasonable?

@xxhdx1985126

Copy link
Copy Markdown
Member Author

Early detection and failure when there is any attempt to mutate a shared (ref > 1) clone extent.

I don't quite follow, could you elaborate this point a little bit?

This is currently an impossible case right now because we only clone ObjectDataBlock and it won't mutate. But @myoungwon has a proposal to introduce mutate & delta to ObjectDataBlock. And I guess we want to clone other extent types as well in the future.

So I think it will be finally important to generally make sure that we won't mistakenly mutate a shared LogicalCachedExtent and expose the data corruption mistake as early as possible. Specifically, at the time of duplicate_for_write().

Is that reasonable?

Yeah:-)

xxhdx1985126 and others added 11 commits August 10, 2023 13:14
…unt when getting lba mappings

Signed-off-by: Xuehan Xu <[email protected]>
… truncating objects to zero size

Signed-off-by: Xuehan Xu <[email protected]>
mappings when removing indirect lba mappings

Signed-off-by: Xuehan Xu <[email protected]>
…lba mappings if necessary

when removing indirect lba mappings

Signed-off-by: xuxuehan <[email protected]>
mapping when remapping pins

Signed-off-by: Xuehan Xu <[email protected]>
account when reading object data

Signed-off-by: Xuehan Xu <[email protected]>

@athanatos athanatos left a comment

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.

I didn't look over it in much detail, but the interface changes look reasonable to me!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants