Skip to content

crimson/osd/pg_recovery: call MOSDPGRecoveryDelete instead of MOSDPGBackfillRemove - #67925

Merged
Matan-B merged 1 commit into
ceph:mainfrom
shraddhaag:wip-shraddhaag-use-pgrecoverydelete
Mar 31, 2026
Merged

Matan-B merged 1 commit into
ceph:mainfrom
shraddhaag:wip-shraddhaag-use-pgrecoverydelete

Conversation

@shraddhaag

@shraddhaag shraddhaag commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

This is the same as described in #67488.

Additionally, the client request comes before enqueue_push invokes for our object. Which means, when the client request arrives, the object is not being backfilled, so is_degraded_or_backfilling_object does not block the client request.

Solution

This PR solves this problem by doing 2 things:

  1. In client request path: When a delete operation encounters that object being deleted is missing on peer, instead of issuing a MOSDPGBackfillRemove, we issue a MOSDPGRecoveryDelete. Unlike the prior message, MOSDPGRecoveryDelete sends a reply.
  2. In backfill path: In recover_object, if the object is found to be deleted on primary, we abort recovery. Instead, we check if there are any pushes for this object and if so, we wait for the MOSDPGRecoveryDeleteReply. Once the replies are received, the backfill state machine invokes on_peer_recover, thus clearing the stale peer_missing entries. Finally it called on_global_recover and exits.

The solution is visualised here, for https://pastebin.com/raw/1XtHEFjM:

Screenshot 2026-03-31 at 12 07 29 AM

QA Runs:

The following QA runs validate the solution:

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.

@shraddhaag shraddhaag changed the title crimson/osd/pg_recovery: call MOSDPGRecoveryDelete instead of MOSDPGBackfillRemove [WIP] crimson/osd/pg_recovery: call MOSDPGRecoveryDelete instead of MOSDPGBackfillRemove Mar 20, 2026
@shraddhaag
shraddhaag force-pushed the wip-shraddhaag-use-pgrecoverydelete branch from a3095af to 8bae940 Compare March 24, 2026 07:06
@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

@shraddhaag
shraddhaag force-pushed the wip-shraddhaag-use-pgrecoverydelete branch 10 times, most recently from f3891d8 to 7633c9b Compare March 30, 2026 19:12
@shraddhaag
shraddhaag marked this pull request as ready for review March 30, 2026 19:18
@shraddhaag
shraddhaag requested a review from a team as a code owner March 30, 2026 19:18

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

Looks like a nice simple way to solve this with existing infrastructure! Thanks for the detailed diagram as well.

As I was reviewing I noticed an old TODO in this area:

https://github.com/ceph/ceph/blob/main/src/crimson/osd/pg.cc#L1824

  // TODO: should consider async recovery cases in the future which are not supported

@Matan-B @xxhdx1985126 is this TODO still relevant?

@shraddhaag shraddhaag changed the title [WIP] crimson/osd/pg_recovery: call MOSDPGRecoveryDelete instead of MOSDPGBackfillRemove crimson/osd/pg_recovery: call MOSDPGRecoveryDelete instead of MOSDPGBackfillRemove Mar 31, 2026
@shraddhaag
shraddhaag force-pushed the wip-shraddhaag-use-pgrecoverydelete branch from 7633c9b to 3211f41 Compare March 31, 2026 05:51
@Matan-B

Matan-B commented Mar 31, 2026

Copy link
Copy Markdown
Contributor

Looks like a nice simple way to solve this with existing infrastructure! Thanks for the detailed diagram as well.

As I was reviewing I noticed an old TODO in this area:

https://github.com/ceph/ceph/blob/main/src/crimson/osd/pg.cc#L1824

// TODO: should consider async recovery cases in the future which are not supported
@Matan-B @xxhdx1985126 is this TODO still relevant?

Yes, the tracker for this todo is https://tracker.ceph.com/issues/70677. Most of the groundwork is there, we could try reviving my PR.

@Matan-B Matan-B added this to Crimson Mar 31, 2026
@Matan-B Matan-B moved this to Tested in Crimson Mar 31, 2026
@shraddhaag

Copy link
Copy Markdown
Contributor Author

jenkins test api

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

Generally LGTM but please see the comment below.

LOG_PREFIX(PGRecovery::send_recovery_deletes);
DEBUGDPP("obj={}", *pg->get_dpp(), obj);
if (!pg->get_recovery_backend()->is_recovering(obj)) {
return;

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.

Please a debug for this early exit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, added a debug for this!

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.

Thank you!

…ackfillRemove

This commit fixes the abort in Recovered::Recovered.

There is a race to acquire the OBC lock between backfill and
client delete for the same object.

When the lock is acquired first by the backfill, the object is
recovered first, and then deleted by the client delete request.
When recovering the object, the corresponding peer_missing entry
is cleared and we are able to transition to Recovered state
successfully.

When the lock is acquired first by client delete request, the
object is deleted. Then backfill tries to recover the object,
finds it deleted and exists early. The stale peer_missing
entry is not cleared. In Recovered::Recovered, needs_recovery()
sees this stale peer_missing entry and calls abort.

The issue is fixed by sending MOSDPGRecoveryDelete from the client
path to peers and waiting for MOSDPGRecoveryDeleteReply in
recover_object.

Fixes: https://tracker.ceph.com/issues/70501
Signed-off-by: Shraddha Agrawal <[email protected]>
@shraddhaag
shraddhaag force-pushed the wip-shraddhaag-use-pgrecoverydelete branch from 3211f41 to 011f9d6 Compare March 31, 2026 09:54
@Matan-B
Matan-B merged commit 908f2bc into ceph:main Mar 31, 2026
6 checks passed
@Matan-B Matan-B moved this from Tested to Merged (Main) in Crimson Mar 31, 2026
@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/23799216386

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.

4 participants