Skip to content
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

Refactor re-use Access Point #1233

Merged

Conversation

otorreno
Copy link
Contributor

@otorreno otorreno commented Jan 3, 2024

Is this a bug fix or adding new feature?
Refactor of existing feature

What is this PR about? / Why do we need it?
When reuse access point flag is set to true, there is no point in doing a lot of work that is aimed at preparing the options for the createAccessPoint call (e.g. allocating a GID). We can save quite some time and quite some API calls if the AP with the same clientToken is found. The check for the AP existence has been moved from the CreateAccessPoint function one level up. The controller in this case checks if there is an access point with such client token, if so, it proceeds to return a CreateVolumeResponse. If it is not found, then it follows the usual flow.

What testing is done?
Coverage with unit tests

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 3, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @otorreno. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 3, 2024
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 3, 2024
@otorreno
Copy link
Contributor Author

otorreno commented Jan 4, 2024

@mskanth972 another change to reduce API calls. This time when reuseAccessPoint is set to true

@otorreno
Copy link
Contributor Author

otorreno commented Jan 8, 2024

@d-nishi / @jqmichael maybe you have a chance to review it?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 9, 2024
@otorreno otorreno force-pushed the reduce-efs-calls-reuse-ap branch from 6d3c741 to 358e62c Compare February 26, 2024 12:36
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 26, 2024
@otorreno
Copy link
Contributor Author

@mskanth972 can you PTAL?

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 28, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 26, 2024
@mskanth972
Copy link
Contributor

@otorreno can you rebase the PR?

@otorreno
Copy link
Contributor Author

otorreno commented Jul 3, 2024

Will have it rebased by Monday next week. I am OOO

When reuse access point flag is set to true, there is no point
in doing a lot of work that is aimed at preparing the options for
the createAccessPoint call (e.g. allocating a GID). We can save
quite some time and quite some API calls if the AP with the same
clientToken is found. The check for the AP existence has been moved
from the CreateAccessPoint function one level up. The controller
in this case checks if there is an access point with such client
token, if so, it proceeds to return a CreateVolumeResponse. If it
is not found, then it follows the usual flow.
@otorreno otorreno force-pushed the reduce-efs-calls-reuse-ap branch from 358e62c to 58c8272 Compare July 6, 2024 07:26
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 6, 2024
@otorreno
Copy link
Contributor Author

@mskanth972 this is ready for review. Can you trigger the tests?

@mskanth972
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 17, 2024
@otorreno
Copy link
Contributor Author

@mskanth972 tests are green. Any comments? Or shall we merge?

@otorreno
Copy link
Contributor Author

@mskanth972 tests are green. Any comments? Or shall we merge?

@mskanth972 I would like to avoid merge conflicts. Do you have time to review?

@mskanth972
Copy link
Contributor

Hey @otorreno, will review it today and merge it by tomorrow morning if looks good.

@mskanth972
Copy link
Contributor

Did manual test on this PR, works as expected.

I0725 03:42:57.599079       1 controller.go:82] CreateVolume: called with args {Name:pvc-e8ab1128-cebd-4df7-8328-e1a9e7472feb CapacityRange:required_bytes:5368709120  VolumeCapabilities:[mount:<> access_mode:<mode:MULTI_NODE_MULTI_WRITER > ] Parameters:map[basePath:/dynamic_provisioning csi.storage.k8s.io/pv/name:pvc-e8ab1128-cebd-4df7-8328-e1a9e7472feb csi.storage.k8s.io/pvc/name:efs-claim csi.storage.k8s.io/pvc/namespace:default directoryPerms:700 ensureUniqueDirectory:true fileSystemId:fs-0e3779234239600fc gidRangeEnd:2000 gidRangeStart:1000 provisioningMode:efs-ap reuseAccessPoint:true subPathPattern:${.PVC.namespace}/${.PVC.name}] Secrets:map[] VolumeContentSource:<nil> AccessibilityRequirements:<nil> XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}
I0725 03:42:57.599171       1 controller.go:99] Client token : d3580977b85988d6cd4a7d1a8b4745f839b633cd685f264e261e1f6953af77ae
I0725 03:42:57.599179       1 cloud.go:249] Filesystem ID to find AP : fs-0e3779234239600fc
I0725 03:42:57.599182       1 cloud.go:250] ClientToken to find AP : d3580977b85988d6cd4a7d1a8b4745f839b633cd685f264e261e1f6953af77ae
I0725 03:42:57.657713       1 controller.go:175] Existing AccessPoint found : &{AccessPointId:fsap-02ebbba0e06296cc2 FileSystemId:fs-0e3779234239600fc AccessPointRootDir:/dynamic_provisioning/default/efs-claim-23a64991-a746-4212-8750-4262e1a1e48d CapacityGiB:0 PosixUser:<nil>}

@mskanth972
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 25, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mskanth972, otorreno

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 25, 2024
@k8s-ci-robot k8s-ci-robot merged commit 79cb3a5 into kubernetes-sigs:master Jul 25, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants