Ceph fast EC: stripe_unit must be divisible by 4096 error
Since Tentacle 20.2.1, allow_ec_optimizations is refused on EC pools whose chunk size is not a 4K multiple. Check the chunk size, then use a new pool.
stripe_unit must be divisible by 4096 to enable ec optimizationsIf ceph osd pool set <pool> allow_ec_optimizations true returns this, the pool's chunk size (stripe_unit) is not a multiple of 4096 bytes. Since Tentacle 20.2.1 (2026-04-06), the monitor refuses to enable fast EC on such pools. The chunk size cannot change after the pool is created, so fast EC is not possible on this pool; if you need it, create a new pool with a 4K multiple (16K is what the docs recommend) and move the data. The block above is not captured output; it is the string in the source ([OSDMonitor.cc L8414-L8419, v20.2.4](https://github.com/ceph/ceph/blob/v20.2.4/src/mon/OSDMonitor.cc#L8414-L8419)).
[1] Understand why it is blocked. The 20.2.1 entry of the Tentacle release notes says unaligned chunk sizes handled by fast EC perform poorly and suffer from bugs, so this configuration is now rejected. The fix is PR #67319 (tentacle backport of #67314 on main, merged 2026-02-19), and the originating tracker #74813 is titled "All The OSDs in the cluster crash if allow_ec_optimizations is set regardless of allow_ec_overwrites" (reported on 20.2.0, Resolved).
[2] Tell it apart from the other refusals of the same command. enable_pool_ec_optimizations() checks in this order ([OSDMonitor.cc L8377-L8446](https://github.com/ceph/ceph/blob/v20.2.4/src/mon/OSDMonitor.cc#L8377-L8446)).
| Message | Cause |
|---|---|
allow_ec_optimizations can only be enabled for an erasure coded pool | The pool is replicated |
All OSDs must be upgraded to tentacle or later before setting allow_ec_optimizations | require_osd_release is below tentacle |
ec optimizations not currently supported for pool profile. | Unsupported plugin or technique |
stripe_unit must be divisible by 4096 to enable ec optimizations | Chunk size is not a 4K multiple |
For the second row, deal with OSD_UPGRADE_FINISHED: require_osd_release < tentacle first. The third row happens because, per the EC docs, only Jerasure and ISA-L with the reed_sol_van technique support fast EC today.
[3] Compute the pool's chunk size. The EC profile docs say a pool's stripe_width is the number of data chunks (k) multiplied by stripe_unit. So check whether stripe_width ÷ k is a multiple of 4096.
$ ceph osd pool ls detail$ ceph osd pool get <pool> erasure_code_profile$ ceph osd erasure-code-profile get <profile>Read the pool's stripe_width from the first command and k from the third. For example, k=4 with stripe_width 16384 gives a 4096 chunk and passes; if the profile sets no stripe_unit, the default osd_pool_erasure_code_stripe_unit (4K) is used ([mon.yaml.in L16-L27](https://github.com/ceph/ceph/blob/v20.2.4/src/common/options/mon.yaml.in#L16-L27)).
[4] Know that enabling it cannot be undone. The EC docs say the flag cannot be disabled once enabled for a pool because it changes how new data is stored, and the source refuses with allow_ec_optimizations cannot be disabled once enabled. The docs also recommend a stripe_unit of at least 16K with fast EC, and note that the stripe unit cannot change after pool creation, so enabling fast EC on an existing pool does not give the full benefit.
[5] If the chunk is not a 4K multiple, or you want 16K, create a new profile and pool. Match k, m and the failure domain to your current profile, and write the plugin and technique explicitly as a supported pair.
$ ceph osd erasure-code-profile set ec-fast k=4 m=2 plugin=isa technique=reed_sol_van stripe_unit=16K crush-failure-domain=host$ ceph osd pool create <new-pool> erasure ec-fast$ ceph osd pool set <new-pool> allow_ec_optimizations trueIf you only ran the first line, undo it with ceph osd erasure-code-profile rm ec-fast. A profile with a stripe_unit that is not a 4K multiple is refused with stripe_unit should be a multiple of 4096 bytes for best performance. and a hint to use --force ([OSDMonitor.cc L7551-L7555](https://github.com/ceph/ceph/blob/v20.2.4/src/mon/OSDMonitor.cc#L7551-L7555)). For a fast EC pool, fix the value instead of forcing it. Moving existing data differs for RBD, CephFS and RGW; the docs only say that since a profile cannot change, you create a new pool and move the objects.
[6] Check the setting that enables it automatically on new pools. With osd_pool_default_flag_ec_optimizations (default false) set to true, the monitor tries to set the flag when a new EC pool is created, but the source does not report a failure at that point ([OSDMonitor.cc L8342-L8345](https://github.com/ceph/ceph/blob/v20.2.4/src/mon/OSDMonitor.cc#L8342-L8345)). After creating a pool, look for ec_optimizations in its flags in ceph osd pool ls detail.
If you already enabled it on an unaligned pool under 20.2.0, the docs offer no way to turn the flag off, and the 20.2.1 fix only blocks new attempts. An official recovery procedure for that state could not be found.