Repository navigation
Conversation
|
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 |
|
This is a clean cherry-pick of #72544. The releng-audit Redmine linkage failures are being addressed (I lack permission
The tentacle backport is #74287. |
|
@cupnes you may drive umbrella backport... |
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/test/test_scrubber_run.cc - No git conflict; manual test-only change. The test creates its MemStore with an empty path, which relies on MemStore's in-memory-only mode from 2e8eee3 (PR ceph#71931). umbrella lacks that commit, so the fixture uses a temporary directory instead, as in the tentacle backport (PR ceph#74456). No production code change.
0b88ca8 to
0893ea4
Compare
|
Thanks @Antek74. Updated test_scrubber_run.cc to use a temporary directory for MemStore, |
|
/audit retest |
|
🔄 Audit Retest Triggered by @cupnes. |
There was a problem hiding this comment.
Ceph Release Engineering Audit Report
Automated Redmine Linkage Audit
The following tracking irregularities were found:
- Missing PR Link: Backport tracker #83671 has no 'Pull Request ID' field set. Please link it to PR #74289.
- Missing PR Link: Backport tracker #83057 has no 'Pull Request ID' field set. Please link it to PR #74289.
Commit Parity Visualizer
| BACKPORT PR #74289 | SOURCE PR |
SOURCE STATUS |
|---|---|---|
| 0893ea4 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 0893ea4 (cherry-pick of 43ce7a9)
Affected File(s)
src/test/test_scrubber_run.cc
Range Diff
Click to expand
--- Original (43ce7a9a)
+++ Backport (0893ea4b)
@@ -28,3 +28,12 @@
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/test/test_scrubber_run.cc
+ - No git conflict; manual test-only change. The test creates its
+ MemStore with an empty path, which relies on MemStore's
+ in-memory-only mode from 2e8eee3bb50 (PR #71931). umbrella lacks
+ that commit, so the fixture uses a temporary directory instead,
+ as in the tentacle backport (PR #74456). No production code change.
================================================================================
RANGE DIFF
================================================================================
1: 43ce7a9acc0 ! 1: 0893ea4b68e 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/test/test_scrubber_run.cc
+ - No git conflict; manual test-only change. The test creates its
+ MemStore with an empty path, which relies on MemStore's
+ in-memory-only mode from 2e8eee3bb50 (PR #71931). umbrella lacks
+ that commit, so the fixture uses a temporary directory instead,
+ as in the tentacle backport (PR #74456). No production code change.
## src/osd/SnapMapper.cc ##
@@ src/osd/SnapMapper.cc: bool SnapMapper::Scrubber::_parse_m(
@@ src/test/test_scrubber_run.cc (new)
+// the collector against keys it must not read.
+
+#include <algorithm>
++#include <cstdlib>
++#include <filesystem>
+#include <map>
++#include <system_error>
+#include <tuple>
+#include <vector>
+
@@ src/test/test_scrubber_run.cc (new)
+ // mapping_drv without colliding
+ std::map<std::pair<int64_t, int>, std::unique_ptr<SnapMapper>> mappers;
+ bool mounted = false;
++ // Backport adaptation: main's MemStore supports an in-memory-only mode
++ // for the empty path (commit 2e8eee3bb50); umbrella does not, so the
++ // fixture uses a real temporary directory like the original test draft.
++ std::string path;
+ CephContext *cct = g_ceph_context;
+
+ void SetUp() override {
-+ store = ObjectStore::create(cct, "memstore", "");
++ char pathbuf[] = "/tmp/scrubber-run-test-XXXXXX";
++ char *d = mkdtemp(pathbuf);
++ ASSERT_NE(nullptr, d);
++ path = d;
++
++ store = ObjectStore::create(cct, "memstore", path);
+ ASSERT_TRUE(store);
+ ASSERT_EQ(0, store->mkfs());
+ ASSERT_EQ(0, store->mount());
@@ src/test/test_scrubber_run.cc (new)
+ mapping_drv.reset();
+ purged_drv.reset();
+ store.reset();
++ std::error_code ec;
++ std::filesystem::remove_all(path, ec);
+ }
+
+ SnapMapper &get_mapper(int64_t pool,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.
backport tracker: https://tracker.ceph.com/issues/83057
backport tracker: https://tracker.ceph.com/issues/83671
backport of #72544
parent trackers: https://tracker.ceph.com/issues/81592, https://tracker.ceph.com/issues/81798
The original commit 43ce7a9 fixes both parent trackers:
(O(M*P)), which pinned a core for days on snapshot-heavy OSDs. The fix collects the
purged_snaps rows once, sorts and merges them, and binary-searches per mapping key
(O(M log P)).
pool-20 row and never reach pool 3, missing strays. The numeric sort fixes this.
Both issues affect umbrella, which does not have this commit yet. The change is limited
to SnapMapper::Scrubber::run() plus a new unit test (unittest_scrubber_run).
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