Repository navigation
test/osd: three-zone stretch EC unit tests - #42
Merged
Merged
Conversation
TestECActingStretch3Zone had a three-to-two zone transition but not the reverse. calc_two_to_three() runs calc_ec_acting_stretch() for a 2-zone acting set growing into a 3-zone up set, with the new zone's OSDs answering the primary's query with empty infos. ZoneTransition_TwoToThree checks that the new zone's OSDs are recovered from the log when it reaches back far enough, and are backfilled, serving nothing yet, when it has been trimmed. ZoneTransition_TwoToThree_NewZoneFirst lets CRUSH put the new zone first and checks that want uses no OSD twice, keeps each zone block in one datacenter and keeps every OSD that holds data. Assisted-by: Claude Code
Add ISA k=2 m=1 and k=4 m=2 configurations with num_zones = 3, so every TestECFailoverWithPeering test that fits their geometry also runs with three zones. The tests that fail a whole zone go through degraded stretch mode, which the monitor, and OSDMapTestHelpers like it, define only for two zones. Limit those to num_zones == 2 rather than > 1. ThreeZoneZoneLossPeeredUntilZoneReturns covers losing a zone of a three-zone pool instead: without degraded stretch mode every zone must still meet min_size, so the PG must stop being active. It takes each zone down in turn, checks the PG is no longer active, brings the zone back and reads the object. This asserts the current OSD behaviour: OSDMap::stretch_ec_num_acting_below_min_size() applies min_size to each zone, the per-zone interpretation of design section 11.2.2. If the OSD moves to the per-pool interpretation of section 11.2.1, this test changes with it. Assisted-by: Claude Code
TestLocalZoneForActingSet built only two zones, so how SplitOp::local_zone_for_acting_set() chooses among more zones was not covered. Take the zone count from the fixture and add a three-zone fixture: a client in zone 2 reads from zone 2, and when the client's zone has no OSDs in the acting set the remaining zones tie at root level and zone 0 is chosen, also when the missing zone is the middle one. Assisted-by: Claude Code
This was referenced Oct 6, 2026
aainscow
marked this pull request as ready for review
October 6, 2026 12:38
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.
Three test-only commits that add three-zone coverage for stretch erasure coded pools to the OSD unit tests. No production code changes: only
src/test/osd/TestECActingStretch.cc,TestECFailoverWithPeering.ccandTestECWithCRUSH.ccare touched (+181 -34).Commits
TestECActingStretch.cc).TestECActingStretch3Zonealready covered going from three zones to two. It now also covers the reverse:calc_ec_acting_stretch()for a 2-zone acting set growing into a 3-zone up set, where the new zone's OSDs answer with empty infos.ZoneTransition_TwoToThreechecks that the new zone's OSDs are recovered from the log when it reaches back far enough, and are backfilled when it has been trimmed.ZoneTransition_TwoToThree_NewZoneFirstlets CRUSH put the new zone first. It checks that want uses no OSD twice, keeps each zone block in one datacenter and keeps every OSD that holds data.TestECFailoverWithPeering.cc).num_zones == 2instead of> 1.ThreeZoneZoneLossPeeredUntilZoneReturnstakes each zone of a three-zone pool down in turn. It checks that the PG stops being active, brings the zone back and reads the object.TestECWithCRUSH.cc).TestLocalZoneForActingSettakes its zone count from the fixture, and a new three-zone fixture covers howSplitOp::local_zone_for_acting_set()chooses among more than two zones.Testing
On this branch (stretchy-C fb56ba2 plus these three commits):
ninja -j20 unittest_ec_acting_stretch unittest_ecfailover_with_peering unittest_ec_with_crushsucceeded, with no warnings.unittest_ec_acting_stretch --gtest_filter='TestECActingStretch3Zone.ZoneTransition_TwoToThree*': 2/2 passed.unittest_ec_with_crush --gtest_filter='TestLocalZoneForActingSet3Zone.*': 3/3 passed.unittest_ecfailover_with_peering, filtered to theEC_ISA_Opt_k2m1_zones3andEC_ISA_Opt_k4m2_zones3configurations plusThreeZoneZoneLossPeeredUntilZoneReturns: 102 run, 47 passed, 55 skipped, 0 failed.ThreeZoneZoneLossPeeredUntilZoneReturnspassed on both three-zone configurations.unittest_ec_acting_stretch: 34/34 passed.unittest_ec_with_crush: 28/28 passed.unittest_ecfailover_with_peering: 704 run, 423 passed, 281 skipped, 0 failed, in 3 min 21 s.num_zones == 2still pass on all four 2-zone configurations. The exceptions are three tests that skip on k2m1_zones2 because of their existing k >= 3 check.PGBackendTestFixtureloads the EC plugins from a relative./lib, so the binaries were run from a directory with alibsymlink to the build'slib. They were not run under ctest.ECPeeringTestFixture::SetUp()dereferences a null messenger and segfaults instead of failing. That behaviour is pre-existing and not changed here.git log --checkis clean.Notes for reviewers
ThreeZoneZoneLossPeeredUntilZoneReturnsasserts the current OSD behaviour.OSDMap::stretch_ec_num_acting_below_min_size()applies min_size to each zone, which is the per-zone interpretation of design section 11.2.2.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
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.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.
🤖 Generated with Claude Code
https://claude.ai/code/session_012ETDivFUQubLqznTDowHRu