Skip to content

crimson/osd: fix backfill deadlock when only delete operations remain - #69942

Merged
ronen-fr merged 1 commit into
ceph:mainfrom
ronen-fr:wip-rf-339463backfl
Jul 9, 2026
Merged

ronen-fr merged 1 commit into
ceph:mainfrom
ronen-fr:wip-rf-339463backfl

Conversation

@ronen-fr

@ronen-fr ronen-fr commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

BackfillState::Waiting requires an ObjectPushed event to transition back to Enqueuing, but
drop (remove) operations are fire-and-forget and never generate ObjectPushed. When a
backfill round enqueues only drops and no pushes, the FSM permanently stalls in the
Waiting state, holding the backfill reservation and blocking all other PGs from backfilling to that OSD.

Fix by adding a pending-pushes counter to ProgressTracker to distinguish "only drops remain"
from "pushes still in-flight". When all pushes are complete and the namespace is exhausted,
drain remaining drop entries and advance last_backfill to MAX so that OP_BACKFILL_FINISH
triggers the normal completion path via RequestDone.

The classic OSD avoids this by design: drops are never tracked as in-flight operations in
recover_backfill() and are drained inline.

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

BackfillState::Waiting requires an ObjectPushed event to transition
back to Enqueuing, but drop (remove) operations are fire-and-forget
and never generate ObjectPushed. When a backfill round enqueues only
drops and no pushes, the FSM permanently stalls in the Waiting state,
holding the backfill reservation and blocking all other PGs from
backfilling to that OSD.

Fix by adding a pending-pushes counter to ProgressTracker to
distinguish "only drops remain" from "pushes still in-flight". When
all pushes are complete and the namespace is exhausted, drain remaining
drop entries and advance last_backfill to MAX so that
OP_BACKFILL_FINISH triggers the normal completion path via
RequestDone.

The classic OSD avoids this by design: drops are never tracked as
in-flight operations in recover_backfill() and are drained inline.

Fixes: https://tracker.ceph.com/issues/77936
Assisted-by: Claude <claude.ai>
Signed-off-by: Ronen Friedman <[email protected]>
@ronen-fr
ronen-fr requested a review from a team as a code owner July 5, 2026 12:35
@ronen-fr
ronen-fr requested review from Matan-B and shraddhaag July 5, 2026 12:35
@ronen-fr ronen-fr changed the title crimson/osd: fix backfill deadlock when only drop operations remain crimson/osd: fix backfill deadlock when only delete operations remain Jul 5, 2026
@ronen-fr

ronen-fr commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test api

@ronen-fr

ronen-fr commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test windows

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

This looks like a similar issue to - #69824. right?
Can you please take a look to see if the two are related? Thanks!

@Matan-B
Matan-B requested a review from mohit84 July 6, 2026 09:06
@Matan-B Matan-B added this to Crimson Jul 6, 2026
@Matan-B Matan-B moved this to Awaits review in Crimson Jul 6, 2026
@ronen-fr

ronen-fr commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@Matan-B

Can you please take a look to see if the two are related? Thanks!

My understanding (at this time, with no access this morning to the logs) is that my fix solves the actual problem that created the resource exhaustion, while Mohit's improves the handling of no-resources in general (but will not solve the specific case solved here).

@mohit84

mohit84 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Fix by adding a pending-pushes counter to ProgressTracker to distinguish "only drops remain" from "pushes still in-flight". When all pushes are complete and the namespace is exhausted, drain remaining drop entries and advance last_backfill to MAX so that OP_BACKFILL_FINISH triggers the normal completion path via RequestDone.

The classic OSD avoids this by design: drops are never tracked as in-flight operations in recover_backfill() and are drained inline.

I agree with Ronen, BudgetBlocked is not appropriate in this case.

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

Makes sense. Thanks, @ronen-fr.

@ronen-fr

ronen-fr commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Merging based on my Teuthology tests. 4 failures - all unrelated.

@ronen-fr
ronen-fr merged commit 7071fdc into ceph:main Jul 9, 2026
8 of 10 checks passed
@ronen-fr
ronen-fr deleted the wip-rf-339463backfl branch July 9, 2026 06:45
@github-actions

github-actions Bot commented Jul 9, 2026

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/28999539640

@Matan-B Matan-B moved this from Awaits review to Merged (Main) in Crimson Jul 9, 2026
@ronen-fr ronen-fr added bug-fix needs-umbrella-backport This PR should be backported to Umbrella labels Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix crimson needs-umbrella-backport This PR should be backported to Umbrella

Projects

Status: Merged (Main)

Development

Successfully merging this pull request may close these issues.

4 participants