Repository navigation
Conversation
Scrubber::run() opened a fresh omap_iterate over purged_snaps, from its start, for every mapping key: O(M*P). On snapshot-heavy OSDs this pinned a core for days. Collect the purged_snaps rows once up front, sort them numerically by (pool, begin), merge overlapping and adjacent same-pool rows into disjoint ranges, and binary-search them per mapping key: O(M log P). The numeric sort also fixes missed strays: with pools ordered as decimal strings, the old walk could stop at a pool-20 row and never reach pool 3. The on-disk key order is not numeric in the pool (decimal string), and rows of one pool may overlap or touch (record_purged_snaps() merges a new interval only with rows already on disk, so intervals carried in one call do not see each other), so the merged ranges stay sorted by (pool, begin) and disjoint: one upper_bound per mapping key, and the last row that starts at or before the snap is the only one that can cover it. Adds unittest_scrubber_run, a unit test for Scrubber::run(): it builds a SnapMapper over a MemStore and fills it through the same writer methods ceph-osd uses (record_purged_snaps(), add_oid()), then checks every stray the scrub reports. Fixes: https://tracker.ceph.com/issues/81592 Fixes: https://tracker.ceph.com/issues/81798 Signed-off-by: Ante Kuspilic <[email protected]> (cherry picked from commit 43ce7a9) Conflicts: src/osd/SnapMapper.cc - tentacle lacks f0028be ("osd: s/assert/ceph_assert/g"), so the removed asserts are plain assert() rather than ceph_assert(); drop them as in the original commit
|
Thank you for your contribution. Since you are not yet a member of the Ceph organization with write permissions on ceph/ceph.git, our CI will not automatically run. Any member of the Ceph organization may label this PR |
There was a problem hiding this comment.
Ceph Release Engineering Audit Report
Automated Redmine Linkage Audit
The following tracking irregularities were found:
- Missing Backport Tracker: Main tracker #81798 does not have a backport tracker for
tentacle. Please adjust the 'Backport' field on the main tracker appropriately and remove 'backport_processed' from 'Tags (freeform)'. - Missing PR Link: Backport tracker #83058 has no 'Pull Request ID' field set. Please link it to PR #74287.
Commit Parity Visualizer
| BACKPORT PR #74287 | SOURCE PR |
SOURCE STATUS |
|---|---|---|
| 3c45fc9 osd/SnapMapper: stop rescanning purged_snaps per mapping key | PR #72544 | 43ce7a9 osd/SnapMapper: stop rescanning purged_snaps per mapping key |
Automated Backport Parity Review - Cherry-Pick Conflicts / Deviations
A conflict or deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.
This does not necessarily indicate an issue but a maintainer should review.
**Click to expand conflict summaries.**
Deviation in Backport 3c45fc9 (cherry-pick of 43ce7a9)
Affected File(s)
src/osd/SnapMapper.cc
Range Diff
Click to expand
--- Original (43ce7a9a)
+++ Backport (3c45fc94)
@@ -28,3 +28,10 @@
Fixes: https://tracker.ceph.com/issues/81592
Fixes: https://tracker.ceph.com/issues/81798
Signed-off-by: Ante Kuspilic <[email protected]>
+(cherry picked from commit 43ce7a9acc0b9c872614a55c26baf43da268063b)
+
+Conflicts:
+ src/osd/SnapMapper.cc
+- tentacle lacks f0028be0ec5 ("osd: s/assert/ceph_assert/g"), so the
+ removed asserts are plain assert() rather than ceph_assert(); drop
+ them as in the original commit
================================================================================
RANGE DIFF
================================================================================
1: 43ce7a9acc0 ! 1: 3c45fc94aea osd/SnapMapper: stop rescanning purged_snaps per mapping key
@@ Commit message
Fixes: https://tracker.ceph.com/issues/81592
Fixes: https://tracker.ceph.com/issues/81798
Signed-off-by: Ante Kuspilic <[email protected]>
+ (cherry picked from commit 43ce7a9acc0b9c872614a55c26baf43da268063b)
+
+ Conflicts:
+ src/osd/SnapMapper.cc
+ - tentacle lacks f0028be0ec5 ("osd: s/assert/ceph_assert/g"), so the
+ removed asserts are plain assert() rather than ceph_assert(); drop
+ them as in the original commit
## src/osd/SnapMapper.cc ##
@@ src/osd/SnapMapper.cc: bool SnapMapper::Scrubber::_parse_m(
@@ src/osd/SnapMapper.cc: bool SnapMapper::Scrubber::_parse_m(
+ __func__, mapping.hoid, mapping.snap)
<< dendl;
} else {
-- ceph_assert(mapping.snap >= begin);
-- ceph_assert(mapping.snap < end);
-- ceph_assert(mapping.hoid.pool == pool);
+- assert(mapping.snap >= begin);
+- assert(mapping.snap < end);
+- assert(mapping.hoid.pool == pool);
// invalid
dout(10) << fmt::format(
- "{} stray {} snap {} in pool {} shard {} purged_snaps[{}, {})",How to proceed:
- Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git
Conflicts:block intact) and include an explanation for changes. - Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
- Component Leads (Review): Please review the Range Diff(s) above to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting
/audit override.
Be familiar with the rules and guidelines for writing backports.
🛟 Need Help?
If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.
📋 Component Lead / Release Manager
To override the audit failure, apply releng-audit-override label or comment /audit override.
When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.
|
The releng-audit deviation is expected: tentacle lacks f0028be Could a RADOS component lead or @ceph/ceph-release-manager please review and Tracker status (I lack permission to edit those fields, so I have requested):
The umbrella backport is #74289. |
|
Closing in favor of #74463, which contains the same |
backport tracker: https://tracker.ceph.com/issues/83058
backport of #72544
parent tracker: https://tracker.ceph.com/issues/81592
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh