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

Reduce event spam for function GenerateAttachVolumeFunc #75986

Conversation

mucahitkurt
Copy link
Contributor

What type of PR is this?
/kind cleanup
/sig storage

What this PR does / why we need it:
Delete return type error of the function, expand the scope of generated function, delete generated events inside the function(these events will be produced when the generated function is run with rate limiting) to reduce the event spam caused by GenerateAttachVolumFunc.

Which issue(s) this PR fixes:
Fixes #74988

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Reduce event spam for AttachVolume storage operation

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/storage Categorizes an issue or PR as relevant to SIG Storage. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 1, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @mucahitkurt. Thanks for your PR.

I'm waiting for a kubernetes 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 Apr 1, 2019
@mucahitkurt
Copy link
Contributor Author

/assign @davidz627

Copy link
Member

@saad-ali saad-ali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

LGTM
/assign @ddebroy @davidz627 @leakingtapan
Will let the CSI migration folks^^^ do final LGTM

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mucahitkurt, saad-ali

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 Apr 2, 2019
@ddebroy
Copy link
Member

ddebroy commented Apr 4, 2019

/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 Apr 4, 2019
@mucahitkurt mucahitkurt force-pushed the improvement/reduce-event-spam-for-GenerateAttachVolumeFunc branch from db7ccc6 to ab31cd2 Compare April 4, 2019 21:40
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 4, 2019
@mucahitkurt
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-device-plugin-gpu

@mucahitkurt mucahitkurt force-pushed the improvement/reduce-event-spam-for-GenerateAttachVolumeFunc branch from ab31cd2 to 7c12493 Compare April 10, 2019 15:25
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 10, 2019
Copy link
Member

@vladimirvivien vladimirvivien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My major concern with this PR is that it is changing the return signature of GenerateAttachVolumeFunc to be different from all other methods in the interface, creating a one-of situation. Are the other func generator methods not suffering from the same issue solved here?

@mucahitkurt
Copy link
Contributor Author

@vladimirvivien I followed the same refactoring pattern that was applied for the GenerateMountVolumeFunc in this PR, so this function(GenerateMountVolumeFunc) also is not returning error.

I also asked about this refactoring on the sig storage mailing list and the answer was The operation generation should just construct the function to execute and not have an option to fail (should not return an error). That way the reconciler can be dumb and continue to execute multiple times per second. Any failure will happen when the operation is actually executed, and will be handled correctly by the exponential back off logic.

I checked the other functions of the interface, the same event spam issue can be valid for the GenerateMapVolumeFunc, other functions just return errors and don't create events.

I'm not sure about the above answer about the returning error from those generator functions is valid for all of the methods of the interface OperationGenerator.

As far as I understand issues were open for the most painful ones.

My major concern with this PR is that it is changing the return signature of GenerateAttachVolumeFunc` to be different from all other methods in the interface, creating a one-of situation. Are the other func generator methods not suffering from the same issue solved here?

@vladimirvivien
Copy link
Member

@mucahitkurt sounds like this refactoring has been gradually applied and eventually other methods will be changed to follow the same pattern. I am good with that. Thanks for clarifying.

Copy link
Contributor

@davidz627 davidz627 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change! Mostly LGTM

attachableVolumePluginName := unknownAttachableVolumePlugin
attachableVolumePlugin, err :=
og.volumePluginMgr.FindAttachablePluginBySpec(volumeToAttach.VolumeSpec)
// It's ok to ignore the error, returning error is not expected from this function
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document this idea in the comment too: https://github.com/kubernetes/kubernetes/pull/75986/files#r277510187

Also are we only using this for the attachableVolumePluginName now, which we only use for the CompleteFunc? If so, can we move this code closer to the place where we use the attachableVolumePluginName - after the attachVolumeFunc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks for the comment!

Signed-off-by: Mucahit Kurt <mucahitkurt@gmail.com>
@mucahitkurt mucahitkurt force-pushed the improvement/reduce-event-spam-for-GenerateAttachVolumeFunc branch from 7c12493 to 1c1da75 Compare April 24, 2019 20:47
@davidz627
Copy link
Contributor

/lgtm
Thanks for the fix!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 24, 2019
@k8s-ci-robot k8s-ci-robot merged commit 88992ba into kubernetes:master Apr 25, 2019
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/storage Categorizes an issue or PR as relevant to SIG Storage. 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.

Event spam in some storage Operation Generator functions
7 participants