Skip to content

osd: PGLog Attach correct version to missing list when ignoring log entries - #67870

Merged
aainscow merged 2 commits into
ceph:mainfrom
aainscow:fix_75211
May 6, 2026
Merged

aainscow merged 2 commits into
ceph:mainfrom
aainscow:fix_75211

Conversation

@aainscow

@aainscow aainscow commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

A previous fix for PR 66698 fixed an issue where log entries associated with partial writes were being processed incorrectly (see that PR and associated tracker for details). The fix was to ignore log entries that should not have been present on the non-primary shard.

The problem with that approach is that in a more complex scenario, where the log contained a partial write, followed by a full write AND the shard is backfilling, then the missing list was being given the version prior to the full write, rather than prior to the clone.

Our fix here corrects how the missing list version is calculated.

See the associated tracker for instructions on how to recreate

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

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.

@github-actions github-actions Bot added the core label Mar 18, 2026
@aainscow

Copy link
Copy Markdown
Contributor Author

Note: Bug reproducer is in tracker

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

LGTM. Fixes problem found a couple of times in Teuthology and reproduced with error inject script.

It should be pretty easy to recreate the scenario (but not the assert) in TestPeeringState, we should be able to strengthen its checks so that it not only compares that all the shards have the same number of missing objects but also checks they have precisely the same list of missing objects and need versions (which would catch this issue because two shards end up with the same missing objects but different need versions). Will look at doing this in a separate PR once this has merged.

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

Now, with the framework for testing PeeringState, it should be possible to unit test this. Let's add.

This commit enhances the EC peering test framework and adds test cases
for erasure-coded pool recovery scenarios:

NOTE: Many of the tests cases are disabled as they recreate certain
problems. Later commits will enable these tests and fix the production
issues, but under different PRs.

Test Infrastructure Improvements:
- Add MockStore wrapper with read error injection capabilities for testing
  error handling in EC recovery
- Enhance ECPeeringTestFixture with recovery callback verification
- Add support for pg_upmap to better simulate OSD placement
- Implement write_attribute() for testing partial vs full stripe writes
- Add read_shard_object_info() to verify on-disk version consistency
- Improve logging with missing object stats (m=, u=, mbc=)
- Add support for doing object recovery in Fast EC.
- Add set_config() helper for runtime configuration changes
- Preserve xinfo features when marking OSDs up/down
- Fix pg_temp handling for EC pools with optimizations

Mock Object Enhancements:
- Update MockPGBackendListener with recovery callback tracking
- Add on_local_recover, on_peer_recover, on_global_recover tracking
- Implement proper stats publishing (pg_stats_publish)
- Add is_missing_object() implementation
- Enhance should_send_op() with async_recovery_target logic
- Add apply_stats() to update PeeringState statistics

Test Cases Added:
- ECRecoveryTest: Verifies recovery with missing objects after OSD failure
- ECSequentialOSDFailoverTest: Tests sequential OSD failure/recovery cycles
- MultiObjectRecoveryReadCrash: Reproduces bug #75432 (multi-object reads)
- RollbackVersionMismatch: Reproduces bug #76213 (version mismatch)
- RollbackAfterMixedBlockedWrites: Reproduces bug #75211 (rollback issues)

These tests validate EC recovery mechanisms including:
- Object version tracking across shards
- Recovery callback invocation (local, peer, global)
- Handling of read errors during recovery
- Rollback behavior after blocked writes
- Multi-object recovery with partial failures

Assisted-by: IBM Bob, using Claude Sonnet
Signed-off-by: Alex Ainscow <[email protected]>
…ntries

A previous fix for PR 66698 fixed an issue where log entries associated with
partial writes were being processed incorrectly (see that PR and associated
tracker for details).  The fix was to ignore log entries that should not have
been present on the non-primary shard.

The problem with that approach is that in a more complex scenario, where the
log contained a partial write, followed by a full write AND the shard is
backfilling, then the missing list was being given the version prior to the
full write, rather than prior to the clone.

Our fix here corrects how the missing list version is calculated.

See the associated tracker for instructions on how to recreate

Fixes: https://tracker.ceph.com/issues/75211
Signed-off-by: Alex Ainscow <[email protected]>
@aainscow
aainscow requested a review from a team as a code owner April 30, 2026 15:28
@github-actions github-actions Bot added the tests label Apr 30, 2026
@aainscow

Copy link
Copy Markdown
Contributor Author

@rzarzynski I have put in the requested test harness.

@aainscow
aainscow requested a review from rzarzynski April 30, 2026 15:29
@aainscow

aainscow commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@shraddhaag

Copy link
Copy Markdown
Contributor

@aainscow
aainscow merged commit 277f43c into ceph:main May 6, 2026
6 checks passed
@github-actions github-actions Bot mentioned this pull request May 6, 2026
14 tasks
@aainscow aainscow added the backport-complete A backport was necessary, but all work has been completed. label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-complete A backport was necessary, but all work has been completed. core needs-qa tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants