Repository navigation
Conversation
…aying half size Carried from ceph/ceph PR 72381 (branch wip-stretch-degraded-pool-create); drop when stretchy-C is rebased onto a main that has it. 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
…raded stretch mode Carried from ceph/ceph PR 72381 (branch wip-stretch-degraded-pool-create); drop when stretchy-C is rebased onto a main that has it. 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
Carried from branch wip-mon-failed-pool-create, together with Jamie Pryde's "mon: Roll back pending_inc on prepare_new_pool failure" from ceph/ceph PR 71130, which follows unchanged; drop both when stretchy-C is rebased onto a main that has them. prepare_new_pool() adds the new pool to pending_inc before it has finished checking the request. If a later check fails, for example a crimson erasure pool whose profile does not support EC optimizations, the pool stays in pending_inc without a name. The next proposal then asserts in OSDMap::get_pool_name() from OSDMap::check_health(): osd/OSDMap.h: 1437: FAILED ceph_assert(i != pool_name.end()) Assisted-by: Claude Code
Any error return in prepare_new_pool() after the new pool has been inserted into pending_inc.new_pools and pending_inc.new_pool_max has been incremented, but before pending_inc.new_pool_names is set, leaves pending_inc in an inconsistent state: the pool ID is present in new_pools but absent from new_pool_names. On the next encode_pending() call, apply_incremental() adds the unnamed pool to tmp.pools but not to tmp.pool_name. check_health() then iterates pools and calls get_pool_name() on the unnamed ID, hitting ceph_assert(i != pool_name.end()) and crashing the monitor. Fix with a make_scope_guard() that erases the pool from pending_inc.new_pools and decrements pending_inc.new_pool_max on scope exit. The guard is dismissed once new_pool_names is set, so any error return between pool allocation and name assignment automatically triggers rollback without requiring explicit cleanup at each site. Fixes: https://tracker.ceph.com/issues/79574 Signed-off-by: Jamie Pryde <[email protected]> Assisted-by: IBM Bob 2.0.2
Carried from ceph/ceph PR 72378 (branch wip-monc-ping-uaf); drop when stretchy-C is rebased onto a main that has it. ping_monitor() deletes its temporary messenger while its ConnectionRef is still in scope, so the last reference goes when the function returns and ~AsyncConnection then reads async_msgr->cct from the freed messenger. With cephx, "ceph ping mon.X" segfaulted in 164 of 180 attempts on a vstart cluster: SubsystemMap::should_gather AsyncConnection::~AsyncConnection MonClient::ping_monitor librados::RadosClient::ping_monitor Release the connection before shutting the messenger down. After this, 180 pings had no crashes. Fixes: https://tracker.ceph.com/issues/81400 Assisted-by: Claude Code
Carried from branch wip-mon-stretch-command-fixes for ceph/ceph main; drop when stretchy-C is rebased onto a main that has it. run_mon always runs ceph-mon --mkfs before it starts the daemon, so a test that kills a monitor and starts it again on its existing data has to repeat the arguments run_mon gives ceph-mon. Move the command that starts the daemon into activate_mon, as activate_osd does for OSDs, and call it from run_mon after --mkfs. test_activate_mon restarts a monitor with an extra option. Assisted-by: Claude Code
Carried from branch wip-mon-stretch-command-fixes for ceph/ceph main; drop when stretchy-C is rebased onto a main that has it. Stretch mode on main supports replicated pools only: enable_stretch_mode refuses a cluster with erasure coded pools, and pool creation refuses them once stretch mode is on. 'ceph osd pool stretch set' does not check the pool type, so it turns an erasure coded pool into a stretch pool, and 'ceph osd pool stretch unset' then applies whatever size it is given, for example size 6 to a k=2 m=1 pool. Add mon-stretch-commands.sh for the stretch pool and stretch mode commands, with a test on 3 mons and no OSDs that expects stretch set on an EC pool to fail and the pool's size and min_size to stay as created, and a replicated pool as the control. Only stretch set is checked: with a fixed monitor no EC pool can be made a stretch pool, so the size check of stretch unset cannot be set up, and the test only expects unset to find no stretch pool. TEST_stretch_set_ec_pool fails on the current code. Fixes: https://tracker.ceph.com/issues/81427 Assisted-by: Claude Code
Carried from branch wip-mon-stretch-command-fixes for ceph/ceph main; drop when stretchy-C is rebased onto a main that has it. Stretch mode on main supports replicated pools only, but 'ceph osd pool stretch set' accepted an erasure coded pool, and 'ceph osd pool stretch unset' then applied any size to it (a k=2 m=1 pool became size 6). stretch set now refuses an erasure coded pool with -EINVAL, worded as enable_stretch_mode words the same refusal. stretch unset can then only meet an erasure coded pool that an older mon stretched. Refusing it outright would leave no way to clear the stretch values, so it accepts such a pool only with size k+m and min_size between k and k+m, which also repairs a size the old stretch set changed, and refuses anything else with -EINVAL. Fixes: https://tracker.ceph.com/issues/81427 Assisted-by: Claude Code
Carried from branch wip-mon-stretch-command-fixes for ceph/ceph main; drop when stretchy-C is rebased onto a main that has it. Say in doc/rados that 'ceph osd pool stretch set' refuses erasure-coded pools, and what 'ceph osd pool stretch unset' needs to clear an erasure-coded pool that an older release made a stretch pool. The EC stretch cluster design said that stretch set works for any pool type and that stretch unset needs no EC-specific changes. Say that stretch set refuses EC pools and which EC pools stretch unset accepts, and that allowing EC pools with zones > 1 must relax that refusal and let the unset size check allow zones x (K+M). Fixes: https://tracker.ceph.com/issues/81427 Assisted-by: Claude Code
…ch mode Carried from branch wip-mon-stretch-command-fixes for ceph/ceph main; drop when stretchy-C is rebased onto a main that has it. 'ceph osd pool stretch set' and 'ceph osd pool stretch unset' configure an individual stretch pool, which doc/rados/operations/stretch-mode.rst offers as the alternative to stretch mode. Stretch mode manages the pools' stretch values itself: enable_stretch_mode sets them, and the degraded and healthy transitions change them. The monitor nevertheless accepts both commands while stretch mode is enabled. For example, stretch set run in degraded stretch mode gives the pool the healthy bucket count, so its PGs stay peered until the lost zone returns. Add a test to mon-stretch-commands.sh that enables stretch mode with 3 mons and 4 OSDs in two zones and expects stretch set and stretch unset to fail and to leave the pool's bucket count, crush rule and size alone. Stretch set succeeds on the current code. Fixes: https://tracker.ceph.com/issues/81428 Assisted-by: Claude Code
…abled Carried from branch wip-mon-stretch-command-fixes for ceph/ceph main; drop when stretchy-C is rebased onto a main that has it. 'ceph osd pool stretch set' and 'ceph osd pool stretch unset' configure an individual stretch pool, the alternative to stretch mode, but the monitor accepted both while stretch mode was enabled. Stretch mode sets the pools' stretch values itself and changes them in its degraded and healthy transitions, and a pool changed by hand does not follow them: stretch set in degraded stretch mode gave the pool the healthy bucket count, so its PGs stayed peered until the lost zone returned. Refuse both commands with -EINVAL while stretch mode is enabled. Fixes: https://tracker.ceph.com/issues/81428 Assisted-by: Claude Code
Carried from branch wip-mon-stretch-command-fixes for ceph/ceph main; drop when stretchy-C is rebased onto a main that has it. Say in doc/rados that 'ceph osd pool stretch set' and 'ceph osd pool stretch unset', which configure individual stretch pools, fail while stretch mode is enabled. Say the same in the EC stretch cluster design, and that allowing EC pools with zones > 1 must relax this refusal as well. Fixes: https://tracker.ceph.com/issues/81428 Assisted-by: Claude Code
…iming to act when it cannot Carried from branch wip-mon-stretch-command-fixes for ceph/ceph main; drop when stretchy-C is rebased onto a main that has it. 'ceph osd force_healthy_stretch_mode' only ends recovery stretch mode, but in healthy or degraded stretch mode it does nothing and still replies "Triggering healthy stretch mode" with success, so an operator who runs it before the cluster is recovering believes it took effect. Add a test to mon-stretch-commands.sh that expects the command to fail in healthy and in degraded stretch mode, and to return the cluster to healthy stretch mode once it is recovering. Zone pze is lost by killing its mon and OSDs and restored by starting them again with activate_mon and activate_osd. The command succeeds in healthy stretch mode on the current code. Fixes: https://tracker.ceph.com/issues/81429 Assisted-by: Claude Code
…tch mode Carried from branch wip-mon-stretch-command-fixes for ceph/ceph main; drop when stretchy-C is rebased onto a main that has it. 'ceph osd force_healthy_stretch_mode' only ends recovery stretch mode. In healthy or degraded stretch mode, or without stretch mode, it did nothing and still replied "Triggering healthy stretch mode" with success. Refuse it with -EINVAL and say that the cluster is not in recovery stretch mode, before asking for --yes-i-really-mean-it. force_recovery_stretch_mode has no such check to follow. Fixes: https://tracker.ceph.com/issues/81429 Assisted-by: Claude Code
Carried from branch wip-mon-stretch-command-fixes for ceph/ceph main; drop when stretchy-C is rebased onto a main that has it. Say that 'ceph osd force_healthy_stretch_mode' fails unless the cluster is in recovery mode. Fixes: https://tracker.ceph.com/issues/81429 Assisted-by: Claude Code
ceph-mon no longer accepts --auth-supported, so every test in crush-stretch.sh failed at the first run_mon. Use the same options as the other standalone tests (875eab6). Assisted-by: Claude Code
create_ec_pool_pp() built its two-zone test pool from a named profile with a single-zone CRUSH rule, set num_zones afterwards through a raw 'osd pool set' and then gave the pool its stretch values with 'osd pool stretch set'. Stretch set refuses an erasure coded pool since "mon/OSDMonitor: refuse to stretch an erasure coded pool", carried above, and a later commit in this series refuses the raw 'osd pool set num_zones'. A multi-zone EC pool is created from k and m with num_zones, which builds a two-zone CRUSH rule and puts the pool in stretch mode. Create the test pool with one 'osd pool create' carrying k, m, num_zones 2 and the OSD failure domain the old profile used. RadosTestECPP creates this pool only when the cluster has a two-zone topology. Assisted-by: Claude Code
Add mon-stretch-helpers.sh, which the mon-stretch tests that follow
source, so that each stretch fix's test can live in its own script:
- run_stretch_tests runs the TEST_ functions given, or all of them,
with a fresh cluster each;
- wait_for_stretch_state waits for the OSDMap's degraded and
recovering stretch mode values, and pool_field reads a field of a
pool;
- two_zone_cluster starts monitors a in dc1, b in dc2 and c as the
arbiter, a manager, and a given number of OSDs (default 3) in each
of dc1 and dc2, on a host each;
- ec_stretch_cluster_without_dc2 adds a 2-zone EC pool to that cluster
and takes dc2's monitor and OSDs down, leaving degraded stretch mode;
- enable_global_stretch_mode enables global stretch mode ('ceph mon
enable_stretch_mode') over the datacenters, with a pool on a stretch
rule.
Assisted-by: Claude Code
…tch mode A replicated pool created in degraded stretch mode keeps its size and bucket target and gets the degraded bucket count and halved min_size that the existing stretch pools have, so the healthy transition restores it with them, as "mon/OSDMonitor: keep size and bucket target for a pool created in degraded stretch mode" (carried above) does. Say so in section 11.4.3. The stretch mode transitions never change peering_crush_bucket_target; only the bucket count and the mandatory member change. Correct the degraded and recovery rows of the EC example table in section 11.6 and its bucket_max note. Assisted-by: Claude Code
…created Creating a pool with --num-zones 2 configures it through try_enable_stretch_mode(), which also wrote the cluster's stretch state and set degraded_stretch_mode to 0. With a zone down this ended degraded mode without the healthy transition: the other stretch pools kept a bucket count of 1 and the surviving zone as mandatory member, and the lost zone's monitor stayed in stretch_marked_down_mons, so it could never lead. If the other zone then failed, the remaining monitor and the tiebreaker could not form a quorum. Write the cluster's stretch state only when stretch mode is not already enabled. A pool joining a degraded stretch mode gets the degraded bucket count and the surviving mandatory member that the other pools have, so it can go active on the surviving zone and is restored with them. Section 11.4.2 of the design says that a 2-zone pool created while stretch mode is enabled configures only the new pool. TEST_ec_pool_create_in_degraded_stretch_mode in mon-stretch-ec-pool-create-degraded.sh creates a second stretch EC pool with one zone down, checks that the cluster stays in degraded mode, brings the zone back, and checks that both pools are fully stretched again and that losing the other zone still leaves a quorum. Without the fix it fails at the first check. Assisted-by: Claude Code
'osd pool create <pool> --num-zones 2' builds a stretch rule that takes num_replica_per_zone (default 2) hosts in each zone, but prepare_pool_size() ignored num_zones for a replicated pool created without a size, so the pool got osd_pool_default_size (3) and one zone held a single replica. Use num_zones * num_replica_per_zone, and the matching default min_size. Global stretch mode keeps mon_stretch_pool_size. Section 2.1.3 of the design says so. TEST_pool_create_stretch_replica in crush-stretch.sh now expects size 4 and min_size 2 for a 2-zone pool; without the fix the pool gets size 3. Assisted-by: Claude Code
…etch mode On main, 'osd pool create' without a rule in stretch mode uses the stretch rule of the existing stretch pools. Here prepare_pool_crush_rule() created a new rule for the pool from num_zones, which defaults to 1, so the pool's copies were not split between the sites. Use the stretch rule of the existing stretch pools, as main does, and create a rule for the pool only when num_zones asks for more than one zone. Such a pool takes the cluster's rule, so --root, --zone_failure_domain, --osd_failure_domain and --class would have no effect. Refuse them instead of ignoring them, as is already done for an EC pool created without k and m: global stretch mode is the legacy stretch mode and does not take the new placement options. Section 2.1.4 of the design describes this. TEST_stretch_mode_pool_create_without_rule in mon-stretch-pool-create-global-rule.sh enables global stretch mode, expects a pool created without a rule to get the stretch rule, and expects a create with any of the placement options to be refused. Without the fix the pool gets a single-zone rule and the options are accepted. Assisted-by: Claude Code
…d every check prepare_new_pool() committed monitor stretch mode before it validated the pool's stretch settings. When that validation failed, for example because the two datacenters differ in weight, or when a later check failed, such as FastEC support for a multi-zone erasure pool, the create failed but the monitors stayed in stretch mode with a tiebreaker and connectivity elections. Validate the monitor and pool stretch settings where they were, but apply them at the end of prepare_new_pool(), after the remaining checks. A failed create no longer leaves the monitors or the OSDMap in stretch mode. TEST_failed_stretch_pool_create_leaves_mons in mon-stretch-failed-create-mons.sh makes a 2-zone EC create fail on the weight check and expects the monitors to stay out of stretch mode; it fails without the fix. TEST_failed_stretch_pool_create_leaves_no_pool in mon-stretch-failed-pool-create.sh covers the pool side of a failed stretch create: a --num-zones 2 replicated create that fails because stretch mode cannot be enabled for the monitors, after prepare_new_pool() has allocated the pool, must leave the next pool create working. That relies on "mon: Roll back pending_inc on prepare_new_pool failure", carried above. Assisted-by: Claude Code
An erasure code profile is created either with '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, as main already deletes an erasure pool's CRUSH rule. Describe this in the profile and pool user docs, with a note for scripts that reuse a profile after deleting its pools. Add section 2.1.5 to the design: how a pool gets its profile (generated from k and m, named, or default), the generated profile's name and contents, the parameter combinations the monitor refuses, how the profile sets the pool's size, shard counts and CRUSH rule, what multi-zone pools need, that num_zones is a pool option and not a profile key, and when a profile is deleted. Correct the design passages that said stretch EC pools do not use profiles and that num_zones would be changed by swapping profiles. Two qa users reused a profile after deleting its last pool. TEST_erasure_pool_crush_rule_rm in osd-crush.sh now checks that the profile went with the pool and sets it again. The rados task set up its profile and CRUSH rule once and then created and deleted pools in every run, so a second run created its pools with a profile that no longer existed; it now sets them up at the start of every run. Assisted-by: Claude Code
The stretch pool parameters (num_zones, root, zone_failure_domain, osd_failure_domain, num_replica_per_zone, class) were inserted after "rule" in the osd pool create command description, so a legacy positional create such as ceph osd pool create p 8 8 erasure default erasure-code 1000 passed 1000 as num_zones instead of expected_num_objects and failed with "erasure_code_profile cannot be used with multi-zone configurations". The design keeps the legacy positional syntax and adds no positional arguments. Restore main's order for the existing parameters and list the ones added for stretch pools (num_zones, root, zone_failure_domain, osd_failure_domain, num_replica_per_zone, class, k and m) after "--", so they can only be given by name. TEST_legacy_positional_pool_create in mon-stretch-pool-create-positional.sh expects the legacy erasure and replicated forms to set expected_num_objects; without the fix the erasure one fails. Assisted-by: Claude Code
'osd pool create <pool> erasure --num_zones 2' without --k/--m and without a profile was accepted. The pool took the default profile, and the shared erasure-code rule was built for it as a two-datacenter stretch rule, which the next plain 'osd pool create <pool> erasure' then also used, placing a single-zone pool in one datacenter. The design creates multi-zone EC pools from k and m, never from an existing profile. Refuse such a create with -EINVAL, as an explicit profile with num_zones > 1 already is, and list the refusal with the other parameter combinations in section 2.1.5 of the design. TEST_multi_zone_ec_pool_requires_k_m in mon-stretch-pool-create-multi-zone-km.sh expects the refusal; without the fix the pool is created. Assisted-by: Claude Code
…xist
'ceph osd pool stretch set' and 'unset' configure individual stretch
pools, while a pool with num_zones > 1 takes its size and stretch
values from num_zones at creation. Both commands are refused while the
OSDMap has stretch mode enabled ("mon/OSDMonitor: refuse stretch set
and unset while stretch mode is enabled", carried above), which covers
the stretch mode a num_zones 2 pool create enables. A pool with
num_zones > 2 enables no stretch mode, and the commands still changed
any pool, the multi-zone pool included, while one existed.
Also refuse both commands with -EINVAL while any pool, committed or
pending, has num_zones > 1, and check global stretch mode in the
monitor map together with the OSDMap's stretch mode.
refuse_in_stretch_mode() becomes an OSDMonitor member. find_pool()
finds the first committed or pending pool that a predicate accepts,
and find_multi_zone_pool() uses it to find a pool with num_zones > 1.
With global stretch mode refused, stretch set no longer reaches the
validation of the new CRUSH rule it ran in global stretch mode; remove
it.
Section 11.4.1 of the design planned EC validation for stretch set.
Stretch set is not part of the stretch EC design: a multi-zone pool
takes its stretch values from num_zones at creation. Say in 11.4.1 and
story 4a of section 14 that stretch set refuses erasure coded pools,
and that stretch set and unset are refused while stretch mode is
enabled, global or started by a num_zones 2 pool create, and while any
pool has num_zones > 1. Add the last refusal to section 2.1.5, and say
the same in doc/rados. stretch-mode.rst also said that stretch unset
disables stretch mode for individual pools, which is not possible while
stretch mode is enabled.
mon-stretch-multi-zone-stretch-set.sh has two tests.
TEST_stretch_pool_commands_with_two_zone_pools creates a 2-zone
replicated and a 2-zone EC pool and expects stretch set and unset to
fail for both and for an ordinary replicated pool, leaving their
stretch values and size alone.
TEST_stretch_pool_commands_with_three_zone_pool expects the same with
a 3-zone replicated pool, which enables no stretch mode, and expects
stretch set to work once the 3-zone pool is deleted; without the fix
stretch set is accepted for the replicated pool while the 3-zone pool
exists.
Assisted-by: Claude Code
Global stretch mode ('ceph mon enable_stretch_mode') is the legacy
stretch mode and keeps its earlier behaviour, while a pool with
num_zones > 1 sets up its own stretch mode. 'osd pool create' accepted
num_zones > 1 in global stretch mode: a replicated pool was created,
and an EC pool was refused only after its generated profile had been
created, which stayed behind.
Refuse num_zones > 1 with -EINVAL while global stretch mode is enabled
or being enabled, before anything is created. prepare_new_pool() then
no longer sees a multi-zone pool in global stretch mode, so drop the
rule validation it ran for one. As stretch set is refused in stretch
mode too, validate_stretch_mode_new_pool() has no caller left: remove
it, extract_sites_from_crush_rule(), which only it used, and its unit
tests (OSDMonitorValidateStretchModeNewPoolTest). Sections 2.1.3, 2.1.4
and 11.4.2 of the design say so; the note that a pool created after
enable_stretch_mode does not get the mandatory member now applies only
to the legacy pools of global stretch mode.
TEST_multi_zone_pool_create_in_global_stretch_mode in
mon-stretch-global-mode-multi-zone.sh enables global stretch mode and
expects replicated and EC creates with num_zones 2 to be refused,
leaving no pool, CRUSH rule or profile; without the fix the replicated
pool is created.
crush-stretch.sh created multi-zone pools in global stretch mode in
three tests. TEST_stretch_diff_sites and
TEST_stretch_diff_bucket_barrier did so only to see the pool refused
for a CRUSH rule over other datacenters or over another bucket type
than stretch mode's, which nothing reaches any more.
TEST_stretch_diff_sites goes, and TEST_stretch_diff_bucket_barrier
keeps only enabling stretch mode over zone buckets with a device class
rule. TEST_stretch_replica_device_class_pools creates its pools without
num_zones.
Assisted-by: Claude Code
'ceph mon enable_stretch_mode' takes every pool into global stretch mode, the legacy stretch mode, which manages it as a legacy stretch pool: it sets size and min_size from mon_stretch_pool_size and mon_stretch_pool_min_size, and disable_stretch_mode resets the pool to the default size and rule. A pool with num_zones > 1 has its own stretch values and keeps them in step itself, yet enable_stretch_mode succeeded with one present. Refuse enable_stretch_mode with -EINVAL while any pool, committed or pending, has num_zones > 1, before anything is changed. The pool is found with find_multi_zone_pool(), as for stretch set and unset. Section 11.4.2 of the design planned for enable_stretch_mode to accept multi-zone EC pools and set their stretch values, and story 4b of section 14 still planned it. A multi-zone pool gets its stretch values when it is created; describe the refusal instead. min_size stays as created and is interpreted as in section 11.2.1 rather than set to r(k+m)-m. TEST_enable_stretch_mode_with_multi_zone_pool in mon-stretch-global-mode-multi-zone.sh creates a 2-zone replicated pool and expects enable_stretch_mode to be refused, even with the pool's own rule, and global stretch mode to stay off; without the fix it is enabled. Assisted-by: Claude Code
… pool A replicated pool created without a rule and with num_zones 1 uses the default replicated rule outside global stretch mode, so --root, --zone_failure_domain, --osd_failure_domain and --class were accepted and ignored. Refuse them with -EINVAL, as global stretch mode already does for its pools, which use the stretch rule. Multi-zone pools and EC pools, whose rule is built from these options, are not affected. The global stretch mode refusal said the options "cannot be used without num_zones in stretch mode", which suggests giving num_zones, and num_zones > 1 is refused in global stretch mode. Point at --rule instead. Sections 2.1.4 and 2.1.5 of the design quote both refusals. TEST_single_zone_replicated_placement_options in mon-stretch-replicated-placement-options.sh expects each option to be refused, with and without --num-zones 1, and no pool to be created; without the fix the pool is created. TEST_stretch_mode_pool_create_without_rule in mon-stretch-pool-create-global-rule.sh expects the new global stretch mode wording. Assisted-by: Claude Code
MonMap::encode() for umbrella peers writes a version 10 header, but it still appends global_stretch_mode_enabled, a version 11 field. MonMap::decode() reads that field only from version 11, and for older versions sets it to stretch_mode_enabled. So a monmap with stretch mode enabled and global stretch mode disabled, as a num_zones 2 pool create leaves it, decodes with global stretch mode enabled. Add two unittest_mon_monmap tests. Each sets stretch_mode_enabled, encodes the monmap with CEPH_FEATURES_ALL, which includes SERVER_UMBRELLA, and decodes it. global_stretch_mode_enabled must come back as it was set: false in umbrella_stretch_mode_without_global, true in umbrella_global_stretch_mode. MonMapEncode.umbrella_stretch_mode_without_global fails on the current code. Assisted-by: Claude Code
"mon/MonMap: Return early from encoding if before umbrella" gave pre-umbrella peers a version 9 encoding of their own, and changed the version of the umbrella encoding from 11 to 10. That encoding still ends with global_stretch_mode_enabled, a version 11 field. MonMap::decode() reads the field only when struct_v >= 11. For a version 10 struct it sets global_stretch_mode_enabled to stretch_mode_enabled. So once a num_zones 2 pool create enables stretch mode, every monitor decodes the committed monmap with global stretch mode enabled too. Later num_zones > 1 creates are then refused as if 'ceph mon enable_stretch_mode' had been run. So is the create that enabled stretch mode, when it is resent after the election that enabling stretch mode starts. These standalone tests fail: - crush/crush-stretch.sh: TEST_pool_create_stretch_ec and TEST_pool_create_stretch_replica - mon-stretch/mon-stretch-multi-zone-stretch-set.sh: TEST_multi_zone_pool_create_with_stretch_pool and TEST_stretch_pool_commands_with_two_zone_pools Encode the umbrella monmap as version 11 again, as before that commit. compat_v stays 6, so a decoder that knows only version 10 still accepts it and skips the last field. This can be squashed into "mon/MonMap: Return early from encoding if before umbrella". Assisted-by: Claude Code
… multi-zone pool's min_size The degraded stretch mode transition halves the min_size of every replicated pool with stretch values, and the healthy transition sets it to mon_stretch_pool_min_size. That includes replicated pools created with --num-zones 2. Section 11.2 of the design gives the min_size of a multi-zone pool for one zone and interprets it for the stretch mode state instead, so the transitions should leave it alone. TEST_multi_zone_replicated_min_size in the new mon-stretch-multi-zone-min-size.sh creates two replicated --num-zones 2 pools, one with the default min_size (2) and one with min_size 1 (osd_pool_default_min_size 1, as vstart.sh sets it). It loses dc2, creates a third pool with min_size 1 in degraded stretch mode, and brings dc2 back. It checks that each pool keeps its min_size in degraded and in healthy stretch mode. It fails at the first check in degraded stretch mode, where the default pool has min_size 1 and the min_size 1 pool has min_size 0. After the healthy transition all three pools have min_size 2. TEST_global_stretch_mode_min_size checks that a pool in global stretch mode, the legacy 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. It passes. lose_dc2 and restore_dc2 move the zone loss and return of mon-stretch-ec-pool-create-degraded.sh into mon-stretch-helpers.sh. Assisted-by: Claude Code
…nsitions trigger_degraded_stretch_mode() halved the min_size of every replicated pool with stretch values, and trigger_healthy_stretch_mode() set it to mon_stretch_pool_min_size (default 2). That included replicated pools created with --num-zones 2. A pool created with min_size 1 got min_size 0 in degraded stretch mode, which 'osd pool set' refuses, and min_size 2 once the cluster was healthy again. From then on its PGs needed two copies instead of the one it was created with. A pool created in degraded stretch mode kept its min_size only until the healthy transition. Section 11.2 of the design gives the min_size of a multi-zone pool, EC or replicated, for one zone, and does not change it on transitions. The transitions already leave EC pools alone. Leave the min_size of pools with num_zones > 1 alone on both transitions. Legacy stretch pools, with num_zones 1, are those of global stretch mode and individual stretch pools. Their min_size is still halved on the degraded transition and set to mon_stretch_pool_min_size on the healthy one, as on main. The pool create path that halves min_size in degraded stretch mode is taken only in global stretch mode, which refuses multi-zone pools, so it is unchanged. Only for an EC pool does the OSD count min_size per zone. A replicated PG needs min_size copies in its acting set, and the stretch peering rules take them from both zones while healthy and from the surviving zone while degraded. A --num-zones 2 pool with two replicas per zone gets the default min_size for its size of 4, which is 2. The degraded transition used to lower that 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 in every stretch mode state as the default pool did before. TEST_multi_zone_replicated_min_size passes now. Assisted-by: Claude Code
Sections 11.3, 11.4.3 and 11.4.4 of the design said that the monitor halves the min_size of every replicated stretch pool, num_zones 2 pools included, on the degraded transition and sets it to mon_stretch_pool_min_size on the healthy one, and recorded that as a difference from the intent of section 11.2. The monitor now leaves the min_size of every multi-zone pool alone. Say so there, and that only legacy replicated stretch pools, with num_zones 1, still have their min_size changed, as on main. Say in 11.3 that the OSD counts min_size per zone only for EC pools, and what a replicated multi-zone PG needs instead. Say in 11.4.2 that a pool created in degraded stretch mode keeps its min_size. stretch-mode.rst said that the loss of a data center reduces the min_size of all pools to 1. Say that this is for the pools in global stretch mode, that the loss and return of a zone do not change the min_size of a pool created with --num-zones, and that while a zone is down its PGs need min_size copies or shards in the surviving zone. Assisted-by: Claude Code
| * Remove the need for an EC profile. Indeed, stretch mode EC pools will be mutually | ||
| exclusive with the use of a profile. | ||
| * Remove the need to create an EC profile before the pool: ``--k`` and ``--m`` generate one | ||
| for the pool (Section 2.1.5). A multi-zone EC pool cannot be created from an existing |
There was a problem hiding this comment.
I think this is inaccurate since we are allowing num_zones with EC profile.
| @@ -252,7 +253,8 @@ These parameters are intended for advanced users and offer finer control over th | |||
| **--erasure_code_profile** | |||
| - *Definition*: The legacy EC Profile to use. | |||
| - *Note*: Mutually exclusive with ``--num_zones``: Cannot be used with multi-zone configurations. Also | |||
There was a problem hiding this comment.
This is no longer true.
| * ``--erasure_code_profile`` with ``--k`` and ``--m``: "cannot specify both | ||
| erasure_code_profile and k/m parameters". | ||
| * Only one of ``--k`` and ``--m``: "erasure_code_profile requires both k and m". | ||
| * ``--erasure_code_profile`` (any name, ``default`` included) with ``--num_zones`` greater |
| * ``--erasure_code_profile`` (any name, ``default`` included) with ``--num_zones`` greater | ||
| than 1: "erasure_code_profile cannot be used with multi-zone configurations". | ||
| ``--num_zones 1`` is accepted. | ||
| * ``--num_zones`` greater than 1 without ``--k`` and ``--m``: "multi-zone erasure coded |
There was a problem hiding this comment.
Is this correct? I would think we would want to allow a default "osd pool create foo erasure --num-zones 2"
| } | ||
| string name; | ||
| int num_zones = 0; | ||
| if (find_multi_zone_pool(&name, &num_zones)) { |
There was a problem hiding this comment.
Calls this due to num_zones > 2 not enabling stretch mode but num_zones > 2 is not supported anyways. Safe to keep still.
| ``num_zones`` is stored as a pool option, set on every pool at creation (default 1), and not in | ||
| the profile. ``ceph osd pool get <pool> num_zones`` shows it. It cannot be changed after | ||
| creation; changing the number of zones of an existing pool is a later release (Section 13.2). | ||
| ``ceph osd pool set`` does not offer ``num_zones``, and the monitor refuses it with EINVAL also |
There was a problem hiding this comment.
This is wrong since changing num_zones is supported.
| block of ``k+m`` shards (Section 11.2). | ||
| * ``min_size`` to ``k + min(1, m-1)``, not scaled by ``num_zones``. ``min_size`` is given for | ||
| one zone and interpreted as in Section 11.2.1: in healthy stretch mode a PG needs | ||
| ``min_size + k + m`` shards in total, and in degraded stretch mode ``min_size`` shards in the |
There was a problem hiding this comment.
This is wrong it needs min_size (k) shards per zone.
| * - **Healthy** | ||
| - ``num_zones × (K+M) − M`` | ||
| - Full redundancy; tolerate up to M failures | ||
| - ``min_size + K + M`` in total |
There was a problem hiding this comment.
At least min_size shards per zone
| * - **Healthy** (resync complete) | ||
| - ``num_zones × (K+M) − M`` | ||
| - Full min_size restored | ||
| - ``min_size + K + M`` in total |
There was a problem hiding this comment.
min_size shards per zone
| - The acting set includes at least K shards in at least one surviving zone | ||
| - In healthy mode, all zones have ``K+M`` shards | ||
| - In healthy mode, the acting set has at least | ||
| ``min_size + (num_zones − 1) × (K + M)`` shards across all zones |
There was a problem hiding this comment.
min_size * num_zones across all zones
| - **Rule: if a zone fails, reduce min_size by K+M. If a zone becomes | ||
| healthy again, increase min_size by K+M.** | ||
| A zone failure does not change ``min_size``; it changes where the shards are | ||
| counted (Section 11.2.1). The number of shards a PG needs falls by ``K+M`` |
| - *Pool Size*: For an EC pool, the resulting pool ``size`` is ``num_zones × (k + m)``. For a | ||
| replicated pool created with ``num_zones`` greater than 1 and without ``--size``, it is | ||
| ``num_zones × num_replica_per_zone`` (4 for 2 zones of 2 replicas). In global stretch mode | ||
| (``ceph mon enable_stretch_mode``) a replicated pool's size is ``mon_stretch_pool_size``. |
There was a problem hiding this comment.
#35
will introduce --replica. For replicated pool size = num_zones x replica
|
Closing. This PR was split into smaller PRs, each reviewed and merged into stretchy-C:
The rest was not carried forward:
|
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 commandsceph osd pool stretch setandunset. 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 (6583a08), 35 files, +2089 -756:
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.
pending_incand crashed the monitor (https://tracker.ceph.com/issues/79574). The fix is Jamie Pryde's, from mon: Roll back pending_inc on prepare_new_pool failure ceph/ceph#71130; the test is main-bound but not yet proposed.ceph ping mon.X. From mon/MonClient: drop the ping connection before deleting its messenger ceph/ceph#72378, for https://tracker.ceph.com/issues/81400.stretch setrefuses erasure coded pools (test, fix, doc)stretch setandunsetare refused while stretch mode is enabled (test, fix, doc)force_healthy_stretch_modefails 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:
Part B: stretchy-C commits
run_mon, because ceph-mon no longer accepts--auth-supported.stretch set, which A08 refuses for an EC pool, andosd pool set num_zones, which B16 refuses. The pool is now created with oneosd pool createcarrying k, m and num_zones 2.mon-stretch-helpers.sh, which the new mon-stretch scripts source. It providesrun_stretch_tests,wait_for_stretch_state,pool_field,two_zone_cluster(with an optional number of OSDs per datacenter),ec_stretch_cluster_without_dc2andenable_global_stretch_mode.peering_crush_bucket_target.--num-zones 2pool with a zone down resetdegraded_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.mon-stretch-ec-pool-create-degraded.sh.--num-zones 2replicated pool created without a size gotosd_pool_default_size(3), so one zone held a single replica.num_zones * num_replica_per_zone(4) and the matching min_size.TEST_pool_create_stretch_replicaincrush-stretch.sh.--root,--zone_failure_domain,--osd_failure_domainand--classwould have no effect there, so they are refused instead of ignored.mon-stretch-pool-create-global-rule.sh.prepare_new_pool().mon-stretch-failed-create-mons.shandmon-stretch-failed-pool-create.sh. The second relies on A04.osd erasure-code-profile setor byosd pool createwith k and m, and it is deleted with the last pool that uses it.mon/osd-crush.shand the teuthology rados task no longer reuse a deleted profile.rule, so a legacy positional create passedexpected_num_objectsasnum_zones.--, so they can only be given by name.mon-stretch-pool-create-positional.sh.osd pool create <pool> erasure --num_zones 2without 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.mon-stretch-pool-create-multi-zone-km.sh.refuse_in_stretch_mode()becomes an OSDMonitor member. The search isfind_multi_zone_pool(), built onfind_pool(), which finds the first committed or pending pool that a predicate accepts.stretch-mode.rstas that commit worded it. B16 follows up both.mon-stretch-multi-zone-stretch-set.sh, with two tests.osd pool createrefuses 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 withextract_sites_from_crush_rule()and their 5 unit tests.crush-stretch.shdropsTEST_stretch_diff_sitesand reducesTEST_stretch_diff_bucket_barrier, which tested that validation.mon-stretch-global-mode-multi-zone.sh.ceph mon enable_stretch_modeis refused while any committed or pending pool has num_zones > 1. It would otherwise manage that pool as a legacy stretch pool.mon-stretch-global-mode-multi-zone.sh.--rule.mon-stretch-replicated-placement-options.sh.osd pool set num_zoneswas 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).mon-stretch-set-num-zones.sh.ceph osd pool set <pool> num_zones <N>. Its refusal instretch setis removed: A08 refuses every EC pool before it, and it names the command B16 refuses. Thepools.rstnote and twostretch-mode.rstsentences now say that a multi-zone pool, replicated or erasure coded, is created withceph 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).stretch-mode.rst, which B16's sentences link to, usedzone=2, which the monitor refuses ("error parsing integer value 'zone=2'"). It now uses--num-zones 2.create_poolpassed 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,--mand--num_zones.erasure_code_crushvariant 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.unittest_osd_monitorEC tests now expect the refusal.mon-stretch-enable-ec-pool.sh.osd pool createrefuses 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.find_pool(), as in B12.TEST_multi_zone_pool_create_with_stretch_pool.unittest_mon_monmaptests setstretch_mode_enabled, encode the monmap with all features (which includeSERVER_UMBRELLA) and decode it. They expectglobal_stretch_mode_enabledto come back as it was set. With it set to false, the test fails until B25.global_stretch_mode_enabled, a version 11 field.MonMap::decode()reads that field only from version 11, and otherwise sets it tostretch_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_ecandTEST_pool_create_stretch_replicaincrush-stretch.sh, andTEST_multi_zone_pool_create_with_stretch_poolandTEST_stretch_pool_commands_with_two_zone_poolsinmon-stretch-multi-zone-stretch-set.sh, failed because of it.TEST_multi_zone_replicated_min_sizein the newmon-stretch-multi-zone-min-size.shcreates replicated--num-zones 2pools 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_sizechecks that a pool in global stretch mode still has its min_size halved on the degraded transition and set tomon_stretch_pool_min_sizeon the healthy one, as on main.lose_dc2andrestore_dc2move the zone loss and return ofmon-stretch-ec-pool-create-degraded.shintomon-stretch-helpers.sh.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.--num-zones 2pool 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.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-zonespool'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 6583a08, 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, 9bf0d84 (only the tip was built and run, not the commits one by one, apart from B24's and B26's tests):
ninja -j20(incremental, from a full build of 3a12053), thenninja -j20 unittest_osd_monitor unittest_osdmap unittest_mon_monmap, passed with no errors or warnings.unittest_mon_monmappassed 4/4 (its 3 disabled tests stay disabled),unittest_osd_monitorpassed 11/11 (B13 removes 5), andunittest_osdmappassed 46/46. On an earlier run ofunittest_osdmap,OSDMapTest.rb_osdsize_opt_scorefailed once; its upmap balancing shuffles with a random seed, it then passed 30 runs on its own, and this series does not touchsrc/osd.MonMapEncode.umbrella_stretch_mode_without_globalfailed with "Value of: m.global_stretch_mode_enabled, Actual: true, Expected: false". The other threeunittest_mon_monmaptests passed.TEST_multi_zone_replicated_min_sizefailed 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_sizepassed. With B27 both tests pass (below).qa/standalone/mon-stretchscript: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)TEST_pool_create_stretch_ecandTEST_pool_create_stretch_replicaincrush-stretch.sh, andTEST_multi_zone_pool_create_with_stretch_poolandTEST_stretch_pool_commands_with_two_zone_poolsinmon-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.ceph osd pool create mypool 32 32 replicated my_stretch_rule --num-zones 2created a size 4 pool with num_zones 2 on that rule, and its PGs went clean. The oldzone=2form was refused with "error parsing integer value 'zone=2'".git log --checkis clean. docutils on the four changed.rstfiles reports only unknown Sphinx directives and roles;pools.rsthas one morepromptdirective than before the rebase, and B28 adds no message.Before the rebase, testing was done on the branch this series was consolidated from (74 commits, tip c899e84cf13, on stretchy-C fb56ba2). 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), insrc/test/mon/MonMap.cc(B24), incrush-stretch.sh(Eric's second commit removed the twostretch setcommands fromTEST_stretch_ec_stretch_set), and inpools.rstandstretch-mode.rst(Eric's heading underline, B16's rewording of his note and two sentences, and B17's example), andsrc/mon/OSDMonitor.ccwas identical. B26-B28 then changesrc/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:-k 0:ninja -k 0 -j20passed with no errors or warnings. The full build of the tip above was incremental.ceph-helpers.shas this tip,qa/standalone/ceph-helpers.sh TESTS test_run_mon test_activate_monpassed. On a still earlier tip, with the sameMonCommands.handosd-crush.shbut before A06 splitactivate_monout ofrun_moninceph-helpers.sh,src/test/pybind/test_ceph_argparse.pygave 139 OK andmon/osd-crush.shpassed 9/9.TEST_multi_zone_pool_create_with_stretch_poolfailed: the monitor answered "pool 'rep2' created" whilerepwas 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.Notes for reviewers
crush-stretch.shchange, and B16 is the only commit that changes its lines. B16's last hunks adjust it to B16's refusal ofosd pool set num_zones: they remove its refusal inprepare_command_pool_stretch_set(), and rewrite thepools.rstnote and the twostretch-mode.rstsentences it changed. In those two sentences they also replace stretchy-C's ownzoneparameter andzone=Nwording, 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 letstretch setaccept 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 acceptsosd pool set num_zones.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.stretch setrefuses erasure coded pools (A08).stretch unsetcan 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_modeis refused while any EC pool exists, with main's message (B20), because global stretch mode is the legacy stretch mode.osd pool create --num_zones, andosd pool set num_zonesis refused (B16).stretch setandunsetare 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).enable_stretch_modeis refused while a multi-zone pool exists (B14).stretch unsetor pool delete that has not yet committed makes a num_zones 2 create fail until it commits; the client can retry.mon_stretch_pool_min_sizeon the healthy one, as on main.--num-zones 2pool 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.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. test/osd: three-zone stretch EC unit tests #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.OSDMonitor.cc.osd pool set num_zones.prepare_pool_crush_rule(), and B15 rewords it.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
https://claude.ai/code/session_012ETDivFUQubLqznTDowHRu