Skip to content

osd: don't try to rapair-on-read on non-primary OSDs - #69234

Closed
rzarzynski wants to merge 1 commit into
ceph:mainfrom
rzarzynski:wip-bug-76957
Closed

rzarzynski wants to merge 1 commit into
ceph:mainfrom
rzarzynski:wip-bug-76957

Conversation

@rzarzynski

Copy link
Copy Markdown
Contributor

Balanced reads can happen on non-primaries while only primaries are capabale of rapairing damaged objects-on-the-fly. Since the patch non-primaries, instead of asserting, return EIO when a corrupted objected is encountered.

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

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.

Balanced reads can happen on non-primaries while only primaries
are capabale of rapairing damaged objects-on-the-fly.
Since the patch non-primaries, instead of asserting,
return `EIO` when a corrupted objected is encountered.

Fixes: https://tracker.ceph.com/issues/76957
Signed-off-by: Radoslaw Zarzynski <[email protected]>
@rzarzynski
rzarzynski requested a review from a team as a code owner June 2, 2026 11:08
@github-actions github-actions Bot added the core label Jun 2, 2026
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

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

Small nit: fix the typo in the commit message:

osd: don't try to rapair-on-read on non-primary OSDs

rapair --> repair

Otherwise, LGTM

@ljflores

Copy link
Copy Markdown
Member

Needs a rebase though.

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

I don't think that skipping the repair of the primary object is good enough. This means that a balanced/localized read issued to a replica shard that encounters a media error will be failed back to the client and the application without trying to use the other copies.

I think we should be failing the read with EAGAIN to the client so that it retries the request to the primary. The primary can then make sure that all copies of the data have been tried before giving up on the read.

It is probably more elegant to make this change inside rep_repair_primary_object. Something like this:

@@ -15964,7 +15964,16 @@ int PrimaryLogPG::rep_repair_primary_object(const hobject_t& soid, OpContext *ct
   OpRequestRef op = ctx->op;
   // Only supports replicated pools
   ceph_assert(!pool.info.is_erasure());
-  ceph_assert(is_primary());
+
+  if (!is_primary()) {
+    // Must be a balanced/localized read that has failed on a replica.
+    // Replicas cannot run recovery, so the request need to be
+    // failed with EAGAIN to the client which will then retry the
+    // request to the primary
+    dout(10) << __func__ << " not primary, failing op with EAGAIN" << dendl;
+    osd->reply_op_error(op, -EAGAIN);
+    return -EAGAIN;
+  }

@bill-scales

Copy link
Copy Markdown
Contributor

See #70909 for suggested alternative fix

@ljflores

ljflores commented Oct 1, 2026

Copy link
Copy Markdown
Member

Maybe this should be closed since #70909 was merged?

@RaminNietzsche

Copy link
Copy Markdown
Member

Category: already-in-base (medium)

The same tracker issue appears addressed on main by 1f76768 (2026-08-07) in src/osd/PrimaryLogPG.cc ("rep_repair_primary_object…"). Worth checking whether this PR still adds net-new behavior before spending review cycles.


pr-triage note — automated candidate for human review only, not a maintainer decision. Snapshot 2026-11-10 against open PR bases. pr-triage is a personal read-only assistant by @RaminNietzsche; not affiliated with or endorsed by the Ceph project. Please verify (rebase, git cherry, tracker) before acting.

@aainscow

Copy link
Copy Markdown
Contributor

I am closing because the same issue if fixed in main and the associated tracker has been redirected to #70909

@aainscow aainscow closed this Nov 26, 2026
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.

5 participants