-
Notifications
You must be signed in to change notification settings - Fork 807
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
Fix an error when creating a volume with topology feature gate #157
Conversation
Hi @dkoshkin. Thanks for your PR. I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Pull Request Test Coverage Report for Build 313
💛 - Coveralls |
952e1f8
to
bf0af10
Compare
/ok-to-test |
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.
In the waitForVolume case "creating" incorrectly returned an error. This would then return from cloud.CreateDisk, causing a possible race condition.
Good catch. We actually found the same bug when integrating integ test with Prow. And this bug is fixed at #156
Also are you testing on v1.13 cluster? Im wondering why we didn't catch this issue earlier.
Yes testing with Kubernetes |
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.
Good catch!
// volume exists already | ||
if disk != nil { | ||
disk.FsType = fsType |
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'm wondering if it's necessary for us to return the FS type as an attribute. The reason is that we don't do any validation with it, we simple send it back to the CO.
For example, if the client sends in an invalid FS type, we return success. Later on it'll fail when staging, but I'm wondering if we should return an error right here. Another option would be to ignore it (other drivers seems to do that).
@leakingtapan, do you know if it's strictly necessary that we return this info back to the CO?
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.
We need to pass fsType
back since it is needed by NodeStageVolume
later here.
Another option would be to ignore it (other drivers seems to do that).
In other driver, what's the behavior once a invalid fsType is ignored? Does it fall back to default option?
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.
We need to pass fsType back since it is needed by NodeStageVolume later here.
From what I understand from CreateVolume specs, that wouldn't be required.
I took a quick look in GCP and it seems like they don't handle fsType as well. It'd be nice to test this.
It'd be nice to have this tested, but we can probably do that in another PR.
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.
From what I understand from CreateVolume specs, that wouldn't be required.
It's not required in CreateVolume
but then when the volume is formatted in NodeStageVolume
the fsType is missing and it would just use the default right?
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.
@bertinatto it is not required to be CSI compliant, however, it is required to be EBS in-tree complicant since fsType
is supported there. See here. And this explains why it is not handled by GCE PD CSI driver since their in-tree doesn't have this. See here
@dkoshkin Yep. When fsType
is missing the default one will be used in node stage phase here
So from a EBS point of view, we would still need fsType
passed into NodeStageVolume
from CreateVolume
The change /lgtm @dkoshkin lets take a look at @bertinatto 's comment before merge. |
/lgtm |
/retest |
@dkoshkin you might need to rebase to pick up the fixes for integ test |
In the waitForVolume case "creating" incorrectly returned an error This exposed a bug where the AvailabilityZone and fsType were not properly set Which only surfaced when setting --feature-gates=Topology=true
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dkoshkin, leakingtapan 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 |
…owner carry: add BZ component
Is this a bug fix or adding new feature?
Bug fix
What is this PR about? / Why do we need it?
cloud.CreateDisk
, causing a possible race condition. Where the function driver.CreateVolume could create another disk with the samecom.amazon.aws.csi.volume
tag. Eventually erroring withErrMultiDisks
. This also exposed a bug where theAvailabilityZone
andfsType
were not properly set. Which only surfaced when setting--feature-gates=Topology=true
.volumeBindingMode: WaitForFirstConsumer
in the StorageClass because since the flag--feature-gates=Topology=true
is set and it is required for that feature.What testing is done?
Manual testing and new unit tests
Error
volume vol-0fff33f4c0834292a is still being created
returnedThen when the PV is created in Kubernetes,
values
field was empty formatchExpressions
:And the pod would not properly run:
This only really surfaced itself when setting
--feature-gates=Topology=true
since the pod needs to have the propernodeAffinity
set in PV spec.