Skip to content

mon/OSDMonitor: keep size and bucket target for a pool created in degraded stretch mode - #72381

Merged
ljflores merged 2 commits into
ceph:mainfrom
aainscow:wip-stretch-degraded-pool-create
Oct 15, 2026
Merged

ljflores merged 2 commits into
ceph:mainfrom
aainscow:wip-stretch-degraded-pool-create

Conversation

@aainscow

@aainscow aainscow commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

In stretch mode, a pool created while the cluster is in degraded stretch mode was given half the stretch pool size and a peering_crush_bucket_target of 1. Entering degraded stretch mode only lowers each existing stretch pool's bucket count, sets the mandatory member and halves min_size, and trigger_healthy_stretch_mode() undoes exactly those changes, so nothing restored the new pool's size or bucket target. Once the lost site was back the pool had size 2 and min_size 2: the stretch rule put both replicas in one zone, a bucket count of 2 could never be met, and every PG stayed clean+peered.

The fix gives a pool created in degraded mode only the changes the existing pools get, so the healthy transition brings it back to the full stretch size with the others.

The first commit adds a standalone reproducer, qa/standalone/mon-stretch/mon-stretch-pool-create-degraded.sh (3 mons, 4 OSDs, two zones and a tiebreaker): it enables stretch mode, stops one zone's mon and OSDs, creates a pool, and brings the zone back.

Testing: run on a build of the stretchy-C development branch, whose stretch mode code behaves the same as main for replicated pools in a two-zone cluster. Without the fix the test fails on the size check (2, expected 4); with it the pool is back to size 4 / min_size 2 after recovery, its PGs go active+clean, and the data written during degraded mode reads back. Not yet run on a main build.

Fixes: https://tracker.ceph.com/issues/81390

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

https://claude.ai/code/session_012ETDivFUQubLqznTDowHRu

@aainscow
aainscow requested a review from a team as a code owner October 4, 2026 19:44

@kamoltat kamoltat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree,
In osdmon->trigger_degraded_stretch_mode ()
we do:
peering_crush_bucket_count = 1
and keep size and peering_crush_bucket_target the same.
So when we create a new pool in degraded mode we shouldn't be changing this. After the cluster transitioned into recovery we don't even set these values back so definitely a bug

@bill-scales bill-scales 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.

Agree with changes. Need to add signed off by to the commits.

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath31-testing-20261006.075505-main.

…aying half size

A replicated pool created while the cluster is in degraded stretch mode
is given half the stretch pool size and a peering_crush_bucket_target
of 1. The return to healthy stretch mode restores only the bucket count
and min_size, so once the lost site is back the pool has size 2 and
min_size 2: the stretch rule puts both replicas in one zone, a bucket
count of 2 cannot be met, and every PG stays clean+peered.

Create a pool in degraded stretch mode, write to it, bring the site
back and expect the pool to match the other stretch pool and go clean.
This fails on the size check.

Fixes: https://tracker.ceph.com/issues/81390
Assisted-by: Claude Code
Signed-off-by: Alex Ainscow <[email protected]>
…raded stretch mode

Entering degraded stretch mode lowers each stretch pool's bucket count
to the surviving bucket count, sets the mandatory member and halves
min_size. Size and peering_crush_bucket_target are left alone, and
trigger_healthy_stretch_mode() undoes exactly those changes.

A pool created during degraded mode also had its size and bucket target
halved, which nothing restores. Apply only the changes the existing
pools get, so the healthy transition brings the new pool back to the
full stretch size with the others.

Fixes: https://tracker.ceph.com/issues/81390
Assisted-by: Claude Code
Signed-off-by: Alex Ainscow <[email protected]>
@amathuria

Copy link
Copy Markdown
Contributor

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.

6 participants