Skip to content

osd: Avoid pwlc spanning intervals#67244

Merged
kamoltat merged 1 commit intoceph:mainfrom
bill-scales:issue73891
Mar 16, 2026
Merged

osd: Avoid pwlc spanning intervals#67244
kamoltat merged 1 commit intoceph:mainfrom
bill-scales:issue73891

Conversation

@bill-scales
Copy link
Copy Markdown
Contributor

@bill-scales bill-scales commented Feb 6, 2026

Prevent the first write to FastEC in each interval from being a partial write to avoid the span of partial writes tracked by pwlc from spanning intervals. This stops bugs such as 73891 where a divergent write was not removed from the log because pwlc recorded that the shard had not participated in writes before and after the divergent write.

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

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.

@bill-scales bill-scales requested a review from aainscow February 6, 2026 17:32
@bill-scales bill-scales requested a review from a team as a code owner February 6, 2026 17:32
@github-actions github-actions bot added the core label Feb 6, 2026
@bill-scales
Copy link
Copy Markdown
Contributor Author

No unit test included in this PR, but I'm working on a unit test harness for PeeringState (still cleaning it up ready for its own PR) and have a test for this issue there - see bill-scales@d1f9d5b

@athanatos athanatos self-requested a review February 6, 2026 21:46
Prevent the first write to FastEC in each interval from being
a partial write to avoid the span of partial writes tracked by
pwlc from spanning intervals. This stops bugs such as 73891
where a divergent write was not removed from the log because
pwlc recorded that the shard had not participated in writes
before and after the divergent write.

Fixes: https://tracker.ceph.com/issues/73891
Signed-off-by: Bill Scales <bill_scales@uk.ibm.com>
@bill-scales
Copy link
Copy Markdown
Contributor Author

Force push to rebase to pick up fix in main for API test failure

Copy link
Copy Markdown
Contributor

@aainscow aainscow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another mechanism in ECCommon which does something very similar:

next_write_all_shards.

This causes an empty transaction to be sent to shards which otherwise be sent nothing.

I wonder if this new mechanism should be used for this too?

@bill-scales
Copy link
Copy Markdown
Contributor Author

I did look at next_write_all_shards, and while it is fairly similar it is not sufficient. This mechanism is used in cases where PrimaryLogPG is generating a log entry without doing a write (for example logging a failed write) and requires the log entry to get sent to and stored by each shard.

The first_write_in_interval flag ensures that the first write transaction in the interval is sent to all shards AND that despite generate_transactions being called that written_shards is empty indicating that all shards have been updated, even if the write transaction is only modifying a subset of the shards. This ensures that PWLC gets cleared by PGBackend::partial_write and that Peering will roll back the write unless all shards active in the epoch have committed the update.

if (size_change || clear_whiteout) {
if (size_change || clear_whiteout || first_write_in_interval) {
all_shards_written();
first_write_in_interval = false;
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.

first_write_in_interval is a non-const reference, ACK.

Though, pointer for an in-out parameter would make it more visually explicit (*first_write_in_interval = false).

@kamoltat
Copy link
Copy Markdown
Member

@kamoltat kamoltat merged commit 9f66a0b into ceph:main Mar 16, 2026
13 checks passed
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