Skip to content

crimson/osd/pg_backend.cc: fallback sparse_read on normal read - #72105

Merged
shraddhaag merged 1 commit into
ceph:mainfrom
shraddhaag:wip-shraddhaag-sparse-read-fallback
Sep 30, 2026
Merged

shraddhaag merged 1 commit into
ceph:mainfrom
shraddhaag:wip-shraddhaag-sparse-read-fallback

Conversation

@shraddhaag

@shraddhaag shraddhaag commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

This commit adds a fallback to normal read when a sparse read is done on an EC pool in crimson. Once direct reads is implemented in crimson, sparse reads will work as expected.

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

Testing

QA: https://pulpito.ceph.com/shraddhaag-2026-09-26_19:08:02-crimson-rados-wip-shraddhaag-sparse-read-fallback-distro-debug-trial/.

All three jobs passed TestClsRbd.sparse_copyup/FastEC. The bluestore job also passed TestClsRbd.sparsify/FastEC. Before the seastore ones could reach TestClsRbd.sparsify/FastEC, the OSD crashed due to an unrelated error: https://tracker.ceph.com/issues/80920

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

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@shraddhaag

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@shraddhaag
shraddhaag marked this pull request as ready for review September 27, 2026 04:11
@shraddhaag
shraddhaag requested a review from a team as a code owner September 27, 2026 04:11

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

The two failures seem to be around calc_crc32c. Could this issue relate to EC tests?
Classic do_sparse_read seem to try to repair the object in this case.

    // Why SPARSE_READ need checksum? In fact, librbd always use sparse-read.
    // Maybe at first, there is no much whole objects. With continued use, more
    // and more whole object exist. So from this point, for spare-read add
    // checksum make sense.
    if ((uint64_t)r == oi.size && oi.is_data_digest()) {
      uint32_t crc = data_bl.crc32c(-1);
      if (oi.data_digest != crc) {
        osd->clog->error() << info.pgid << std::hex
          << " full-object read crc 0x" << crc
          << " != expected 0x" << oi.data_digest
          << std::dec << " on " << soid;
        r = rep_repair_primary_object(soid, ctx);

os.oi.soid, (uint64_t)op.extent.offset, (uint64_t)op.extent.length);

if (is_erasure()) {
// TODO: implement sparse read properly for EC pools with direct reads.

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.

Can we reference a todo tracker here please?

@Matan-B Matan-B added this to Crimson Sep 27, 2026
@Matan-B Matan-B moved this to In Progress in Crimson Sep 27, 2026

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

@shraddhaag

Copy link
Copy Markdown
Contributor Author

The two failures around calc_crc32c are not related to this change. They are fixed in: #72217.

Classic do_sparse_read seem to try to repair the object in this case.

The fallback path I added uses _read_verify_data to establish the object is not corrupted and fails if it is. This is used by both EC and replicated read paths. There is a todo in _read_verify_data: // todo: mark soid missing, perform recovery, and retry, meaning we need to add the repair of this object. I created a tracker for this: https://tracker.ceph.com/issues/81150 and will address this in a separate PR.

This commit adds a fallback to normal read when a sparse read is done on
an EC pool in crimson. Once direct reads is implemented in crimson,
sparse reads will work as expected.

Fixes: https://tracker.ceph.com/issues/80698
Signed-off-by: Shraddha Agrawal <[email protected]>
@shraddhaag
shraddhaag force-pushed the wip-shraddhaag-sparse-read-fallback branch from 42361b5 to b736487 Compare September 30, 2026 05:04
@shraddhaag
shraddhaag merged commit bb83416 into ceph:main Sep 30, 2026
14 checks passed
@github-actions

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I found one or more Fixes: tags in the commit messages in

git log bb83416e17b86320edd2b66da3cda03b8e108228^..bb83416e17b86320edd2b66da3cda03b8e108228

The referenced tickets are:

Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them.

Update Log: https://github.com/ceph/ceph/actions/runs/36687561354

@Matan-B Matan-B moved this from In Progress to Merged (Main) in Crimson Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Merged (Main)

Development

Successfully merging this pull request may close these issues.

3 participants