Skip to content

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

Closed

Description

@csviri

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)

Activity

  1. added this to the 5.0 milestone on Apr 17, 2024
  2. changed the title [-]D not cloning of secondary resource when getting it from InformerEventSource (?)[/-] [+]Cloning of secondary resource when getting it from InformerEventSource[/+] on Apr 17, 2024
  3. changed the title [-]Cloning of secondary resource when getting it from InformerEventSource[/-] [+]Cloning of secondary resource when getting it from InformerEventSource cache[/+] on Apr 17, 2024
  4. csviri commented on Apr 19, 2024

    @csviri
    CollaboratorAuthor

    A feature flag would also be convenient to control this.

  5. self-assigned this
    on Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions