Skip to content

os/bluestore: stop fragmentation check from stalling writes - #71649

Merged
ifed01 merged 1 commit into
ceph:mainfrom
Nordix:Sunnatillo/fix-bluestore-frag-check-stall
Sep 22, 2026
Merged

ifed01 merged 1 commit into
ceph:mainfrom
Nordix:Sunnatillo/fix-bluestore-frag-check-stall

Conversation

@Sunnatillo

@Sunnatillo Sunnatillo commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

The hourly fragmentation check (bluestore_fragmentation_check_period) calls get_fragmentation_score(), which used foreach() to walk all free extents. foreach() holds the allocator lock the whole time, and writes need that same lock, so on fragmented OSDs writes stalled for over a second.

Use foreach_interruptible() instead. It walks the extents in small batches and only holds the lock for one batch at a time. The score is now a close estimate instead of an exact snapshot, which is fine for a metric. On an idle allocator the result is the same.

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

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.

The hourly fragmentation check (bluestore_fragmentation_check_period)
calls get_fragmentation_score(), which used foreach() to walk all free
extents. foreach() holds the allocator lock the whole time, and writes
need that same lock, so on fragmented OSDs writes stalled for over a
second.

Use foreach_interruptible() instead. It walks the extents in small
batches and only holds the lock for one batch at a time. The score is
now a close estimate instead of an exact snapshot, which is fine for a
metric. On an idle allocator the result is the same.

Fixes: https://tracker.ceph.com/issues/76070
Signed-off-by: Sunnatillo <[email protected]>
@Sunnatillo
Sunnatillo requested a review from a team as a code owner September 9, 2026 11:38
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR ci-approved to allow Jenkins CI jobs to run.

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath10-testing-20260910.230227-main.

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

LGTM! Thanks for making this fix ❤️

@connorfawcett

Copy link
Copy Markdown
Contributor

@ifed01
ifed01 merged commit ea0c61b into ceph:main Sep 22, 2026
21 of 24 checks passed
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.

6 participants