Skip to content

Reduce calls to EFS API#1226

Merged
mskanth972 merged 1 commit into
kubernetes-sigs:masterfrom
otorreno:reduce-calls-to-efs-api
Jan 3, 2024
Merged

Reduce calls to EFS API#1226
mskanth972 merged 1 commit into
kubernetes-sigs:masterfrom
otorreno:reduce-calls-to-efs-api

Conversation

@otorreno
Copy link
Copy Markdown
Contributor

@otorreno otorreno commented Dec 29, 2023

Is this a bug fix or adding new feature?
Bug fix

What is this PR about? / Why do we need it?
With #850, the new way of allocating GIDs introduced a new call to the ListAccessPoints endpoint of EFS API, that is generating problems on systems where EFS CSI driver is under high load (lots of PVC created within a short time period). In this PR, we are extracting the ListAccessPoints call from gid_allocator, moving it one level up. In case of dynamic provisioining of GIDs we can reuse the ListAccessPoints call to check for the file system existence (thus removing the DescribeFileSystem call in such case). In case of a fixed UID/GID, we continue calling DescribeFileSystem, and no calls to ListAccessPoints.

In addition to the change explained above, gidMin and gidMax have been converted to int64. #850 made both uid and gid int64, but gidMin and gidMax were nout touched. Also changing the default value for gidMax, as the value of 7000000 was spamming the logs with a message coming from gid_allocator (i.e. range bigger than the max number of access points). Setting the value to 51000 (the value that gid_allocator was setting by adding 1000 to gidMin). Removing an unused function and field from gid_allocator too.

What testing is done?
Coverage with unit tests

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Dec 29, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: otorreno / name: Oscar Torreno (dbbc733)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Dec 29, 2023
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @otorreno!

It looks like this is your first PR to kubernetes-sigs/aws-efs-csi-driver 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/aws-efs-csi-driver has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@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 Dec 29, 2023
@k8s-ci-robot
Copy link
Copy Markdown
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.

Details

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 requested a review from wongma7 December 29, 2023 21:21
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 29, 2023
@otorreno otorreno force-pushed the reduce-calls-to-efs-api branch from b36b4ef to a80e7b0 Compare December 29, 2023 21:22
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Dec 29, 2023
@otorreno otorreno force-pushed the reduce-calls-to-efs-api branch from a80e7b0 to e2489a5 Compare December 29, 2023 21:31
@otorreno
Copy link
Copy Markdown
Contributor Author

#1217 should be merged before this one, as it is the reason #1225 is happening I believe. I will then rebase and fix the merge conflicts here

@otorreno
Copy link
Copy Markdown
Contributor Author

@mskanth972 you may want to review this one as it is in the same area of code of #1217

@mskanth972
Copy link
Copy Markdown
Contributor

Hi @otorreno, the respected PR is merged, can you rebase this PR?
Thanks

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 2, 2024
@otorreno otorreno force-pushed the reduce-calls-to-efs-api branch from e2489a5 to 693fe84 Compare January 2, 2024 21:51
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 2, 2024
@otorreno
Copy link
Copy Markdown
Contributor Author

otorreno commented Jan 2, 2024

@mskanth972 rebased on top of latest master. Commit message and original comment for the PR updated, as I had to change gidMax instead of gidMin (because #1217 flipped the overriden param in case the range is too wide)

With kubernetes-sigs#850, the new way of allocating GIDs introduced a new call
to the ListAccessPoints endpoint of EFS API, that is generating
problems on systems where EFS CSI driver is under high load
(lots of PVC created within a short time period). In this PR,
we are extracting the ListAccessPoints call from gid_allocator,
moving it one level up. In case of dynamic provisioining of GIDs
we can reuse the ListAccessPoints call to check for the file
system existence (thus removing the DescribeFileSystem call in
such case). In case of a fixed UID/GID, we continue calling
DescribeFileSystem, and no calls to ListAccessPoints.

In addition to the change explained above, gidMin and gidMax have
been converted to int64. kubernetes-sigs#850 made both uid and gid int64, but
gidMin and gidMax were nout touched. Also changing the default
value for gidMax, as the value of 7000000 was spamming the logs
with a message coming from gid_allocator (i.e. range bigger than
the max number of access points). Setting the value to 51000
(the value that gid_allocator was setting by adding 1000 to
gidMin). Removing an unused function and field from gid_allocator
too.
@otorreno otorreno force-pushed the reduce-calls-to-efs-api branch from 693fe84 to dbbc733 Compare January 2, 2024 21:57
@mskanth972
Copy link
Copy Markdown
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 Jan 3, 2024
@mskanth972
Copy link
Copy Markdown
Contributor

/lgtm

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

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 3, 2024
@otorreno
Copy link
Copy Markdown
Contributor Author

otorreno commented Jan 3, 2024

/approve

Thank you for the review!

@mskanth972
Copy link
Copy Markdown
Contributor

/test pull-aws-efs-csi-driver-unit

@mskanth972
Copy link
Copy Markdown
Contributor

/approve

@k8s-ci-robot
Copy link
Copy Markdown
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

Details 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

@mskanth972 mskanth972 merged commit f054e2c into kubernetes-sigs:master Jan 3, 2024
@otorreno otorreno deleted the reduce-calls-to-efs-api branch January 3, 2024 21:41
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants