New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[manila-csi-plugin] Add support for online volume expansion #1579
[manila-csi-plugin] Add support for online volume expansion #1579
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
@lingxiankong is the CI disabled? No acceptance tests were run. |
/retest |
No idea, I checked the http://status.openlabtesting.org/status, seems fine |
Maybe it was restarted, now I see the job is running. |
Build succeeded.
|
Build succeeded.
|
Weird... Thank you @lingxiankong ! |
Build succeeded.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
// Share is already larger than requested size | ||
|
||
return &csi.ControllerExpandVolumeResponse{ | ||
CapacityBytes: currentSizeInBytes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isnt it better to add NodeExpansionRequired: false, if node expansion not required? It says required field in csi spec.
// Whether node expansion is required for the volume. When true
// the CO MUST make NodeExpandVolume RPC call on the node. This field
// is REQUIRED.
bool node_expansion_required = 2;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NodeExpansionRequired bool
is initialized to false
by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok fine then
} | ||
|
||
return &csi.ControllerExpandVolumeResponse{ | ||
CapacityBytes: int64(desiredSizeInGiB * bytesInGiB), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
if _, isPending := pendingVolumes.LoadOrStore(share.Name, true); isPending { | ||
return nil, status.Errorf(codes.Aborted, "volume named %s is already being processed", share.Name) | ||
} | ||
defer pendingVolumes.Delete(share.Name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gman0 Just wondering here, why we need to delete volumes here if some operation is in progress ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pendingVolumes
is a sync.Map
. It acts like a try-lock: it tries to lock a resource (with share name as the key), protecting it against concurrent use. The Delete()
just deletes a key from the map, freeing the lock for that volume.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, got it. Thanks
{ | ||
Type: &csi.PluginCapability_VolumeExpansion_{ | ||
VolumeExpansion: &csi.PluginCapability_VolumeExpansion{ | ||
Type: csi.PluginCapability_VolumeExpansion_ONLINE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gman0 Is OFFLINE capability not applicable for manila csi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think VolumeExpansion.OFFLINE
and VolumeExpansion.ONLINE
pertain to what happens when the volume is in use while its being expanded, rather than if it's allowed to be online/offline.
This call MAY be made by the CO during any time in the lifecycle of the volume after creation if plugin has
VolumeExpansion.ONLINE
capability.
https://github.com/container-storage-interface/spec/blob/master/spec.md#controllerexpandvolume
Manila doesn't care whether a share is in use or not, so I think advertising online expansion only is enough. I asked at the CSI slack channel to make sure though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll send a comment here once somebody replies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got a response: external-resizer doesn't check offline/online caps anyway, and they will be even deprecated from the CSI spec. See release notes at https://github.com/container-storage-interface/spec/releases/tag/v1.5.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that manila doesn't care if share is in use or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems good to me if ramineni's questions have been answered.
Looks good to me /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ramineni The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thank you all for reviews! I'll follow up with pull requests like we agreed: consolidating log messages and lowering verbosity levels. |
…es#1579) * implemented ControllerExpandVolume with online volume expansion support * updated CSI sanity tests * updated Helm chart * updated k8s manifests * updated docs * updated examples * docs: extend -> expand
What this PR does / why we need it:
This PR implements online
EXPAND_VOLUME
controller capability.Which issue this PR fixes(if applicable):
fixes #1475
Special notes for reviewers:
Release note: