Skip to content

adaptive: honor user-provided capacityBytes when provider stats are unavailable#13059

Open
genegr wants to merge 2 commits intoapache:mainfrom
genegr:feat/adaptive-lifecycle-honor-user-capacity
Open

adaptive: honor user-provided capacityBytes when provider stats are unavailable#13059
genegr wants to merge 2 commits intoapache:mainfrom
genegr:feat/adaptive-lifecycle-honor-user-capacity

Conversation

@genegr
Copy link
Copy Markdown

@genegr genegr commented Apr 22, 2026

Description

Registering an adaptive-plugin-backed managed primary pool currently fails with Capacity bytes not available from the storage provider, user provided capacity bytes must be specified even when capacityBytes= is actually passed to createStoragePool, whenever the provider cannot report capacity at that moment (for example a FlashArray pod with no quota and no footprint yet, or a transient probe failure).

Root cause lives in AdaptiveDataStoreLifeCycleImpl.initialize(): the user-supplied capacity was guarded behind stats != null, so any null stats caused a fall-through to the "no user capacity either" error branch even when the user did provide one.

This change accepts the user-supplied value unconditionally and uses the provider stats only as an upper-bound sanity check when they are actually available. The "no user-provided capacity, no provider capacity" branch is preserved and still raises the same InvalidParameterValueException.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)

Feature/Enhancement Scale or Bug Severity

Major for any deployment that uses the adaptive storage framework against a provider which cannot report capacity synchronously at pool-register time — registration will always fail regardless of what capacityBytes is passed.

How Has This Been Tested?

Validated end-to-end on a 4.23-SNAPSHOT lab:

  • Registered a FlashArray primary pool (provider="Flash Array", transport=nvme-tcp) against an empty Purity pod with capacitybytes=1099511627776 and capacityiops=100000. Before this change, the registration failed with the error above; after this change, the pool enters the Up state using the user-provided capacity.
  • Registered a pool against a pod that does report stats; the pool's capacity comes from the provider as before, and the upper-bound check still rejects a user-supplied capacityBytes that exceeds the provider's capacity.
  • Exercised a 20 GiB volume end-to-end (create, attach to a Rocky 9 VM, mkfs.ext4 + SHA-256 write/verify, live-migrate between two KVM hosts with the data disk attached — no I/O gap across the migrate).

@winterhazel
Copy link
Copy Markdown
Member

@genegr as this is a simple bug fix, could you rebase over branch 4.20 to include it on the next 4.20/4.22 minor versions?

…navailable

AdaptiveDataStoreLifeCycleImpl.initialize() guarded the user-provided
capacityBytes behind stats != null when computing the pool capacity to
persist. As a consequence, any adaptive provider that could not report
capacity yet (for example a FlashArray pod that has not been given a
quota and has no footprint yet, or a transient probe failure) caused the
whole pool registration to fail with "Capacity bytes not available from
the storage provider, user provided capacity bytes must be specified"
even when the operator had passed capacityBytes= on createStoragePool.

Accept the user-supplied value unconditionally and use the provider
stats only as an upper-bound sanity check when they are actually
available. The "no user-provided capacity, no provider capacity" branch
is preserved and still raises the same InvalidParameterValueException.

Signed-off-by: Eugenio Grosso <eugenio.grosso@gmail.com>
@genegr genegr force-pushed the feat/adaptive-lifecycle-honor-user-capacity branch from e7d2553 to 25641c3 Compare April 23, 2026 00:23

if (CollectionUtils.isNotEmpty(quarantinedAddressesIDs)) {
sc.setParameters("id", quarantinedAddressesIDs.toArray());
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@genegr IP related changes are not relevant to the PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants