Skip to content

crimson/os/seastore: introduce static layout of laddr_t - #59476

Merged
xxhdx1985126 merged 29 commits into
ceph:mainfrom
zhscn:wip-new-128
May 26, 2026
Merged

xxhdx1985126 merged 29 commits into
ceph:mainfrom
zhscn:wip-new-128

Conversation

@zhscn

@zhscn zhscn commented Aug 28, 2024 •

Copy link
Copy Markdown
Member

This PR is based on #59182 and implement the design at #55291 (comment)

Fixes: https://tracker.ceph.com/issues/67428

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

@cyx1231st

Copy link
Copy Markdown
Member

Make check compile is failed.

@cyx1231st
cyx1231st self-requested a review September 2, 2024 06:27
@zhscn

zhscn commented Sep 2, 2024

Copy link
Copy Markdown
Member Author

Compile passed in my gcc 14 envrionment, seems clang-14 doesn't support some features.

@cyx1231st

Copy link
Copy Markdown
Member

Currently, I think we should use the subset of working features of both gcc and clang. And we cannot merge PRs that will fail make check or ceph builds.

@zhscn

zhscn commented Sep 2, 2024

Copy link
Copy Markdown
Member Author

Yeah, still looking which part caused failure.

@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 in the commit order, let's align the layout/calculations first.

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

@zhscn

zhscn commented Sep 4, 2024 •

Copy link
Copy Markdown
Member Author

NODE_CAPACITY related changes has been moved to #59570

I'm not familiar with test_staged_fltree, @xxhdx1985126 please take a look.

static_assert(sizeof(gen_t) == sizeof(ghobject_t().generation));

