Skip to content

mon, qa: fix the rados:thrash-erasure-code-stretch failures - #52

Merged
aainscow merged 3 commits into
stretchy-Cfrom
wip-stretchy-C-zone-thrash
Oct 7, 2026
Merged

aainscow merged 3 commits into
stretchy-Cfrom
wip-stretchy-C-zone-thrash

Conversation

@aainscow

@aainscow aainscow commented Oct 7, 2026

Copy link
Copy Markdown
Owner

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_c at ee32262; all six jobs failed). The run's other failures are already fixed on stretchy-C: the fast-read OSD abort in ECBackend::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).

  • mon: leave per-pool stretch mode in a single paxos round (job 611916). Deleting the last --num_zones pool 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 hit ceph_assert(monmap->contains(monmap->tiebreaker_mon)) in maybe_go_degraded_stretch_mode(). Both maps now change in one round (paxos plugged, as osd destroy and osd purge do), 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 1 on the last stretch pool (a1dbca8) still proposes the monmap on its own; the new checks stop it asserting.
  • qa/suites/rados: ignore the real stretch mode health checks (all six jobs). The thrasher yamls ignored STRETCH_MODE_DEGRADED, which the monitor never raises, so every job failed the cluster log scan on DEGRADED_STRETCH_MODE or RECOVERING_STRETCH_MODE. Follow-up for @CJamesIBM to squash into fb56ba2 "WIP: ec stretch zone thrasher teuthology".
  • qa/tasks/stretch_zone_thrash: stop the degraded wait when stopped. With the mon fix, the pool delete really ends stretch mode, and a zone killed just before it left the thrasher waiting out 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:

  • A reproducer, run from a temporary copy and not committed: delete the last stretch pool, then kill the leader; and delete it while degraded. Without the mon fix it hit the same assert and left the OSDMap in stretch mode (on an earlier stretchy-C). With the fix both maps leave stretch mode and every monitor disengages.
  • osd-pool-set-replica.sh passes; the other mon-stretch standalone scripts are still running, and their results will be added here. unittest_mon_monmap, unittest_monmap_monitor, unittest_osd_monitor and unittest_mon_election pass.
  • Both thrasher yamls parse. With the new ignorelist, a re-scan of the six jobs' cluster logs finds nothing that would fail a job.

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

🤖 Generated with Claude Code

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
@aainscow
aainscow requested a review from CJamesIBM October 7, 2026 22:31
@aainscow
aainscow requested a review from kamoltat October 7, 2026 22:33
@aainscow
aainscow marked this pull request as ready for review October 7, 2026 22:33
@aainscow
aainscow merged commit 28b1e75 into stretchy-C Oct 7, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants