← Back to Pull requests

mon: stretch pool create, stretch mode and stretch command fixes for stretchy-C #43

Closed
unknown closed this pull request without merging on Oct 08, 2026 12:31 UTC
View on GitHub
unknown unknown commented on Oct 06, 2026 06:34 UTC
Author

<!--
- Please give your pull request a title like

[component]: [short description]

- Please use this format for each git commit message:

[component]: [short description]

[A longer multiline description]

Fixes: [ticket URL on tracker.ceph.com, create one if necessary]
Signed-off-by: [Your Name] <[your email]>

For examples, use "git log".
-->

Monitor fixes for stretch erasure coded pools on stretchy-C. They cover osd pool create --num_zones, how a multi-zone pool works with stretch mode (both global stretch mode and the stretch mode a 2-zone pool create enables), and the individual stretch pool commands ceph osd pool stretch set and unset. The fixes were developed and tested on one long branch and are consolidated here into one commit per fix. Each fix commit holds its standalone test, the qa changes it needs, and its changes to the design (doc/dev/osd_internals/erasure_coding/ec_stretch_cluster.rst) and user docs.

43 commits on stretchy-C (6583a082fa6), 35 files, +2089 -756:

  • Part A (A01-A15): main-bound commits that Part B needs, carried until stretchy-C is rebased onto a main that has them. They need no review here.

  • Part B (B01-B28): the stretchy-C work.
  • Part A: carried main-bound commits


    Each keeps the change and message of its main version, with a first paragraph added: "Carried from ...; drop when stretchy-C is rebased onto a main that has it". A02, A09 and A12 differ from main only where stretchy-C's context differs (see below). Jamie Pryde's commit (A04) is byte-identical, with no added paragraph; the test before it (A03) carries the note for both. Part B needs them: B05's test needs A02, B08's failed-create test needs A04, and B02 and B12 build on A08 and A11.
  • A01-A02: a pool created in degraded stretch mode keeps its size and bucket target. From https://github.com/ceph/ceph/pull/72381, for https://tracker.ceph.com/issues/81390.

  • - qa/standalone: demonstrate a pool created in degraded stretch mode staying half size
    - mon/OSDMonitor: keep size and bucket target for a pool created in degraded stretch mode
  • A03-A04: a failed pool create left an unnamed pool in pending_inc and crashed the monitor (https://tracker.ceph.com/issues/79574). The fix is Jamie Pryde's, from https://github.com/ceph/ceph/pull/71130; the test is main-bound but not yet proposed.

  • - qa/standalone: demonstrate a failed pool create crashing the mon
    - mon: Roll back pending_inc on prepare_new_pool failure (Jamie Pryde)
  • A05: a use after free in ceph ping mon.X. From https://github.com/ceph/ceph/pull/72378, for https://tracker.ceph.com/issues/81400.

  • - mon/MonClient: drop the ping connection before deleting its messenger
  • A06-A15: the stretch pool and stretch mode command fixes for main, https://github.com/ceph/ceph/pull/72416:

  • - qa/standalone: split activate_mon out of run_mon
    - https://tracker.ceph.com/issues/81427: stretch set refuses erasure coded pools (test, fix, doc)
    - https://tracker.ceph.com/issues/81428: stretch set and unset are refused while stretch mode is enabled (test, fix, doc)
    - https://tracker.ceph.com/issues/81429: force_healthy_stretch_mode fails outside recovery stretch mode (test, fix, doc)

    When stretchy-C is rebased onto a main that has these, twelve of them drop by patch-id. Three must be dropped by hand:

  • A02 has the same lines as main's version, but different hunk context.

  • A09 and A12 edit stretchy-C's story 4a in the design doc, which says "num_zones > 1" where main says "zones > 1".
  • Part B: stretchy-C commits


  • *B01 qa/standalone: use the auth_\_required options in crush-stretch.sh. Every test in that script failed at the first run_mon, because ceph-mon no longer accepts --auth-supported.

  • B02 test/librados: create the stretch EC test pool with num_zones. The old setup used stretch set, which A08 refuses for an EC pool, and osd pool set num_zones, which B16 refuses. The pool is now created with one osd pool create carrying k, m and num_zones 2.

  • B03 qa/standalone: add helpers for the mon-stretch tests. Adds mon-stretch-helpers.sh, which the new mon-stretch scripts source. It provides run_stretch_tests, wait_for_stretch_state, pool_field, two_zone_cluster (with an optional number of OSDs per datacenter), ec_stretch_cluster_without_dc2 and enable_global_stretch_mode.

  • B04 doc/dev: ec_stretch_cluster: describe a pool created in degraded stretch mode. Section 11.4.3 describes the pool A02 creates. The 11.6 table is corrected: the transitions never change peering_crush_bucket_target.

  • B05 mon/OSDMonitor: keep degraded stretch mode when a stretch EC pool is created.

  • - Before: creating a --num-zones 2 pool with a zone down reset degraded_stretch_mode, which ended degraded mode without the healthy transition. The lost zone's monitor stayed marked down, so losing the other zone then left no quorum.
    - Now: the cluster's stretch state is written only when stretch mode is not already enabled, and the new pool gets the degraded values the other pools have.
    - Test: mon-stretch-ec-pool-create-degraded.sh.
  • B06 mon/OSDMonitor: size a replicated stretch pool from its zones.*

  • - Before: a --num-zones 2 replicated pool created without a size got osd_pool_default_size (3), so one zone held a single replica.
    - Now: it gets num_zones
    num_replica_per_zone (4) and the matching min_size.
    - Test: TEST_pool_create_stretch_replica in crush-stretch.sh.
  • B07 mon/OSDMonitor: use the stretch rule for a pool created in global stretch mode.

  • - A pool created without a rule in global stretch mode now gets the stretch rule, as on main.
    - --root, --zone_failure_domain, --osd_failure_domain and --class would have no effect there, so they are refused instead of ignored.
    - Test: mon-stretch-pool-create-global-rule.sh.
  • B08 mon/OSDMonitor: enable stretch mode only once a pool create has passed every check.

  • - Before: a 2-zone pool create that failed a later check (for example differing datacenter weights) left the monitors in stretch mode.
    - Now: the stretch settings are validated where they were but applied at the end of prepare_new_pool().
    - Tests: mon-stretch-failed-create-mons.sh and mon-stretch-failed-pool-create.sh. The second relies on A04.
  • B09 doc,qa: describe the erasure code profile lifecycle.

  • - A profile is created by osd erasure-code-profile set or by osd pool create with k and m, and it is deleted with the last pool that uses it.
    - This is described in the user docs and in a new section 2.1.5 of the design.
    - mon/osd-crush.sh and the teuthology rados task no longer reuse a deleted profile.
  • B10 mon: keep the legacy positional arguments of osd pool create.

  • - The new stretch parameters were inserted after rule, so a legacy positional create passed expected_num_objects as num_zones.
    - They now follow --, so they can only be given by name.
    - Test: mon-stretch-pool-create-positional.sh.
  • B11 mon/OSDMonitor: require k and m for a multi-zone EC pool.

  • - osd pool create <pool> erasure --num_zones 2 without k and m used to take the default profile. It also turned the shared erasure-code rule into a two-datacenter rule, which later single-zone EC pools then used. It is now refused.
    - Test: mon-stretch-pool-create-multi-zone-km.sh.
  • B12 mon/OSDMonitor: refuse stretch set and unset while multi-zone pools exist.

  • - Both commands are also refused while global stretch mode is enabled in the monitor map, and while any committed or pending pool has num_zones > 1. A num_zones 3 pool enables no stretch mode, so A11's check alone does not cover it.
    - refuse_in_stretch_mode() becomes an OSDMonitor member. The search is find_multi_zone_pool(), built on find_pool(), which finds the first committed or pending pool that a predicate accepts.
    - Docs: design 2.1.5, 11.4.1 and story 4a, and doc/rados.
    - It keeps the refusal of "mon: Prevent osd pool stretch set for EC", and leaves the Per-Pool Stretch Mode paragraph of stretch-mode.rst as that commit worded it. B16 follows up both.
    - Tests: mon-stretch-multi-zone-stretch-set.sh, with two tests.
  • B13 mon/OSDMonitor: refuse a multi-zone pool in global stretch mode.

  • - osd pool create refuses num_zones > 1 while global stretch mode is enabled or being enabled. The check runs before an EC pool's generated profile is created, so that profile is not left behind.
    - validate_stretch_mode_new_pool() then has no caller left. It is removed, along with extract_sites_from_crush_rule() and their 5 unit tests.
    - crush-stretch.sh drops TEST_stretch_diff_sites and reduces TEST_stretch_diff_bucket_barrier, which tested that validation.
    - Test: mon-stretch-global-mode-multi-zone.sh.
  • B14 mon/OSDMonitor: refuse global stretch mode while multi-zone pools exist.

  • - ceph mon enable_stretch_mode is refused while any committed or pending pool has num_zones > 1. It would otherwise manage that pool as a legacy stretch pool.
    - Docs: design 11.4.2 and story 4b.
    - Test: in mon-stretch-global-mode-multi-zone.sh.
  • B15 mon/OSDMonitor: refuse placement options for a single-zone replicated pool.

  • - The placement options were accepted and ignored for a replicated pool with no rule and num_zones 1. They are now refused.
    - The global stretch mode refusal from B07 is reworded to point at --rule.
    - Test: mon-stretch-replicated-placement-options.sh.
  • B16 mon/OSDMonitor: refuse osd pool set num_zones.

  • - Before: when sent as a mon command, osd pool set num_zones was accepted and resized an EC pool, leaving its rule and stretch values for the old zone count. Changing num_zones is a later release (design 13.2).
    - Now: the variable is refused, and the EC resize is dropped.
    - Test: mon-stretch-set-num-zones.sh.
    - Follow-up to "mon: Prevent osd pool stretch set for EC", which pointed users at ceph osd pool set <pool> num_zones <N>. Its refusal in stretch set is removed: A08 refuses every EC pool before it, and it names the command B16 refuses. The pools.rst note and two stretch-mode.rst sentences now say that a multi-zone pool, replicated or erasure coded, is created with ceph osd pool create ... --num-zones, and that num_zones cannot be changed afterwards. These hunks can be squashed into that commit once it comes after A08 and after B16's refusal (see the notes for reviewers).
  • B17 doc/rados: create a stretch pool with --num-zones. The "Creating Stretch Pools" example in stretch-mode.rst, which B16's sentences link to, used zone=2, which the monitor refuses ("error parsing integer value 'zone=2'"). It now uses --num-zones 2.

  • B18 qa/tasks/ceph_manager: create multi-zone EC pools from k and m. teuthology's create_pool passed the suite's erasure code profile name together with --num_zones, which the monitor refuses, so the num_zones 2 pools of thrash-erasure-code-big and thrash-erasure-code-stretch could not be created. It now sets up the <pool>-k<k>-m<m> profile with the named profile's keys and creates the pool with --k, --m and --num_zones.

  • B19 qa/tasks: build a two-zone custom rule for a multi-zone EC pool. The erasure_code_crush variant built a one-zone rule for a 2-zone pool, which spread each zone's block of shards over both datacenters. It now builds the rule with --num_zones.

  • B20 mon/OSDMonitor: refuse enable_stretch_mode while erasure coded pools exist.

  • - This restores main's refusal and message. Global stretch mode is the legacy stretch mode and keeps main's behaviour.
    - The unittest_osd_monitor EC tests now expect the refusal.
    - Test: mon-stretch-enable-ec-pool.sh.
  • B21 doc/dev: ec_stretch_cluster: a 2-zone pool create enables stretch mode. Covers the Pool Creation Gate of 11.4.2, the 11.1 prerequisites table, the 11.3 state diagram, and section 15, where FastEC is the only release check.

  • B22 doc/dev: ec_stretch_cluster: describe min_size as section 11.2.1 does.

  • - In healthy stretch mode a PG needs min_size + k + m shards in total; in degraded and recovery stretch mode it needs min_size shards in the surviving zone. The monitor does not change an EC pool's min_size.
    - It also recorded that the transitions still halved and reset the min_size of every replicated stretch pool, num_zones 2 pools included, as a difference from section 11.2. B27 changes that, and B28 updates the doc.
  • B23 mon/OSDMonitor: refuse a multi-zone pool while individual stretch pools exist.

  • - osd pool create refuses num_zones > 1 while any committed or pending pool is an individual stretch pool, meaning one with stretch values and num_zones 1. Before, the stretch mode that the new pool enabled went on to change that pool in its transitions.
    - The check sits next to B13's, before any profile or rule is created. The pool is found with find_pool(), as in B12.
    - Test: TEST_multi_zone_pool_create_with_stretch_pool.
  • B24 test/mon: demonstrate an umbrella monmap decoding as global stretch mode. Two new unittest_mon_monmap tests set stretch_mode_enabled, encode the monmap with all features (which include SERVER_UMBRELLA) and decode it. They expect global_stretch_mode_enabled to come back as it was set. With it set to false, the test fails until B25.

  • B25 mon/MonMap: encode the umbrella monmap as struct version 11.

  • - Before: "mon/MonMap: Return early from encoding if before umbrella" encoded the umbrella monmap as version 10, but still appended global_stretch_mode_enabled, a version 11 field. MonMap::decode() reads that field only from version 11, and otherwise sets it to stretch_mode_enabled. So once a 2-zone pool create enabled stretch mode, every monitor saw global stretch mode enabled too, and B13 refused later num_zones > 1 creates, including that create when it was resent after the election. TEST_pool_create_stretch_ec and TEST_pool_create_stretch_replica in crush-stretch.sh, and TEST_multi_zone_pool_create_with_stretch_pool and TEST_stretch_pool_commands_with_two_zone_pools in mon-stretch-multi-zone-stretch-set.sh, failed because of it.
    - Now: the umbrella monmap is encoded as version 11 again, as before that commit. compat_v stays 6, so a decoder that knows only version 10 skips the last field.
    - Test: B24.
    - Follow-up to "mon/MonMap: Return early from encoding if before umbrella". It can be squashed into that commit (see the notes for reviewers).
  • B26 qa/standalone/mon-stretch: demonstrate stretch transitions changing a multi-zone pool's min_size.

  • - TEST_multi_zone_replicated_min_size in the new mon-stretch-multi-zone-min-size.sh creates replicated --num-zones 2 pools with the default min_size (2) and with min_size 1, loses a zone, creates another min_size 1 pool in degraded stretch mode, and brings the zone back. It expects every pool to keep its min_size, and fails until B27.
    - TEST_global_stretch_mode_min_size checks that a pool in global stretch mode still has its min_size halved on the degraded transition and set to mon_stretch_pool_min_size on the healthy one, as on main.
    - lose_dc2 and restore_dc2 move the zone loss and return of mon-stretch-ec-pool-create-degraded.sh into mon-stretch-helpers.sh.
  • B27 mon/OSDMonitor: keep a multi-zone pool's min_size on stretch mode transitions.

  • - Before: the degraded transition halved the min_size of every replicated stretch pool, and the healthy transition set it to mon_stretch_pool_min_size (2), num_zones 2 pools included. A pool created with min_size 1 went to 0 in degraded stretch mode and to 2 once healthy again, and stayed at 2.
    - Now: both transitions leave the min_size of a pool with num_zones > 1 alone, as section 11.2 of the design intends. Legacy stretch pools (num_zones 1: global stretch mode and individual stretch pools) keep main's behaviour.
    - Default min_size: a --num-zones 2 pool with two replicas per zone gets min_size 2, the default for its size of 4. The degraded transition used to lower it to 1. It now stays 2, so in degraded stretch mode its PGs need both copies in the surviving zone. With min_size 1 such a pool behaves as the default pool did before, in every stretch mode state. See the open question in the notes below.
    - Test: B26.
  • B28 doc: stretch mode transitions keep a multi-zone pool's min_size.

  • - Design sections 11.3, 11.4.3 and 11.4.4, where B22 recorded the old behaviour as a difference from 11.2, and 11.4.2 for a pool created in degraded stretch mode.
    - Section 11.3 also says that the OSD counts min_size per zone only for EC pools: a replicated multi-zone PG needs min_size replicas in its acting set, with one in each zone while healthy and all in the surviving zone while degraded.
    - In stretch-mode.rst, the stretch mode overview now limits the drop to min_size 1 to global stretch mode. The Per-Pool Stretch Mode paragraph says that the loss and return of a zone do not change a --num-zones pool's min_size, and that while a zone is down its PGs need min_size copies or shards in the surviving zone.

    Testing


    This series was rebased onto stretchy-C 6583a082fa6, which adds Eric Zhang's "mon/MonMap: Return early from encoding if before umbrella" and "mon: Prevent osd pool stretch set for EC". B25 follows up the first of them.

    On the tip, 9bf0d84d877 (only the tip was built and run, not the commits one by one, apart from B24's and B26's tests):

  • Build: a full ninja -j20 (incremental, from a full build of 3a120537f19), then ninja -j20 unittest_osd_monitor unittest_osdmap unittest_mon_monmap, passed with no errors or warnings.

  • Unit tests: unittest_mon_monmap passed 4/4 (its 3 disabled tests stay disabled), unittest_osd_monitor passed 11/11 (B13 removes 5), and unittest_osdmap passed 46/46. On an earlier run of unittest_osdmap, OSDMapTest.rb_osdsize_opt_score failed once; its upmap balancing shuffles with a random seed, it then passed 30 runs on its own, and this series does not touch src/osd.

  • B24's test without B25: built and run at B24, MonMapEncode.umbrella_stretch_mode_without_global failed with "Value of: m.global_stretch_mode_enabled, Actual: true, Expected: false". The other three unittest_mon_monmap tests passed.

  • B26's test without B27: built and run at B26, TEST_multi_zone_replicated_min_size failed at its first check in degraded stretch mode, where the default pool had min_size 1 and the min_size 1 pool had min_size 0. A copy of the test that logs the values instead of failing showed all three pools at min_size 2 after the healthy transition. TEST_global_stretch_mode_min_size passed. With B27 both tests pass (below).

  • Standalone tests, run one at a time. All passed, with no cores. Times include setup and teardown and are to about 10 s.

  • - every qa/standalone/mon-stretch script:
    - mon-stretch-commands.sh (4 tests, 291 s)
    - mon-stretch-ec-pool-create-degraded.sh (321 s)
    - mon-stretch-enable-ec-pool.sh (90 s)
    - mon-stretch-fail-recovery.sh (250 s)
    - mon-stretch-failed-create-mons.sh (140 s)
    - mon-stretch-failed-pool-create.sh (10 s)
    - mon-stretch-global-mode-multi-zone.sh (2 tests, 181 s)
    - mon-stretch-multi-zone-min-size.sh (2 tests, 330 s)
    - mon-stretch-multi-zone-stretch-set.sh (3 tests, 361 s)
    - mon-stretch-pool-create-degraded.sh (210 s)
    - mon-stretch-pool-create-global-rule.sh (90 s)
    - mon-stretch-pool-create-multi-zone-km.sh (10 s)
    - mon-stretch-pool-create-positional.sh (20 s)
    - mon-stretch-replicated-placement-options.sh (10 s)
    - mon-stretch-set-num-zones.sh (10 s)
    - mon-stretch-uneven-crush-weights.sh (160 s)
    - crush/crush-stretch.sh (9 tests, 971 s)
    - mon/osd-pool-create.sh (19 tests, 491 s)
  • Before B25, four of these tests failed on this series: TEST_pool_create_stretch_ec and TEST_pool_create_stretch_replica in crush-stretch.sh, and TEST_multi_zone_pool_create_with_stretch_pool and TEST_stretch_pool_commands_with_two_zone_pools in mon-stretch-multi-zone-stretch-set.sh. In each, after a 2-zone pool create enabled stretch mode, the committed monmap decoded with global stretch mode enabled too, and B13 refused the create when it was resent after the election (see B25). They pass at the tip.

  • B17's example was run on a 2-zone cluster with the tip's monitor code (B23 with B25's change made locally): ceph osd pool create mypool 32 32 replicated my_stretch_rule --num-zones 2 created a size 4 pool with num_zones 2 on that rule, and its PGs went clean. The old zone=2 form was refused with "error parsing integer value 'zone=2'".

  • git log --check is clean. docutils on the four changed .rst files reports only unknown Sphinx directives and roles; pools.rst has one more prompt directive than before the rebase, and B28 adds no message.

  • Not run:

  • - The qa/tasks changes in B09, B18 and B19 were not run in teuthology. B19's commands were replayed on a standalone cluster, as its message says.
    - B02's librados test. It was built before the rebase, but not run.
    - The docs were not built with Sphinx.

    Before the rebase, testing was done on the branch this series was consolidated from (74 commits, tip c899e84cf13, on stretchy-C fb56ba2a73a). Its tree, 7999c4a51ee, differed from this series' tree before the rebase (6593cfcbb1f) only by one line of the design doc: section 11.4.1 no longer says "as on main". Before B26, the tree differed from 6593cfcbb1f only in src/mon/MonMap.cc (Eric's first commit and B25), in src/test/mon/MonMap.cc (B24), in crush-stretch.sh (Eric's second commit removed the two stretch set commands from TEST_stretch_ec_stretch_set), and in pools.rst and stretch-mode.rst (Eric's heading underline, B16's rewording of his note and two sentences, and B17's example), and src/mon/OSDMonitor.cc was identical. B26-B28 then change src/mon/OSDMonitor.cc (B27), three mon-stretch scripts (B26) and two docs (B28). The standalone runs above replace the ones made there. These earlier results were not repeated on the tip:

  • Full build with -k 0: ninja -k 0 -j20 passed with no errors or warnings. The full build of the tip above was incremental.

  • On an earlier tip of the source branch with the same ceph-helpers.sh as this tip, qa/standalone/ceph-helpers.sh TESTS test_run_mon test_activate_mon passed. On a still earlier tip, with the same MonCommands.h and osd-crush.sh but before A06 split activate_mon out of run_mon in ceph-helpers.sh, src/test/pybind/test_ceph_argparse.py gave 139 OK and mon/osd-crush.sh passed 9/9.

  • Without the fix: each fix commit's message says how its test fails without the fix. Those results come from runs against a ceph-mon built without the fix, made when each test was written.

  • - B23 was checked at the source tree. With its src/mon change reverse-applied, TEST_multi_zone_pool_create_with_stretch_pool failed: the monitor answered "pool 'rep2' created" while rep was stretched.
    - TEST_stretch_pool_commands_with_two_zone_pools (B12) passes without B12's fix, as expected, because A11 already refuses both commands once a 2-zone pool has enabled stretch mode.
    - B12's three-zone test was run against the unfixed monitor in its earlier order, and it failed then. It was later reordered because B23 refuses its old setup. That the reordered test still fails without the fix comes from reading the code.

    Notes for reviewers


  • For Eric Zhang: two commits follow up your stretchy-C commits, for you to review and squash. This series is rebased onto both and keeps them unchanged.

  • - B16 follows up "mon: Prevent osd pool stretch set for EC". The series keeps that commit's crush-stretch.sh change, and B16 is the only commit that changes its lines. B16's last hunks adjust it to B16's refusal of osd pool set num_zones: they remove its refusal in prepare_command_pool_stretch_set(), and rewrite the pools.rst note and the two stretch-mode.rst sentences it changed. In those two sentences they also replace stretchy-C's own zone parameter and zone=N wording, which that commit did not change. They are for Eric to review, and to squash into his commit once it comes after A08 and after B16's refusal. Squashed where it is now, they would let stretch set accept an EC pool of any size until A08, since that commit already removed the old EC checks, and the docs would say that num_zones cannot be changed while the monitor still accepts osd pool set num_zones.
    - B25 follows up "mon/MonMap: Return early from encoding if before umbrella". It sets the version of the umbrella encoding back to 11, because that encoding still ends with the version 11 field global_stretch_mode_enabled. It can be squashed into that commit without conditions. B24's test then passes from its own commit on, so the last sentence of B24's message ("MonMapEncode.umbrella_stretch_mode_without_global fails on the current code.") should be dropped when B25 is squashed.
  • Erasure coded pools and the legacy commands:

  • - stretch set refuses erasure coded pools (A08). stretch unset can then only meet an EC pool that an older release stretched, and accepts it only with size k+m and min_size between k and k+m.
    - ceph mon enable_stretch_mode is refused while any EC pool exists, with main's message (B20), because global stretch mode is the legacy stretch mode.
    - A multi-zone EC pool gets its stretch values only from osd pool create --num_zones, and osd pool set num_zones is refused (B16).
  • Individual stretch pools vs stretch mode and multi-zone pools. These are kept exclusive:

  • - stretch set and unset are refused while stretch mode is enabled (A11), whether it is global or started by a num_zones 2 create. They are also refused while global stretch mode is enabled in the monitor map, and while any pool has num_zones > 1 (B12).
    - A num_zones > 1 create is refused in global stretch mode (B13) and while an individual stretch pool exists (B23).
    - enable_stretch_mode is refused while a multi-zone pool exists (B14).
    - These checks count committed and pending pools alike. So a stretch unset or pool delete that has not yet committed makes a num_zones 2 create fail until it commits; the client can retry.
  • Resolved: replicated min_size on transitions (B26-B28).

  • - A multi-zone pool (num_zones > 1), EC or replicated, keeps the min_size it was created with or last set to through the degraded, recovery and healthy transitions, as section 11.2 intends. That includes a pool created in degraded stretch mode.
    - Legacy stretch pools (num_zones 1: the pools of global stretch mode and individual stretch pools) still have min_size halved on the degraded transition and set to mon_stretch_pool_min_size on the healthy one, as on main.
  • Open question: the default min_size of a replicated multi-zone pool.

  • - A --num-zones 2 pool with two replicas per zone gets min_size 2, the default for its size of 4 (B06). Before B27 the degraded transition lowered it to 1, as it still does for a global stretch mode pool, so one more OSD in the surviving zone could fail.
    - It now stays 2. In degraded stretch mode its PGs need both copies in the surviving zone, and I/O stops if either is lost.
    - Setting min_size 1 gives the old behaviour in every state, because while healthy the stretch peering rules still need a copy in each zone.
    - https://github.com/aainscow/ceph/pull/35 derives the default from the replicas per zone, which gives 1, together with a per-zone check in the OSD. That default on its own would also let a num_zones 3 pool, which gets no stretch values, go active with one copy.
    - This series leaves the default as it is.
  • min_size on the OSD side. The design doc now gives min_size as in section 11.2.1, but OSDMap::stretch_ec_num_acting_below_min_size() applies min_size to each zone, which is section 11.2.2. Changing the OSD is a separate follow-up. https://github.com/aainscow/ceph/pull/42 has a test that asserts the current behaviour. For a replicated multi-zone pool, the OSD counts min_size in the whole acting set, and the stretch peering rules choose the zones; B28 says so in section 11.3.

  • Overlaps with other stretchy-C PRs:

  • - https://github.com/aainscow/ceph/pull/35 (Kamoltat Sirivadhna, per-zone replica min_size, on an older stretchy-C) includes commits from https://github.com/aainscow/ceph/pull/15 and "mon: disallow EC Pool creation in global stretch mode". It touches the same areas as B13, B14 and B20 (multi-zone and EC pools in global stretch mode), B16, B27 and the min_size docs of B22 and B28. Its "osd, mon: support per-zone min_size for stretch pools" removes the min_size changes from both transitions for every replicated stretch pool, those of global stretch mode included, where B27 keeps them for num_zones 1 pools. The same commit derives a replicated multi-zone pool's default min_size from its replicas per zone (see the open question above). Expect conflicts in OSDMonitor.cc.
    - https://github.com/aainscow/ceph/pull/15 (Callum James, "Support for setting num_zones via ceph osd pool set") is the opposite of B16, which refuses osd pool set num_zones.
  • Commit structure:

  • - B07 adds the global stretch mode refusal in prepare_pool_crush_rule(), and B15 rewords it.
    - B09 combines qa and doc changes and can be split if preferred.
    - B16, B20 and B25 cite the stretchy-C commits they follow up or correct by subject, since stretchy-C's shas change with each rebase.

    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)

  • - [x] References tracker ticket
    - [x] 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
    - [x] No impact that needs to be tracked
  • Documentation (select at least one)

  • - [x] Updates relevant documentation
    - [ ] No doc update is appropriate
  • Tests (select at least one)

  • - [x] Includes unit test(s)
    - [x] Includes integration test(s)
    - [x] Includes bug reproducer
    - [ ] No tests

    <details>
    <summary>Show available Jenkins commands</summary>

  • jenkins test classic perf Jenkins Job | Jenkins Job Definition

  • jenkins test crimson perf Jenkins Job | Jenkins Job Definition

  • jenkins test signed Jenkins Job | Jenkins Job Definition

  • jenkins test make check Jenkins Job | Jenkins Job Definition

  • jenkins test make check arm64 Jenkins Job | Jenkins Job Definition

  • jenkins test submodules Jenkins Job | Jenkins Job Definition

  • jenkins test dashboard Jenkins Job | Jenkins Job Definition

  • jenkins test dashboard cephadm Jenkins Job | Jenkins Job Definition

  • jenkins test api Jenkins Job | Jenkins Job Definition

  • jenkins test docs ReadTheDocs | Github Workflow Definition

  • jenkins test ceph-volume all Jenkins Jobs | Jenkins Jobs Definition

  • jenkins test windows Jenkins Job | Jenkins Job Definition

  • jenkins test rook e2e Jenkins Job | Jenkins Job Definition
  • You must only issue one Jenkins command per-comment. Jenkins does not understand
    comments with more than one command.
    </details>

    🤖 Generated with Claude Code

    https://claude.ai/code/session_012ETDivFUQubLqznTDowHRu

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: Ericmzhang Review duration: 3237m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #43"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%
    Repository