Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

CapacityRange limit_bytes not handled according to CSI spec, size semantics not correct #399

Open
okartau opened this issue Sep 10, 2019 · 2 comments
Assignees
Labels
future needs to be fixed in some future release

Comments

@okartau
Copy link
Contributor

okartau commented Sep 10, 2019

Current PMEM-CSI implementation handling of CapacityRange.{required_bytes,limit_bytes}
is only partial implementation of what CSI spec requires.
What is required by spec: both fields are optional, but one of two MUST be present.
PMEM-CSI: does not check this properly. We use required_bytes for "asked" and assume it is present.
limit_bytes presence or value we never check (but we log the value).

Creation sizes semantics is respectively also not correct.
Spec says, if limit_bytes is present, volume MUST not be larger.
PMEM_CSI does not implement that.
Use of same value in both req. and limit values is a method to specify exact volume size in request.
This is not attempted nor checked by PMEM_CSI either.
Created PMEM Volume is usually bigger than request, caused by alignment requirements on underlying device.
Requested exact allocation (both sizes set to same in request) can lead to situation where PMEM-CSI has to return error if Volume of such exact size can not be created.
In this case PMEM-CSI has to return "OUT OF RANGE" error (not currently done).

If I look through current e2e, sanity test logs (LVM case), most creation requests do specify required_bytes=N and limit_bytes=0.
Some requests however specify required_bytes=1MB and limit_bytes=1MB.
PMEM-CSI creates a 4MB file system (which is miminum by LVM volume sizes) in return,
which is clearly violating CSI spec, as 1MB volume should get created.
However, test code does not complain.

@okartau okartau self-assigned this Sep 10, 2019
@okartau okartau changed the title CapacityRange required_bytes, limit_bytes not handled by CSI spec., size semantics not correct CapacityRange limit_bytes not handled by CSI spec., size semantics not correct Sep 10, 2019
@okartau
Copy link
Contributor Author

okartau commented Sep 11, 2019

The fact that current PMEM-CSI code passes e2e and sanity tests, is a sign that this scenario is not tested.

@okartau okartau changed the title CapacityRange limit_bytes not handled by CSI spec., size semantics not correct CapacityRange limit_bytes not handled according to CSI spec, size semantics not correct Dec 16, 2019
@pohly pohly added the future needs to be fixed in some future release label May 18, 2020
@pohly
Copy link
Contributor

pohly commented Apr 23, 2021

Maximum size is unused in Kubernetes, see kubernetes-csi/external-provisioner#616

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
future needs to be fixed in some future release
Projects
None yet
Development

No branches or pull requests

2 participants