Skip to content

crimson/os/seastore: refactor fixed-kv-btree - #61347

Merged
cyx1231st merged 4 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-tree-pointer-abstract
Feb 19, 2025
Merged

cyx1231st merged 4 commits into
ceph:mainfrom
xxhdx1985126:wip-seastore-tree-pointer-abstract

Conversation

@xxhdx1985126

@xxhdx1985126 xxhdx1985126 commented Jan 13, 2025 •

Copy link
Copy Markdown
Member

This PR involves two modifications to the current implementation of the fixed-kv-btree:

  1. move all parent<->child pointer logics into dedicated linked tree node classes;
  2. move parent<->child pointer logics of leaf nodes into LBALeafNode, so BackrefLeafNode doesn't need to hold the redundant parent pointer logics.

This PR is based on #61261

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 a team as a code owner January 13, 2025 09:44
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-tree-pointer-abstract branch 2 times, most recently from 7751ffa to edb6535 Compare January 14, 2025 03:19
@xxhdx1985126 xxhdx1985126 added DNM and removed DNM labels Jan 14, 2025
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-tree-pointer-abstract branch 2 times, most recently from d748906 to 4ab2c46 Compare January 14, 2025 09:56
@xxhdx1985126

Copy link
Copy Markdown
Member Author

@cyx1231st Hi, yingxin, I think this PR is good for review, please take a look, thanks:-)

@xxhdx1985126 xxhdx1985126 removed the DNM label Jan 14, 2025
@xxhdx1985126

Copy link
Copy Markdown
Member Author

jenkins test make check arm64

@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, sharing some thoughts.

Comment thread src/crimson/os/seastore/cached_extent.h Resolved
Comment thread src/crimson/os/seastore/cache.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.

I'll wait for the next version to continue the reviews.

@cyx1231st

Copy link
Copy Markdown
Member

If there are anything fixed during the refactors, can it be splitted before them, so the refactors can be pure?

Such as #61347 (comment).

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-tree-pointer-abstract branch from 4ab2c46 to 3c79f44 Compare January 21, 2025 08:40
@xxhdx1985126

Copy link
Copy Markdown
Member Author

@cyx1231st Hi, yingxin, I've just addressed all the comments, please take a look again, thanks:-)

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.

(suggestion only, we can keep it if there is no better way atm)

