Skip to content

Cloning of secondary resource when getting it from InformerEventSource cache #2351

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

Closed
csviri opened this issue Apr 17, 2024 · 1 comment · Fixed by #2364
Closed

Cloning of secondary resource when getting it from InformerEventSource cache #2351

csviri opened this issue Apr 17, 2024 · 1 comment · Fixed by #2364
Assignees
Milestone

Comments

@csviri
Copy link
Collaborator

csviri commented Apr 17, 2024

Currently, the resource is cloned when read from the cache of an informer. The reason behind this is, it happened in the past that that someone modified the secondary, and therefore in the next reconciliation (even related to other primary resources) the changed value was returned from the cache. However, if the getSecondaryResource is called multiple times, it might cause a significant overhead.

See issue: https://issues.apache.org/jira/browse/FLINK-34726

Note for the primary: we always clone the primary resource, where it is more justified, since when updating the resource with UpdateControl the changes were always made on the primary. However, this is not true with SSA anymore, see:
#1931

For SSA we could always say that a fresh resource should be created always for the operations (now it's kinda not needed for the status patch, since while it sends the whole resource, only the status sub-resource is handled by k8s API, so it kinda works also in the old way)

@csviri csviri added this to the 5.0 milestone Apr 17, 2024
@csviri csviri changed the title D not cloning of secondary resource when getting it from InformerEventSource (?) Cloning of secondary resource when getting it from InformerEventSource Apr 17, 2024
@csviri csviri changed the title Cloning of secondary resource when getting it from InformerEventSource Cloning of secondary resource when getting it from InformerEventSource cache Apr 17, 2024
@csviri
Copy link
Collaborator Author

csviri commented Apr 19, 2024

A feature flag would also be convenient to control this.

@csviri csviri linked a pull request Apr 24, 2024 that will close this issue
@csviri csviri self-assigned this Apr 30, 2024
@csviri csviri closed this as completed May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant