Skip to content

test/crimson/seastore: assert omap extent retirement on split/merge/balance - #69482

Merged
ronen-fr merged 1 commit into
ceph:mainfrom
fultheim:crimson-omap-extent-retirement-tests
Jul 12, 2026
Merged

ronen-fr merged 1 commit into
ceph:mainfrom
fultheim:crimson-omap-extent-retirement-tests

Conversation

@fultheim

Copy link
Copy Markdown
Contributor

Adds a count_live_omap_extents() helper (via scan_mapped_space) plus assertions to the omap-manager split/merge/balance tests, so the omap B-tree's caller-layer node-retirement contract is enforced by CI.

Background: while investigating a suspected omap extent leak, adding retirement assertions showed the omap B-tree already retires old nodes at the caller layer (do_merge's retire of {l,r}, do_balance, handle_split, and OMapLeafNode::insert on split) — so a proposed in-helper retire would have been a second tm.remove of the same laddr → ENOENT. That retire change was withdrawn; these assertions remain to lock in the existing contract.

Assertions use exact counts where the tree shape is deterministic (exactly 1 root leaf after contraction to depth 1; exactly 0 after clear) and a derived upper bound elsewhere.

Validated with ctest -R omap (all green).

Split out of #69351 per review (thanks @Matan-B).

Checklist

  • Tracker (select at least one)
    • Code cleanup (no ticket needed)
  • Component impact
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • No doc update is appropriate
  • Tests (select at least one)

Copilot AI review requested due to automatic review settings June 15, 2026 14:58
@fultheim
fultheim requested a review from a team as a code owner June 15, 2026 14:58
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

16 similar comments
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run.

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR strengthens OMAP manager balancing/clear tests by adding a helper to count currently-mapped OMAP extents and asserting expected post-merge and post-clear extent counts.

Changes:

  • Added count_live_omap_extents() helper that scans mapped space and counts OMAP_INNER/OMAP_LEAF extents.
  • Added assertions/logging to verify extent counts after split/merge balancing and after clearing the tree.
  • Extended the existing clear test to assert there are no remaining live OMAP extents.

Comment on lines +204 to +209
[&count](paddr_t paddr, extent_len_t len, extent_types_t type, laddr_t laddr) {
if (type == extent_types_t::OMAP_INNER ||
type == extent_types_t::OMAP_LEAF) {
count++;
}
});
Comment on lines +614 to +616
// Bound derivation: 64 KiB OMAP_LEAF_BLOCK_SIZE / ~580 B entry size (50 B key + 512 B value
// + overhead) => healthy post-merge leaves hold >=55 entries, so count is <= size / 55 + C.
EXPECT_LE(final_count, test_omap_mappings.size() / 40 + 20U);
Comment on lines +554 to +558
logger().debug("== clearing entire tree and verifying no leaks");
auto t_clear = create_mutate_transaction();
clear(omap_root, *t_clear);
submit_transaction(std::move(t_clear));
EXPECT_EQ(count_live_omap_extents(), 0U);
@fultheim
fultheim force-pushed the crimson-omap-extent-retirement-tests branch from b1a5e10 to e50ea49 Compare June 15, 2026 15:07

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

commit message states:

which let a redundant node-retirement change slip in that
double-freed nodes (ENOENT abort) on split/merge.

iiuc the above is not correct, right?

@Matan-B Matan-B added this to Crimson Jun 17, 2026
@Matan-B Matan-B moved this to Needs QA in Crimson Jun 17, 2026
@Matan-B

Matan-B commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

ok to test

@Matan-B

Matan-B commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

we'll just need to make sure test is passing, should be included in make check.

@fultheim

Copy link
Copy Markdown
Contributor Author

@Matan-B , you're right, the double-free never actually occurred in CI. The correct sequence was:

  1. I suspected an extent leak and added these retirement assertions locally
  2. Those assertions revealed the caller-layer already handles retirement correctly

@Matan-B

Matan-B commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

@Matan-B , you're right, the double-free never actually occurred in CI. The correct sequence was:

  1. I suspected an extent leak and added these retirement assertions locally
  2. Those assertions revealed the caller-layer already handles retirement correctly

Can we amend the commit please? ok to merge afterwards

…alance

There was no coverage for extent leaks or double-frees during structural
omap B-tree transitions. While investigating a suspected extent leak, these
assertions were added and confirmed the caller-layer (parent-node) already
retires nodes correctly — no leak and no double-free.

Add count_live_omap_extents() to omap_manager_test_t, which scans the LBA
mapping space via scan_mapped_space() to count live OMAP_INNER/OMAP_LEAF
extents, and assert against it in leafnode/innernode_split_merge_balancing:
the live count returns to baseline after contraction, and is exactly 0 after
clearing the tree. This pins the caller-layer (parent-node) retirement
contract in CI.

Signed-off-by: Shai Fultheim <[email protected]>
@fultheim
fultheim force-pushed the crimson-omap-extent-retirement-tests branch from e50ea49 to d3cada2 Compare June 18, 2026 10:55
@fultheim

Copy link
Copy Markdown
Contributor Author

@Matan-B amended — the commit message now describes this as preventive coverage that confirmed the caller-layer already retires correctly (no double-free occurred). Thanks!

@perezjosibm

perezjosibm commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

A cursory look indicates that the code changes might not strictly be exercised by the QA tests, I'm triggering those nevertheless 🤔

PR=wip-perezjos-crimson-only-22-06-2026-PR69482
$ teuthology-suite -s crimson-rados -p 101 --force-priority -c $PR  -f debug  --filter-out rgw  --filter seastore --suite-branch main --suite-repo https://github.com/ceph/ceph.git
2026-06-22 14:25:42,569.569 INFO:teuthology.suite.run:Test results viewable at 

https://pulpito-ng.ceph.com/jjperez-2026-06-22_14:21:03-crimson-rados-wip-perezjos-crimson-only-22-06-2026-PR69482-distro-debug-trial/

  • Update: by mistake I launched the suite twice, on both trials, it got a higher number of failures (93 on the first attempt, 83 on the second) but most look like infrastructure issues (yum install, _ansible_no_log, etc) , so I am launching the suite again:

2026-06-29 15:40:55,276.276 INFO:teuthology.suite.run:Test results viewable at
https://pulpito-ng.ceph.com/jjperez-2026-06-29_15:36:12-crimson-rados-wip-perezjos-crimson-only-22-06-2026-PR69482-distro-debug-trial/

@perezjosibm perezjosibm moved this from Needs QA to QA in Progress in Crimson Jun 29, 2026
@perezjosibm perezjosibm moved this from QA in Progress to Tested in Crimson Jun 30, 2026
@ronen-fr

ronen-fr commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

jenkins test windows

1 similar comment
@Matan-B

Matan-B commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

jenkins test windows

@fultheim

Copy link
Copy Markdown
Contributor Author

@ronen-fr can this be merged?

@ronen-fr

Copy link
Copy Markdown
Contributor

@fultheim - yes. DO you prefer me to do that?

@fultheim

Copy link
Copy Markdown
Contributor Author

@fultheim - yes. DO you prefer me to do that?

Yes, please.

@ronen-fr
ronen-fr merged commit 6314ccf into ceph:main Jul 12, 2026
6 checks passed
@ronen-fr ronen-fr moved this from Tested to Merged (Main) in Crimson Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Merged (Main)

Development

Successfully merging this pull request may close these issues.

6 participants