Repository navigation
osd/PeeringState: stamp last_clean in pg_stat_t, not pg_history_t - #72912
Merged
batrick merged 2 commits intoOct 23, 2026
Merged
Conversation
4 of 14 tasks
shraddhaag
force-pushed
the
wip-shraddhaag-last-clean-fastinfo
branch
from
October 21, 2026 14:34
a71b6fd to
1e86278
Compare
jdurgin
approved these changes
Oct 21, 2026
jdurgin
left a comment
Member
There was a problem hiding this comment.
The fix looks reasonable. This would signicantly affect write amplification for classic in small write workloads as well, which can cause drives to fail faster. This is why everything typically changed in a write is kept in fast_info rather than info.
sseshasa
approved these changes
Oct 22, 2026
sseshasa
left a comment
Contributor
There was a problem hiding this comment.
The changes look fine to me. This needs a backport to umbrella and so a tracker is warranted here.
mohit84
approved these changes
Oct 22, 2026
This was referenced Oct 22, 2026
Closed
Contributor
PR=wip-perezjos-crimson-only-22-10-2026-PR72912
$ teuthology-suite -s crimson-rados -p 101 --force-priority -c $PR -f debug --filter-out osd-pg-merging,radosbench --suite-branch main --suite-repo https://github.com/ceph/ceph.git
2026-10-22 13:59:39,393.393 INFO:teuthology.suite.run:Test results viewable at
|
batrick
previously requested changes
Oct 22, 2026
batrick
left a comment
Member
There was a problem hiding this comment.
Needs tracker ticket for backport.
Contributor
Author
Member
Commits should reference it with |
Since 0de8308 ("osd/PeeringState: source the vulnerability-window latch from pg_history_t"), prepare_stats_for_publish() sets info.history.last_clean = now on every publish of a clean PG. Stats are published on every client write (crimson: PG::apply_stats(); classic: PrimaryLogPG::eval_repop()), so pg_history_t changes on every op. pg_fast_info_t does not cover pg_history_t, so prepare_info_keymap() can no longer take the _fastinfo path and writes the full _info on every write, in both crimson and classic. On SeaStore this also moves the omap LogManager off its {log entry, _fastinfo} overwrite path. Stamp pg_stat_t.last_clean on each clean publish instead, as before 0de8308 (it is covered by _fastinfo). A clean publish that does not close a vulnerability window now leaves pg_history_t unchanged. The window close must not read pg_stat_t.last_clean: peering copies pg_stat_t wholesale from other OSDs (Stray::react(MInfoRec), proc_master_log, update_backfill_progress, split), so a copied value could close a window early or record a wrong duration. Close the window on the first publish of a clean PG after the onset instead, timed by that publish's own clock, and set vuln_window_reported = now. pg_history_t::merge() now decides if an onset is open against the merged vuln_window_reported, the same marker prepare_stats_for_publish() uses, instead of last_clean. last_clean is set to vuln_window_reported on each close and stays max-merged, so a peer on older code, whose merge() anchors on it, sees the same open/closed state. The existing merge_vulnerability_onset_* tests in unittest_osd_types now set vuln_window_reported, because it is the anchor. Update the related comments, the pg_vulnerability_duration description and the TEST_divergent_vulnerability_window comment. Fixes: https://tracker.ceph.com/issues/81977 Signed-off-by: Shraddha Agrawal <[email protected]>
* unittest_peeringstate: VulnerabilityWindowCleanPublishKeepsHistory does clean publishes before any vulnerability window and again after a recorded close. It checks that pg_history_t does not change, that info is not marked dirty, and that pg_stat_t.last_clean advances. A pg_history_t change on a clean publish makes prepare_info_keymap() write the full _info instead of _fastinfo on every client write. * unittest_osd_types: merge_vulnerability_onset_ignores_peer_last_clean checks that a peer's later last_clean (older code stamps it on every clean publish) does not hide an open, unrecorded onset in merge(). Fixes: https://tracker.ceph.com/issues/81977 Signed-off-by: Shraddha Agrawal <[email protected]>
shraddhaag
force-pushed
the
wip-shraddhaag-last-clean-fastinfo
branch
from
October 22, 2026 14:56
1e86278 to
be9ea76
Compare
Contributor
Author
|
@batrick done! |
Member
|
@shraddhaag please populate the ticket with details. |
bill-scales
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
We see a performance regression with the PR #72144. For small (4K) random writes, we see a significant IOPS regression in crimson:
Setup: 1 OSD on NVMe (LVM volume), fio rbd engine, randwrite, 8 jobs x iodepth 32, 60 s per run, crimson with
--crimson-smp 4. The 1M results are limited by the NVMe device.Commits: before
91514feb517, regressionff2f4a0d988, fixfa3d949306f(ff2f4a0d988+ fix).Root Cause
Primary OSD updates
last_cleanon each write. PR #72144 moved thelast_cleanfield frompg_stat_tintopg_history_t._fastinfoonly tracks a subset of fields in_info. An update inpg_stat_tis covered by_fastinfobut an update inpg_history_tis not. Since each write updateslast_cleaninpg_history_t,_fastinfowill in almost all cases will not suffice. We will almost always have to do a complete_infoupdate.A
_fastinfoupdate is about 194 bytes, while an_infosave is about 1110 bytes. On each write op we are writing about 900 bytes more.I verified the
_fastinfoshare of PG info saves:Impact on Classic
RocksDB appends the pg log entry and the info update. Now instead of
_fastinfoit appends_info. The difference is 900 bytes on each write. Since its an append we do not see a huge performance regression.Impact on Crimson
When Seastore needs to save a
_fastinfo, it generally overwrites over the previous_fastinfoentry. But when it needs to save the_info, it needs to find the old_info, mark it removed and then append the new_info. The chain traversal to find the old_infois the extra work that seastore does on each write and hence leads to a large performance impact.Fix
Move the
last_cleanfield back inpg_stat_t.When a vulnerability window closes (the first clean publish after the onset), we set
pg_history_t.vuln_window_reportedandpg_history_t.last_cleanto the current time. We do not readpg_stat_t.last_clean, because peering copiespg_stat_tfrom other OSDs.Fixes: https://tracker.ceph.com/issues/81977
Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.