Skip to content

umbrella: tools/cephfs: allow scanning and flushing journal in batches - #70275

Merged
batrick merged 5 commits into
ceph:umbrellafrom
dparmar18:wip-78289-umbrella
Aug 5, 2026
Merged

batrick merged 5 commits into
ceph:umbrellafrom
dparmar18:wip-78289-umbrella

Conversation

@dparmar18

Copy link
Copy Markdown
Contributor

backport of #68813
backport tracker: https://tracker.ceph.com/issues/78289
parent tracker: https://tracker.ceph.com/issues/76422

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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

dparmar18 and others added 5 commits July 17, 2026 14:30
NOTE: exclusive to only `event recover_dentries`

JournalScanner::scan() runs a loop and loads the entire decoded journal in an
`EventMap` called `events`. This can severely shoot up the RSS if the journal
is huge (unflushed journal) making the tool less efficient.

The way to curb the memory bomb is to scan and flush journal in batches. The
flush boundary is based on the batch size and at event EVENT_SUBTREEMAP or
EVENT_SUBTREEMAP_TEST(subtree event(s) mark a clear boundary). The knob to
control this setting is via providing `--max-rss <bytes>` with the journal
tool command. This patch divides the provided limit by three to create the
batch since it is observed that the decoded journal events weight on an avg
~3x the encoded stream.

Also: Currently, the events map retains all decoded events until all dentries
are recovered, causing unnecessary memory retention.

Fix this by erasing each event from the map right after it is processed.
While the primary RSS bloat is caused by dnbl holding the encoded stream
in memory, this incremental cleanup provides a minor optimization until
a permanent fix is implemented (https://tracker.ceph.com/issues/77909).

Partially-Fixes: https://tracker.ceph.com/issues/76422

Co-authored-by: Patrick Donnelly <[email protected]>
Signed-off-by: Dhairya Parmar <[email protected]>
(cherry picked from commit aa2db56)
iIf the journal pointer and/or header is missing or corrupt, the tool silently
returns with no-op. There is no dentry recovery happening if any of the objects
are missing but it should be explicit to the user.

This still doesn't change returning errnos on failures to maintain status quo
until https://tracker.ceph.com/issues/77913 is addressed

One important change: The condition to scan events is now changed from
header_present to header_valid. The reason for this can be understood by
reading JournalScanner::scan_header -- if the header could not be decoded, it
is set to null, using this in JournalTool::recover_dentries would segfault and
other corruptions include bad magic or inconsistent offsets. A recovery should
not proceed with distorted magic/offset.

Fixes: https://tracker.ceph.com/issues/76422
Signed-off-by: Dhairya Parmar <[email protected]>
(cherry picked from commit 0e9af4b)
@dparmar18
dparmar18 requested a review from a team July 17, 2026 09:02
@dparmar18
dparmar18 requested a review from a team as a code owner July 17, 2026 09:02
@github-actions github-actions Bot added this to the umbrella milestone Jul 17, 2026
@github-actions github-actions Bot added the releng-audit-pass Release engineering: passed backport verification audit. label Jul 17, 2026
@batrick batrick added needs-qa cephfs Ceph File System and removed cephfs Ceph File System labels Jul 29, 2026
@batrick batrick modified the milestones: umbrella, v21.1.1 Jul 29, 2026
@yuriw yuriw added wip-yuri5-testing and removed cephfs Ceph File System labels Aug 3, 2026
@yuriw

yuriw commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri5-testing-20260803.135213-umbrella.

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

@batrick
batrick merged commit f8b131a into ceph:umbrella Aug 5, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation needs-qa releng-audit-pass Release engineering: passed backport verification audit. tests wip-yuri5-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants