Skip to content

Erasure code online consistency checker - #62170

Merged
connorfawcett merged 1 commit into
ceph:mainfrom
connorfawcett:wip-online-consistency-checker-0703
Jul 7, 2025
Merged

connorfawcett merged 1 commit into
ceph:mainfrom
connorfawcett:wip-online-consistency-checker-0703

Conversation

@connorfawcett

@connorfawcett connorfawcett commented Mar 7, 2025 •

Copy link
Copy Markdown
Contributor

This pull request introduces an online version of the consistency checking tool for erasure coded objects in ceph. The objective of the tool is to provide a means of live checking for cases where a parity update has not been properly applied to an EC object. It achieves this by reading back both the data and parity shards of an object that are stored on the OSDs, encoding the data shards and comparing these to the read-in parity shards.

A new inject called a parity read inject is defined in the OSD code. When armed, this new inject will modify the read result of the next read for the specified object so that the entire object is returned to the client, both data and parity chunks combined. A simple command line utility has been added, this takes the pool name, length, offset, oid, block size and stripe unit of a given object, it will then perform a parity read and compare on the object and return a pass or fail result on the command line. It is intended that this checker will be integrated into the IO exerciser as a next step.

This PR includes a first draft of the consistency checker, it is incomplete but I think it is far enough along to be reviewed before spending more time on it. The current implementation supports most good path cases where all shards are available on legacy EC pools. Future commits will provide support for the new EC, LRC, and other edge cases which aren't currently supported.

Integration with the IO exerciser has been implemented in #62985

Small example of the utility, first a failure as the config option is unset, meaning the parity data is not returned:

[root@ceph build]# ceph config set osd bluestore_debug_inject_parity_read false
[root@ceph build]# bin/ceph_ec_consistency_checker --no-mon-config --pool rbd_erasure2 --blocksize 4096 --length 0 --offset 0 --oid ceph2351579-25 --stripeunit 4096
Results:
Object ID ceph2351579-25: Failed
Total: 1 objects checked.

Then, with the config option set:

[root@ceph build]# ceph config set osd bluestore_debug_inject_parity_read true
[root@ceph build]# bin/ceph_ec_consistency_checker --no-mon-config --pool rbd_erasure2 --blocksize 4096 --length 0 --offset 0 --oid ceph2351579-25 --stripeunit 4096
Results:
Object ID ceph2351579-25: Passed
Total: 1 objects checked.

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

@github-actions

github-actions Bot commented Apr 3, 2025

Copy link
Copy Markdown

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

@connorfawcett
connorfawcett force-pushed the wip-online-consistency-checker-0703 branch from b95561c to 7b22d6c Compare April 23, 2025 01:31
@connorfawcett
connorfawcett force-pushed the wip-online-consistency-checker-0703 branch 2 times, most recently from 3caf689 to 3b26dcf Compare April 23, 2025 13:49
@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

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

Primary concern is the last of support for new EC. If you are planning on adding this later, then I think all of the interfaces into ECxxx need to go through ECSwitch, or you are going to have to invent your own form of switcher.

Other than that I have some concerns about the choice of data structures. Its not critical, but I think code could be tidier with some improvements,.

Comment thread src/osd/ECInject.cc Resolved
Comment thread src/osd/ECInject.cc Resolved
Comment thread src/osd/ECInject.cc Resolved
Comment thread src/erasure-code/consistency/ECReader.h Resolved
Comment thread src/common/options/global.yaml.in Resolved
@connorfawcett
connorfawcett force-pushed the wip-online-consistency-checker-0703 branch from 2f6e105 to 4cdf9a6 Compare June 12, 2025 14:02
@connorfawcett

Copy link
Copy Markdown
Contributor Author

@aainscow I've implemented (almost) all of the suggested changes including support for new EC and LRC, would you be able to have another look please? I have not changed the approach of using string OIDs as Bill has suggested I should leave snapshot support as potential future work.

@connorfawcett
connorfawcett requested a review from aainscow June 13, 2025 12:56
@connorfawcett
connorfawcett force-pushed the wip-online-consistency-checker-0703 branch from 4cdf9a6 to 52be9f8 Compare June 24, 2025 12:45

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

Looks Good To Me

@connorfawcett
connorfawcett dismissed aainscow’s stale review June 25, 2025 13:09

Reviewer has LGTM'd latest changes

@connorfawcett

Copy link
Copy Markdown
Contributor Author

jenkins test signed

@connorfawcett

Copy link
Copy Markdown
Contributor Author

jenkins test submodules

@connorfawcett

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@connorfawcett

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@connorfawcett

Copy link
Copy Markdown
Contributor Author

jenkins test api

@connorfawcett

Copy link
Copy Markdown
Contributor Author

jenkins test windows

@connorfawcett
connorfawcett force-pushed the wip-online-consistency-checker-0703 branch from 52be9f8 to 94895bc Compare June 26, 2025 17:33
@connorfawcett

Copy link
Copy Markdown
Contributor Author

Strange linker error showing on the API tests only, but not the make checks. ECEncoderSwitch.cc headers were slightly out of order (ECEncoderSwitch.h was not the first header), not sure that's why it's failed but I've fixed and re-pushed to see what happens

@connorfawcett
connorfawcett force-pushed the wip-online-consistency-checker-0703 branch from 94895bc to c0f29c7 Compare June 26, 2025 23:42
@connorfawcett

Copy link
Copy Markdown
Contributor Author

Retriggering for fresh logs to diagnose

@connorfawcett

Copy link
Copy Markdown
Contributor Author

jenkins test api

@connorfawcett

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

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.

why did you need to go through the 'oss'?

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.

Admittedly I just followed the existing messaging examples. I assumed I needed to flush the formatted JSON out to the oss before passing it to mon_command. Is there another way?

Comment thread src/osd/OSD.cc Resolved
…jects within an erasure coded pool.

A new test-only inject tells the EC backend to return both data and parity shards to the client so that they can
be checked for consistency by the new tool.

Supports both optimized and unoptimized EC pools.

Signed-off-by: Connor Fawcett <[email protected]>
@connorfawcett
connorfawcett force-pushed the wip-online-consistency-checker-0703 branch from c0f29c7 to 14a11de Compare July 4, 2025 17:48
@connorfawcett

connorfawcett commented Jul 4, 2025 •

Copy link
Copy Markdown
Contributor Author

@ronen-fr Thanks for taking the time to review! I think I have addressed everything in the latest push (aside from the oss/JSONFormatter comment which I could use more clarity on).

ETA: Have merged, but can address further comments in future changes as we have more improvements for the consistency checker planned

@connorfawcett

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@connorfawcett
connorfawcett merged commit 98d8c60 into ceph:main Jul 7, 2025
Comment on lines +24 to +26
install(TARGETS
ceph_ec_consistency_checker
DESTINATION ${CMAKE_INSTALL_BINDIR})

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.

it looks like this broke the rpm builds on main https://shaman.ceph.com/builds/ceph/main/

ex https://jenkins.ceph.com/job/ceph-dev-build/ARCH=x86_64,AVAILABLE_ARCH=x86_64,AVAILABLE_DIST=centos9,DIST=centos9,MACHINE_SIZE=gigantic/57985//consoleFull

error: Installed (but unpackaged) file(s) found:
/usr/bin/ceph_ec_consistency_checker
/usr/lib/debug/usr/bin/ceph_ec_consistency_checker-20.3.0-1388.gc706bacd.el9.x86_64.debug

if this is meant to be installed in ceph packages and containers, please add it to one of the packages in ceph.spec.in

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.

6 participants