Repository navigation
mon, qa: fix the rados:thrash-erasure-code-stretch failures - #52
Merged
Merged
Conversation
When the last --num_zones pool was deleted, _prepare_remove_pool() had MonmapMonitor propose the monmap without stretch mode, tiebreaker or disallowed leaders straight away, in a paxos round of its own, ahead of the OSDMap change that removes the pool and clears the OSDMap stretch flags. A new monmap always makes the monitors bootstrap, which throws the pending OSDMap change away. The client resends the command and the pool is deleted, but the monmap has already left stretch mode, so the OSDMap stretch flags are never cleared. Only the proposing monitor cleared its stretch_mode_engaged flag. Every other monitor stays engaged, because try_disable_stretch_mode() only disengages once both maps have left stretch mode. If one of them becomes leader while a zone has no monitor in quorum, do_stretch_mode_election_work() queues maybe_go_degraded_stretch_mode(), which asserts that the monmap contains the tiebreaker. A teuthology run of rados:thrash-erasure-code-stretch hit exactly this on the former tiebreaker monitor. Plug paxos while MonmapMonitor clears its state and propose the OSDMap change at once, so both maps change in the same round, as the osd destroy and purge commands already do with other services. Retry the removal while MonmapMonitor is not writeable. clear_stretch_mode_state() is unchanged, so the leader still clears its own engaged flag early. That is safe: if the combined round commits, every other monitor disengages through try_disable_stretch_mode(), and if it is lost, both maps are still in stretch mode and the leader engages again on the next OSDMap commit. The leader-side stretch transitions in Monitor.cc also return once the monmap has left stretch mode, so that a context queued before the change cannot act on a monmap without a tiebreaker. The checks apply to every caller. For the pool delete they are defensive, since both maps now change in one round. They also cover "osd pool set <pool> num_zones 1" on the last stretch pool, where they turn the tiebreaker assert into a no-op, but that path still proposes the monmap on its own and is not changed here. The num_zones branch further down prepare_command_pool_set() is not reachable: the earlier var == "num_zones" branch handles the command. Global stretch mode keeps its behaviour: "mon disable_stretch_mode" commits the OSDMap first and clears the monmap last. Assisted-by: Claude Code
Follow-up for Callum James to review and squash into "WIP: ec stretch zone thrasher teuthology". The thrasher ignorelists named STRETCH_MODE_DEGRADED, which the monitor never raises. Each zone thrash cycle raises DEGRADED_STRETCH_MODE and RECOVERING_STRETCH_MODE instead, so every job in a teuthology run of rados:thrash-erasure-code-stretch failed the cluster log scan. Ignore those two codes. Assisted-by: Claude Code
Follow-up for Callum James to review and squash into "WIP: ec stretch zone thrasher". The rados task deletes its pools before the zone thrasher is stopped. Once deleting the last --num_zones pool takes the cluster out of stretch mode, a zone killed just before that never makes the cluster degraded, and the thrasher kept polling for degraded stretch mode until degrade_timeout ran out and failed the job. Stop waiting once the thrasher is told to stop, revive the zone and finish. Assisted-by: Claude Code
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.
This fixes what still stops rados:thrash-erasure-code-stretch on stretchy-C, from the run https://pulpito.ceph.com/cjames-2026-10-06_13:10:28-rados:thrash-erasure-code-stretch-wip_cal_wip_stretchy_c-distro-default-trial/ (ceph-ci
wip_cal_wip_stretchy_cat ee32262; all six jobs failed). The run's other failures are already fixed on stretchy-C: the fast-read OSD abort inECBackend::handle_sub_read_reply()(bbc56b5), EC pool creates refused after the stretch election (monmap v11, f1280cb), the zone failure domain option name (c771e3d) and the one-zone rule of the custom-CRUSH facet (9af382e).--num_zonespool proposed the monmap without stretch mode in a round of its own. The bootstrap that follows dropped the OSDMap change, so the OSDMap stayed in stretch mode for good and the other monitors stayed engaged. After the rados task deleted its pool, the former tiebreaker won the next election and hitceph_assert(monmap->contains(monmap->tiebreaker_mon))inmaybe_go_degraded_stretch_mode(). Both maps now change in one round (paxos plugged, asosd destroyandosd purgedo), and the stretch transitions in Monitor.cc return once the monmap has left stretch mode. Introduced by 59997c6. Not covered:osd pool set <pool> num_zones 1on the last stretch pool (a1dbca8) still proposes the monmap on its own; the new checks stop it asserting.STRETCH_MODE_DEGRADED, which the monitor never raises, so every job failed the cluster log scan onDEGRADED_STRETCH_MODEorRECOVERING_STRETCH_MODE. Follow-up for @CJamesIBM to squash into fb56ba2 "WIP: ec stretch zone thrasher teuthology".degrade_timeout. Follow-up for @CJamesIBM to squash into da6fe72 "WIP: ec stretch zone thrasher".Seen once in the run (611913) and not addressed here: a monitor segfault at shutdown in
handle_auth_request(), which looks like a session use-after-free that is also on main.Tested locally on f4b9542, then rebased onto 9af382e without conflicts:
osd-pool-set-replica.shpasses; the other mon-stretch standalone scripts are still running, and their results will be added here.unittest_mon_monmap,unittest_monmap_monitor,unittest_osd_monitorandunittest_mon_electionpass.Next step: a teuthology run of this branch.
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