/**
* laddr_t

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 think that, once settled, the comment here deserves a dedicated page in the docs. We could also include there the original design idea from #55291 (comment). Referring there should be easier to understand/follow.

@zhscn

zhscn commented Sep 13, 2024

Copy link
Copy Markdown
Member Author

The latest layout is:

[upgrade:1][shard:6][pool:12][reverse_hash:16][local_object_id:42][local_clone_id:23][is_metadata:1][blocks:27]

* ObjectDataBlock.
*
* This layout allows:
* 1. 2^23/2=4M clones per object(taking a snapshot will consume 2 clone ids)

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.

Why taking a snapshot will consume 2 clone ids?

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.

Taking snapshots is a symmetric process for both the clone onode and the head onode. The two new base laddr of them will reference the old head address space.

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.

OK, I think the basic version needs 2 clone ids per clone operation.

In a longer term, probably it's possible to save clone ids from the unmodified clones.

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.

it's possible to save clone ids from the unmodified clones.

What does "unmodified clones" refer to?

@cyx1231st cyx1231st Sep 24, 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.

Meaning it isn't modified since being cloned, I think such a clone doesn't need another dedicated clone id in theory, even if the clone implementation is symmetric, right?

@zhscn zhscn Sep 24, 2024 •

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.

Meaning it isn't modified since being cloned,

Seems this case is handled by the SnapSet of the object in PG layer? When two clones are same, the seastore won't do clone process, and when cloning started in seastore, there must be changes between two clones in SnapSet.

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.

(extended discussion, probably sidetracked)

I meant this is seastore internal and is related to how local-clone-id are assigned. IIUC in a simple version, during a symmetric seastore clone operation, 2 new local-clone-ids will be generated immediately and assigned to the new clone and the head. Seems to me it might be possible to save the local-clone-ids by delaying the local-clone-id allocation until the clone/head is actually modified by the seastore user.

@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 in the commit order.

@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

@zhscn

zhscn commented Oct 14, 2024 •

Copy link
Copy Markdown
Member Author

Changes:

  1. The size of reverse_hash is now 32 bits. After moving SeastoreNodeExtent out of the global metadata address space, both the 16-bit and 32-bit designs provide the same semantics about crush. Maintaining it at 32 bits simplifies the code.

  2. The SeastoreNodeExtent will use the shard,pool,crush,0,0 laddr prefix for its address space. The extents of the rados object should not use this prefix as its clone prefix (see comments in laddr_t for details).

  3. The original laddr_conflict_level_t::never has been moved to laddr_conflict_policy_t to address cases where allocation should never conflict.

  4. Add unit test for the implementation of the conflict policy in LBAManager.

  5. get_prev_cursor for the onode manager.

  6. Correct the parameters in test_staged_fltree.

@zhscn
zhscn force-pushed the wip-new-128 branch 2 times, most recently from 61cd58e to b5980ee Compare October 14, 2024 09:39

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

zhscn added 3 commits May 24, 2026 12:06
… to omap root in OMapInnerNode

Signed-off-by: Zhang Song <[email protected]>
Signed-off-by: Xuehan Xu <[email protected]>
@xxhdx1985126

Copy link
Copy Markdown
Member

Rebased.

@xxhdx1985126

Copy link
Copy Markdown
Member

jenkins test make check

@xxhdx1985126

Copy link
Copy Markdown
Member

jenkins test make check arm64

xxhdx1985126 and others added 14 commits May 25, 2026 16:55
This is consistent with classic osds

Signed-off-by: Xuehan Xu <[email protected]>
transactions when committing background rewriting transactions

With the 128-bit laddr key layout in place, SeaStore::rename would
involve copying mappings. These mappings must also be updated when
the logical extents they point to are rewritten.

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

xxhdx1985126 commented May 25, 2026 •

Copy link
Copy Markdown
Member

@Matan-B @jdurgin Hi, if no further concerns, I'll merge this PR tomorrow. Please let me know if you have any comments to make, thanks:-)

@Matan-B

Matan-B commented May 25, 2026 •

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

The following tests FAILED:
	261 - unittest_rgw_amqp (Failed)

@Matan-B

Matan-B commented May 25, 2026

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

1 similar comment
@xxhdx1985126

Copy link
Copy Markdown
Member

jenkins test make check arm64

@xxhdx1985126

Copy link
Copy Markdown
Member

The following tests FAILED:
273 - unittest_posix_bucket_cache (Timeout)

@xxhdx1985126

Copy link
Copy Markdown
Member

jenkins test make check arm64

@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/26434523361

@ronen-fr

ronen-fr commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

@xxhdx1985126 - please take a look at Teuthology test 237742. The failure there seems to be related to this PR.
Per Claude analysis (see full details in tracker 76945):

The assertion fails because get_child_sync requires the child node to already be linked in the parent's children array. That array is initialized to nullptrs and only populated as children are accessed via link_child. When update_paddr_sync is called on a reader transaction, it traverses the LBA tree toward the destination laddr. If the reader never traversed that particular tree path before, the internal nodes along that path will have nullptr children — regardless of load.

The bug is purely a logic error: get_child_sync (which asserts all children are loaded) is used in a context where they may not be. The async get_child handles this by falling back to loading from disk or looking up the stable parent, but the sync variant just crashes.

Can get_child_sync be made to handle missing entries synchronously?

Partially. The stable-parent fallback in get_child (lines 359-368) is pure in-memory work — no I/O needed. You could add that path to get_child_sync:

auto child = children[pos];
ceph_assert(!is_reserved_ptr(child));
if (is_valid_child_ptr(child)) {
return static_cast<ChildT*>(child);
} else if (me.is_pending()) {
auto &sparent = me.get_stable_for_key(key);
auto spos = sparent.lower_bound(key).get_offset();
auto child = sparent.children[spos];
ceph_assert(is_valid_child_ptr(child)); // must be loaded in stable
return static_cast<ChildT*>(child);
}
But if the node is stable and the child is nullptr, you're stuck — loading it requires maybe_get_absent_extent, which is async disk I/O. You can't do that synchronously without blocking the seastar reactor.

The deeper question is whether the fix belongs in get_child_sync at all, or whether the mechanism in _copy_mapping/maybe_sync_copied_lba_key needs rethinking — since it's calling a sync tree traversal on a reader transaction that may have an incomplete tree view. The transaction that actually created the copy mapping would have all the nodes loaded, but the callback runs on a different transaction.

@bluikko

bluikko commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Hello. This PR added a new docs file doc/dev/crimson/seastore_laddr.rst which is not included in the docs toctree. While that is not a problem per se, the document is not discoverable and Sphinx will issue a warning on docs build:

/home/docs/checkouts/readthedocs.org/user_builds/ceph/checkouts/70057/doc/dev/crimson/seastore_laddr.rst: WARNING: document isn't included in any toctree

I am trying to fix all these warnings and I propose to add it to the toctree in file doc/dev/crimson/index.rst.
Alternatively, I can mark the file as orphan to simply silence the warning.
Please let me know if you prefer to leave the seastore_laddr.rst file outside of the toctree. A simple +1 / -1 on this comment or approval on the relevant PR would be appreciated. The proposed change is #70058.

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.