Repository navigation
osd/ECUtil: io_exerciser: fix two test-only defects - #72295
Merged
Merged
Conversation
4 of 14 tasks
Contributor
|
This PR has been added to wip-bharath19-testing-20261002.123021-main. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
aainscow
force-pushed
the
wip-ec-test-only-fixes
branch
from
October 6, 2026 09:54
4dfa323 to
6020b08
Compare
Contributor
Author
|
jenkins test make check |
Contributor
Author
|
jenkins test make check arm64 |
Contributor
Author
|
jenkins test make check |
Contributor
Author
|
jenkins test make check arm64 |
aainscow
force-pushed
the
wip-ec-test-only-fixes
branch
from
October 13, 2026 09:17
6020b08 to
e859157
Compare
Only the ec_impl constructor and the plain (k, m, stripe_width) test constructor initialised the const all_shards member. The (k, m, stripe_width, chunk_mapping), (k, m, stripe_width, pool) and (k, m, stripe_width, pool, chunk_mapping) constructors left it empty, so get_all_shards() returned an empty set and any loop over it was silently skipped in the unit tests built on them (for example the scrub backend tests, whose TestPg uses the pool constructor). Initialise it with calc_all_shards(k + m) as the other constructors do. These constructors are only used by unit tests; the production (ec_impl) constructor is unchanged, so this is a test-only defect with no effect on the OSD. Tested by ECUtil.get_all_shards_every_constructor in the following commit. unittest_ecutil, unittest_ecbackend, unittest_extent_cache and unittest_ec_transaction all pass. Fixes: https://tracker.ceph.com/issues/81296 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
Tests "osd/ECUtil: initialise all_shards in every stripe_info_t constructor". ECUtil.get_all_shards_every_constructor builds a k=2, m=1 stripe_info_t with each of the test constructors ((k, m, stripe_width), (k, m, stripe_width, chunk_mapping), (k, m, stripe_width, pool) and (k, m, stripe_width, pool, chunk_mapping)) and checks that get_all_shards() returns shards 0..2. Without the fix the last three return an empty set, so code that iterates get_all_shards() silently does nothing under test harnesses such as unittest_scrubber_be, whose TestPg builds its stripe_info_t with the (k, m, stripe_width, pool) constructor. Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
RadosIo chose a balanced read when a random index in [0, 100) was <= balanced_read_percentage, which is true for percentage + 1 of the 100 values. ceph_test_rados_io_sequence --balanced_read_percentage 0 therefore still sent about 1% of its reads with OPERATION_BALANCE_READS, so a run meant to exercise only primary reads did not, and every other setting was one point too high. Compare with < so that the percentage is the share of balanced reads; the default of 100 still makes every read balanced. This is a test-only defect: io_exerciser is used only by the ceph_test_rados_io_sequence tool, and the only effect is on the flags that tool puts on its own reads. There is no separate test: the off-by-one follows from the range of the index. Fixes: https://tracker.ceph.com/issues/81296 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
This is a defect in the unit test fixtures only; the OSD and monitor code are unaffected. OSDMap::Incremental::new_state is XORed into an OSD's state, so setting CEPH_OSD_EXISTS for an OSD that already exists destroys it: its state, osd_info (up_from, up_thru, down_at) and xinfo are cleared. The fixtures marked OSDs down with new_state = CEPH_OSD_EXISTS (OSDMapTestHelpers::mark_osd_down() and mark_osds_down(), used by ECPeeringTestFixture, and the OSD failure simulations in TestBackendBasics.cc), so every OSD a test took down was destroyed rather than marked down. The helpers restored the xinfo features afterwards to keep peering working, and mark_osd_up() recreated the OSD with CEPH_OSD_EXISTS | CEPH_OSD_UP. Toggle only CEPH_OSD_UP, as OSDMonitor does when it marks an OSD down, and drop the xinfo workaround; every place that marks OSDs down now asserts that they are up. mark_osd_up() asserts the OSD is down and boots it with new_up_client, as OSDMonitor does, which also sets up_from, so has_been_up_since() no longer accepts messages the OSD sent before it went down. Fixes: https://tracker.ceph.com/issues/81296 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
aainscow
force-pushed
the
wip-ec-test-only-fixes
branch
from
October 13, 2026 10:17
e859157 to
8ca8a5e
Compare
|
This is an automated message by src/script/redmine-upkeep.py. I have resolved the following tracker ticket due to the merge of this PR: No backports are pending for the ticket. If this is incorrect, please update the tracker |
5 of 14 tasks
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.
Two small fixes for defects that only affect unit tests or test tools. Neither
changes the behaviour of an OSD or a client.
Fixes: https://tracker.ceph.com/issues/81296
osd/ECUtil: initialise all_shards in every stripe_info_t constructor
Three of the
stripe_info_tconstructors used only by unit tests left the constall_shardsmember empty:(k, m, stripe_width, chunk_mapping)(k, m, stripe_width, pool)(k, m, stripe_width, pool, chunk_mapping)get_all_shards()then returned an empty set, so loops over it were silentlyskipped in tests built on these constructors. For example,
unittest_scrubber_be'sTestPguses the pool constructor. They now callcalc_all_shards(k + m), as theother constructors do. The production (
ec_impl) constructor is unchanged.The new test
ECUtil.get_all_shards_every_constructorchecks every testconstructor. All 28 tests in
unittest_ecutilpass. With the fix reverted, thenew test fails for the three constructors.
common/io_exerciser: honour a 0% balanced read percentage
RadosIochose a balanced read when a random index in [0, 100) was<= balanced_read_percentage. Soceph_test_rados_io_sequence --balanced_read_percentage 0still balanced about 1%of its reads, and every setting was one point too high. It now compares with
<.The default of 100 still balances every read. There is no separate test: the
off-by-one follows from the range of the index.
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.