Skip to content

osd: count and log the EC direct reads that bounce to the primary - #73176

Open
mmgaggle wants to merge 2 commits into
ceph:mainfrom
mmgaggle:wip-kbader-ec-direct-read-bounces
Open

mmgaggle wants to merge 2 commits into
ceph:mainfrom
mmgaggle:wip-kbader-ec-direct-read-bounces

Conversation

@mmgaggle

Copy link
Copy Markdown
Member

Summary

Since #72292, an EC direct read that fails with EIO on its shard goes back to the client with EAGAIN. The client then sends the read to the primary, which decodes the data from the other shards. Only a debug log line shows such a bounce, so a damaged shard that clients read again and again stays hidden.

  • The shard counts each bounce in the new perf counter ec_direct_read_redirect_eio, and writes it to the OSD log.
  • The cluster log gets a warning at the 1st, 2nd, 4th and 8th bounce of each PG, and at each later power of two. A damaged shard thus does not flood the cluster log.
  • If fiemap fails with EIO, a sparse direct read also bounces.
  • A sparse direct read skips the whole-object digest check, because the digest does not cover the chunks of one shard.

The answer to the client still comes from rep_repair_primary_object(), as in #72292. direct_reads.rst describes the bounce.

Testing

With only this change on main 169a0fb, the new tests in test-erasure-eio.sh pass, and so does TEST_ec_direct_read_eio from #72292:

  • TEST_rados_get_direct_read_eio_shard_0
  • TEST_rados_get_direct_read_eio_shard_1
  • TEST_rados_get_direct_read_eio_single_chunk
  • TEST_rbd_export_direct_read_eio_sparse

The tests inject the error into the data of a shard. No test covers the fiemap case.

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)

bounces the read with ``EAGAIN``, as it does for a missing object, and the
Objecter reissues it to the primary as a normal read, which decodes the data
from the other shards. The shard counts each such bounce in the
``ec_direct_read_redirect_eio`` OSD perf counter and writes it to the OSD log.

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 think the first OSD is superfluous

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.

(claude response) Dropped it in fd93114.

aainscow added a commit to mmgaggle/ceph that referenced this pull request Nov 26, 2026
Review comment from Anthony D'Atri on ceph#73176:
"I think the first `OSD` is superfluous".

Assisted-by: Claude Code
mmgaggle and others added 2 commits November 27, 2026 13:59
Since 0f17b4c (ceph#72292), an EC direct read that fails with EIO on
its shard goes back to the client with EAGAIN. The client then sends
the read to the primary, which decodes the data from the other shards.
Only a debug log line shows such a bounce, so a damaged shard that
clients read again and again stays hidden.

Now the shard counts each bounce in the new perf counter
ec_direct_read_redirect_eio, and writes it to the OSD log. The cluster
log gets the 1st, 2nd, 4th, 8th and later bounces of each PG. If fiemap
fails with EIO, a sparse direct read also bounces. A sparse direct read
also skips the whole-object digest check, because the digest does not
cover the chunks of one shard.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Kyle Bader <[email protected]>
Signed-off-by: Alex Ainscow <[email protected]>
Review comment from Anthony D'Atri on ceph#73176:
"I think the first `OSD` is superfluous".

Assisted-by: Claude Code
Signed-off-by: Alex Ainscow <[email protected]>
@aainscow
aainscow force-pushed the wip-kbader-ec-direct-read-bounces branch from fd93114 to b097328 Compare November 27, 2026 13:59
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.

3 participants