Skip to content

crimson/os/seastore: add unittests for transaction manager's clone/remap/read_pin and fix bugs - #54036

Merged
cyx1231st merged 7 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-clone-remap-ut
Nov 3, 2023
Merged

cyx1231st merged 7 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-clone-remap-ut

Conversation

@xxhdx1985126

@xxhdx1985126 xxhdx1985126 commented Oct 16, 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

Copy link
Copy Markdown
Member Author

This is the follow up PR for #51141

@xxhdx1985126

Copy link
Copy Markdown
Member Author

jenkins test make check

@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.

Irrelavent to this PR but relavent to the clone feature:

IIUC the public interfaces inc/dec_ref() are not appropriate semantic for TM users.

With the clone design, I think the more appropriate TM-level interface would be remove(t, laddr), remove(t, lextent) and/or remove(t, pin), which is only allowed to remove indirect mapping or the direct mapping with refcount==1.

What do you think?

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 need to make sure whether this is a valid use case from ObjectStore perspective -- data overwrite and clone happening in the same transaction.

If yes, how about the nested case e.g. remap-clone-remap-... in the same transaction? And things are more complicated with the delta-base overwrite support (see #50419 @myoungwon ), we will need to consider to test interleaving that with clone&remap in various ways.

If no, things will be simpler to assert that the cloned extent must be stable. And I think the more important test would be to interleave various clone operations as independent transactions into test_random_writes_concurrent().

@athanatos what's your insight?

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.

Hmm. When the osd gets a write on an object with an outstanding snapshot, the transaction will contain a clone followed by the mutation. I can't think of a case where you'd see the other order (a mutation followed by a clone).

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 this is testing clone-then-remap in the same transaction.

Probable we can also assert that the cloning extent is stable to detect whether the scenario is expected ?

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.

Probable we can also assert that the cloning extent is stable to detect whether the scenario is expected ?

Actually, CLONE only operates on lba mappings and doesn't see those extents being cloned.

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.

And I think the more important test would be to interleave various clone operations as independent transactions into test_random_writes_concurrent().

test_random_writes_concurrent() modify TestBlocks through extents' mutate interface, which the current ObjectDataBlock and CLONE don't support. Maybe we can implement these in follow-up PRs.

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.

Actually, CLONE only operates on lba mappings and doesn't see those extents being cloned.

CLONE will always query the direct mapping which will get access to the cached extent if present in cache, so a check that the cloned extent should not be pending is possible, right?

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.

test_random_writes_concurrent() modify TestBlocks through extents' mutate interface, which the current ObjectDataBlock and CLONE don't support. Maybe we can implement these in follow-up PRs.

Not sure how TestBlock's mutate interface is related here as we will only test to clone "stable" extents for now. But it should be good to implement in another PR.

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone-remap-ut branch from 19c737c to 2af237b Compare October 20, 2023 09:02
@myoungwon

Copy link
Copy Markdown
Member

Regarding delta-base overwrite support with cloned extent, for now, I think we should prevent the extent from being overwritten by a delta base operation if the extent has been cloned because it'll overwrite the existing physical extent.

To support delta-base overwrite support with cloned extent, the clone operation probably needs to make a complete extent copy if delta-base overwrite is enabled. But, this might be expensive.

@cyx1231st

Copy link
Copy Markdown
Member

After discussing with @xxhdx1985126, the conclusion is that we don't need another readable/followable boolean with the improvements mentioned from #54036 (review)

@cyx1231st

Copy link
Copy Markdown
Member

Regarding delta-base overwrite support with cloned extent, for now, I think we should prevent the extent from being overwritten by a delta base operation if the extent has been cloned because it'll overwrite the existing physical extent.

Agreed, we can prevent delta-based overwrite to the cloned extents for now.

To support delta-base overwrite support with cloned extent, the clone operation probably needs to make a complete extent copy if delta-base overwrite is enabled. But, this might be expensive.

Anyway, we can always fall back to the remap-based overwrite approach which is already implemented.

@xxhdx1985126

Copy link
Copy Markdown
Member Author

@cyx1231st All done, please take a look again:-)

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone-remap-ut branch from 1b26be0 to 056defc Compare October 30, 2023 02:03
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone-remap-ut branch 2 times, most recently from 8d7c83a to 0264cfe Compare November 1, 2023 02:19

@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!

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone-remap-ut branch from 0264cfe to f9b1091 Compare November 1, 2023 07:14
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone-remap-ut branch from f9b1091 to 8c42bcd Compare November 2, 2023 03:31
always have the entire original mappings as their targets

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

@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, looks #54036 (comment) isn't addressed yet.

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone-remap-ut branch from 8c42bcd to 08c751c Compare November 2, 2023 06:02
@xxhdx1985126

Copy link
Copy Markdown
Member Author

LGTM, looks #54036 (comment) isn't addressed yet.

Done:-)

@cyx1231st

Copy link
Copy Markdown
Member

I'll merge if there are no further comments.

@myoungwon @athanatos Looks to me the critical impact is about refining TransactionManager interfaces around remove(), let me know if that concerns you.

I'll add a follow-up PR around #54036 (comment)

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-clone-remap-ut branch from 08c751c to 4010045 Compare November 2, 2023 06:23

@myoungwon myoungwon 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

@cyx1231st
cyx1231st merged commit cb00a14 into ceph:main Nov 3, 2023
using ref_iertr = LBAManager::ref_iertr;
using ref_ret = ref_iertr::future<unsigned>;

#ifdef UNIT_TESTS_BUILT

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 it is missing in transaction_manager.cc which breaks the non-test build.

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