Ideally, down_cast() should be avoided because it breaks the abstractions (or in another word, this is the result that the current abstraction isn't sufficient), and the free-style relying on concrete templates isn't friendly to reuse the parent-child-ptr solution for the same reason.

@xxhdx1985126 xxhdx1985126 Jan 24, 2025 •

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.

Yeah, I agree.

But it looks to me that this may be inevitable, since we're using crtp to add additional functions to the existing extent types.

After a second thought, maybe we don't have to take the crtp way. Maybe the polymorphism way is better. I'll give it a try.

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.

@cyx1231st I've just tried to switch to the polymorphism way. It turns out that we may have to define a lot of same-function-but-different-named virtual methods. For example, we may have to define an alias for CachedExtent::is_mutation_pending(), so that we can use it in the linked tree node level.

I think maybe we can take the crtp way for now, and switch to the polymorphism way when necessary in the future. What do you think?

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-tree-pointer-abstract branch 3 times, most recently from 95bfa3d to 0af45e4 Compare January 26, 2025 13:21
@xxhdx1985126

Copy link
Copy Markdown
Member Author

jenkins test api

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-tree-pointer-abstract branch from 0af45e4 to 052d706 Compare February 11, 2025 06:19
Linked tree nodes encapsulate all logics about linking parent child
nodes with in-memory pointers.

There are three kinds of roles for linked tree nodes:

1. ParentNode: any nodes that have child nodes should be of this role,
   for example: (LBA/Backref)InternalNode, LBALeafNode.
2. ChildNode: any nodes that have parent nodes should be of this role,
   for example: (LBA/Backref)(Internal/Leaf)Node.
3. RootNode: any nodes that may be the root of a tree should be of this
   role.

Signed-off-by: Xuehan Xu <[email protected]>
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-tree-pointer-abstract branch from 052d706 to a5855fc Compare February 12, 2025 06:54
from FixedKVNodes

FixedKV(Internal/Leaf)Node inherit parent<->child pointer functions from
linked tree nodes instead.

Signed-off-by: Xuehan Xu <[email protected]>
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-tree-pointer-abstract branch from a5855fc to 51ea374 Compare February 12, 2025 07:00
@xxhdx1985126

Copy link
Copy Markdown
Member Author

Fixing regressions.

@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-tree-pointer-abstract branch 2 times, most recently from ddab2d3 to e789693 Compare February 13, 2025 01:44
@xxhdx1985126 xxhdx1985126 removed the DNM label Feb 13, 2025
@xxhdx1985126

Copy link
Copy Markdown
Member Author

Regressions resolved.

update parameters

BackrefLeafNodes don't any more.

Signed-off-by: Xuehan Xu <[email protected]>
@xxhdx1985126
xxhdx1985126 force-pushed the wip-seastore-tree-pointer-abstract branch from e789693 to 90101c7 Compare February 13, 2025 01:45
@xxhdx1985126

Copy link
Copy Markdown
Member Author

jenkins test api

@cyx1231st

Copy link
Copy Markdown
Member

https://pulpito.ceph.com/yingxin-2025-02-14_02:12:29-crimson-rados-ci-yingxin-seastore-refactor-lbs-distro-default-smithi/

ceph-osd: /home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos9/DIST/centos9/MACHINE_SIZE/gigantic/release/19.3.0-7553-gc4bd9f94/rpm/el9/BUILD/ceph-19.3.0-7553-gc4bd9f94/src/crimson/os/seastore/seastore_types.h:2835: void crimson::os::seastore::cache_size_stats_t::account_out(crimson::os::seastore::extent_len_t):          Assertion `num_extents > 0' failed.

^@xxhdx1985126 Looks like related because it doesn't exist before.

That assert is failed because Cache sees inconsistent number of extents to be added and removed.

I will schedule more repeated tests to double confirm.

@xxhdx1985126

Copy link
Copy Markdown
Member Author

https://pulpito.ceph.com/yingxin-2025-02-14_02:12:29-crimson-rados-ci-yingxin-seastore-refactor-lbs-distro-default-smithi/

ceph-osd: /home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos9/DIST/centos9/MACHINE_SIZE/gigantic/release/19.3.0-7553-gc4bd9f94/rpm/el9/BUILD/ceph-19.3.0-7553-gc4bd9f94/src/crimson/os/seastore/seastore_types.h:2835: void crimson::os::seastore::cache_size_stats_t::account_out(crimson::os::seastore::extent_len_t):          Assertion `num_extents > 0' failed.

^@xxhdx1985126 Looks like related because it doesn't exist before.

That assert is failed because Cache sees inconsistent number of extents to be added and removed.

I will schedule more repeated tests to double confirm.

Looking into it.

@cyx1231st

Copy link
Copy Markdown
Member

@cyx1231st

Copy link
Copy Markdown
Member

@cyx1231st

cyx1231st commented Feb 17, 2025 •

Copy link
Copy Markdown
Member

@cyx1231st

Copy link
Copy Markdown
Member

jenkins test api

3 similar comments
@cyx1231st

Copy link
Copy Markdown
Member

jenkins test api

@xxhdx1985126

Copy link
Copy Markdown
Member Author

jenkins test api

@cyx1231st

Copy link
Copy Markdown
Member

jenkins test api

@cyx1231st
cyx1231st merged commit 3ad8fdc into ceph:main Feb 19, 2025
@Matan-B Matan-B mentioned this pull request Feb 27, 2025
4 of 14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged (Pre Tentacle Freeze)

Development

Successfully merging this pull request may close these issues.

2 participants