Skip to content

crimson/os/seastore/cache: improve committing allocations by backref entries - #61144

Merged
cyx1231st merged 11 commits into
ceph:mainfrom
cyx1231st:wip-seastore-improve-backref
Dec 26, 2024
Merged

cyx1231st merged 11 commits into
ceph:mainfrom
cyx1231st:wip-seastore-improve-backref

Conversation

@cyx1231st

@cyx1231st cyx1231st commented Dec 19, 2024 •

Copy link
Copy Markdown
Member

This PR is supposed to be cleanup only, reworking #59775.

@zhscn @xxhdx1985126

For the specific issue https://tracker.ceph.com/issues/66941, seems to me propagating remapped extents upon prepare_record() (PR59775) cannot address the issue, because the backref entries of fresh extents are still updated upon complete_commit(), and they have the same issue. And they cannot be simply moved to prepare_record() because their paddrs are unknown at that time.

So, IIUC a new segment state "COMMITTED" is still necessary to fix reclaiming, for both inline and ool segments.

TODO/Draft: still some cleanups to add. Done.

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

Which is used for deallocations.

Signed-off-by: Yingxin Cheng <[email protected]>
Leverage the fact that seq won't go backwards.

Signed-off-by: Yingxin Cheng <[email protected]>
…tent with extents

Generally, make alloc/free be consistent with add/commit/retire extents
in Cache.

Signed-off-by: Yingxin Cheng <[email protected]>
Signed-off-by: Zhang Song <[email protected]>
@xxhdx1985126 xxhdx1985126 self-assigned this Dec 20, 2024
@cyx1231st
cyx1231st marked this pull request as ready for review December 20, 2024 08:28
@cyx1231st
cyx1231st requested a review from a team as a code owner December 20, 2024 08:28
@cyx1231st
cyx1231st force-pushed the wip-seastore-improve-backref branch from 5a6391d to b6d9793 Compare December 23, 2024 03:35
@github-actions github-actions Bot added the tests label Dec 23, 2024
@cyx1231st

Copy link
Copy Markdown
Member Author

Changeset: fix compile issues in UT.

@cyx1231st

Copy link
Copy Markdown
Member Author

jenkins test api

@cyx1231st

Copy link
Copy Markdown
Member Author

jenkins test make check arm64

@cyx1231st

Copy link
Copy Markdown
Member Author

@xxhdx1985126 xxhdx1985126 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 otherwise:-)

Comment thread src/crimson/os/seastore/cache.cc Resolved
@zhscn

zhscn commented Dec 23, 2024 •

Copy link
Copy Markdown
Member

// Note: commit extents and backref allocations in the same place
DEBUGT("backref_entry alloc existing {} len 0x{:x}",
t,
i->get_paddr(),
i->get_length());
backref_entries.emplace_back(
backref_entry_t::create_alloc(
i->get_paddr(),
i->cast<LogicalCachedExtent>()->get_laddr(),
i->get_length(),
i->get_type()));

The backref changes of existing blocks should also be moved to Cache::prepare_recored(), otherwise the GC trans would believe these remapped extents have been released completely.

@cyx1231st

Copy link
Copy Markdown
Member Author

Discussed with @zhscn: remapping has 2 steps, retire and alloc, they must be committed atomically together, either in complete_commit() or prepare_record().

@cyx1231st
cyx1231st force-pushed the wip-seastore-improve-backref branch from b6d9793 to be494cd Compare December 24, 2024 02:38
@cyx1231st

Copy link
Copy Markdown
Member Author

Changeset: crimson/os/seastore/cache: move committing existing blocks to prepare_record()

@zhscn compared with the original PR, for existing extents, I also moved add_extent() related logic to prepare_record().

@cyx1231st cyx1231st changed the title crimson/os/seastore/cache: cleanup allocation updates crimson/os/seastore/cache: improve committing allocations by backref entries Dec 24, 2024
@zhscn

zhscn commented Dec 24, 2024

Copy link
Copy Markdown
Member

LGTM

By introducing a callback upon completing submission.

Signed-off-by: Yingxin Cheng <[email protected]>
…_record()

So the 2 steps of remapping are atomically committed.

Signed-off-by: Yingxin Cheng <[email protected]>
Signed-off-by: Zhang Song <[email protected]>
@cyx1231st
cyx1231st force-pushed the wip-seastore-improve-backref branch from be494cd to 93df0b3 Compare December 24, 2024 08:33
@cyx1231st

Copy link
Copy Markdown
Member Author

Changeset: fix a wrong assertion related to extent state.

@cyx1231st

Copy link
Copy Markdown
Member Author

jenkins test docs

@cyx1231st
cyx1231st merged commit e9a0de8 into ceph:main Dec 26, 2024
@cyx1231st
cyx1231st deleted the wip-seastore-improve-backref branch December 26, 2024 07:27
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.

3 participants