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

disk: DescribeDisks auto batching #1009

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

huww98
Copy link
Contributor

@huww98 huww98 commented Mar 28, 2024

What type of PR is this?

/kind feature
/kind cleanup

What this PR does / why we need it:

disk: introduce DiskStatusWaiter

A central place for all disks pending status changes (attaching/detaching).
Waiter will poll disk status in batch and wake up the caller if the status has changed.

The motivation is reducing OpenAPI call count, to avoid triggering throttling, thus improve system throughput.

Also include a simple fallback waiter to support multi-tanent use-case.

Shared disk support is best effort, since we cannot create new shared disks for test now.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

If AD-controller enabled, the number of DescribeDisks requests on a busy cluster will be reduced greatly.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Mar 28, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: huww98
Once this PR has been reviewed and has the lgtm label, please assign mowangdk for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 28, 2024
@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 Mar 28, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @huww98. 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 size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 28, 2024
@huww98 huww98 marked this pull request as draft March 28, 2024 13:29
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 28, 2024
@huww98
Copy link
Contributor Author

huww98 commented Mar 28, 2024

TODO: the ecsClient in waiter cannot update its credential.

@huww98 huww98 force-pushed the disk-desc-batch branch 2 times, most recently from 0453ea3 to d932b08 Compare March 29, 2024 05:17
@huww98
Copy link
Contributor Author

huww98 commented Mar 29, 2024

I have observed that after AttachDisk returns, the status remains Available for a short period, so I'm not relying on disk.Status in this version.

@huww98 huww98 force-pushed the disk-desc-batch branch 2 times, most recently from d1d8cbc to fc295d9 Compare March 29, 2024 17:57
@huww98 huww98 marked this pull request as ready for review April 21, 2024 16:06
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 21, 2024
@huww98
Copy link
Contributor Author

huww98 commented Apr 21, 2024

/ok-to-test
I've worked around the credential refresh issue with a hook.

@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 Apr 21, 2024
@huww98
Copy link
Contributor Author

huww98 commented Apr 21, 2024

In this version, I issue exactly one DescribeDisk request every 2s. So, if the number of pending disks goes just above 100, the QPS will not be doubled suddenly. If 300 disks are pending, then the status of each disk will be updated every 6s, and the QPS of DescribeDisk should remains constant.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 24, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 25, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 9, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 28, 2024
@huww98
Copy link
Contributor Author

huww98 commented May 28, 2024

/auto-cc

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 12, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 26, 2024
@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 27, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 27, 2024
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 29, 2024
A central place for all disks pending status changes (attaching/detaching).
Waiter will poll disk status in batch and wake up the caller if the status has changed.

The motivation is reducing OpenAPI call count, to avoid triggering throttling, thus improve system throughput.

Also include a simple fallback waiter to support multi-tanent use-case.

Shared disk support is best effort, since we cannot create new shared disks for test now.

Note: We have observed that after AttachDisk returns, the status remains Available for a short period, so don't rely on disk.Status in pred.
introduce two functions: waitForDisk{Attached,Detached}

replace original two waitFor*DiskInStatus(), and two similar wait loop in detach*Disk()
should be reverted once we have a ecsClient that can refresh its credentials
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 1, 2024
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 24, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/feature Categorizes issue or PR as related to a new feature. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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.

2 participants