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

change where transformers are called #116623

Merged
merged 1 commit into from
Mar 16, 2023
Merged

Conversation

lavalamp
Copy link
Member

@lavalamp lavalamp commented Mar 14, 2023

What type of PR is this?

/kind bug

/kind regression

What this PR does / why we need it:

Code changes needed for the problem discovered in #116432

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

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


@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/regression Categorizes issue or PR as related to a regression from a prior release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 14, 2023
//
// The most common usage pattern is to clean-up some parts of the object to
// reduce component memory usage if a given component doesn't care about them.
// given controller doesn't care for them.
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicate godoc

Copy link
Member Author

Choose a reason for hiding this comment

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

heh, so was the original.

I updated all the comments to reflect my current beliefs about how it behaves now. It needs tests to verify.

@smarterclayton
Copy link
Contributor

Looks correct to me at first pass, but I will defer to someone who has looked at deltafifo more recently.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 15, 2023
@liggitt
Copy link
Member

liggitt commented Mar 15, 2023

I don't think I've ever looked at the transforming informer code before... I nominate @wojtek-t @deads2k as reviewers based on #104300

@liggitt
Copy link
Member

liggitt commented Mar 15, 2023

/uncc
/assign @wojtek-t @deads2k

@k8s-ci-robot k8s-ci-robot removed the request for review from liggitt March 15, 2023 16:15
@liggitt
Copy link
Member

liggitt commented Mar 15, 2023

/milestone v1.27

//
// New in v1.27: In such cases, the contained object will already have gone
// through the transform object separately (when it was added / updated prior
// to the delete), so the TransformFunc can likely safely ignore such objects.
Copy link
Member

Choose a reason for hiding this comment

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

Nice, this comment is very good!

Should we maybe rephrase this to state that "ignore" means returning the input object to be 100% clear?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I will update. I'm adding a test now

Copy link
Member

Choose a reason for hiding this comment

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

Nice, thanks! Also feel free to take some logic from #116432 as well, or we can do that as a follow up after this, thats up to you

@odinuge
Copy link
Member

odinuge commented Mar 15, 2023

/assign

@odinuge
Copy link
Member

odinuge commented Mar 15, 2023

What do you think about backporting this PR together with #115620?

@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 Mar 15, 2023
@lavalamp
Copy link
Member Author

I ran unit tests for an hour with stress and race and no problems found.

What do you think about backporting this PR together with #115620?

Yeah they need to be backported together. But right now I'm worried about not blocking the release of 1.27 :)

/milestone v1.27

@lavalamp
Copy link
Member Author

@odinuge do you think you can rebase #116432 on top of this so we can use the test you wrote there? I think after this PR there's a case that you shouldn't have to handle any more (tombstone object with untransformed inner object).

@cici37
Copy link
Contributor

cici37 commented Mar 16, 2023

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 16, 2023
Copy link
Member

@odinuge odinuge left a comment

Choose a reason for hiding this comment

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

@odinuge do you think you can rebase #116432 on top of this so we can use the test you wrote there? I think after this PR there's a case that you shouldn't have to handle any more (tombstone object with untransformed inner object).

Sweet. Did that now, and the tests passed the race detector locally without any problems. I'll clean that PR up when this is merged and I have some more time maybe tomorrow.

Overall I like this approach, and the code looks good, together with a very descriptive set of godocs. Thanks!

/lgtm

Adding a hold in case others want to look, but anyone feel free to remove it!
/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Mar 16, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9ab2ed5512286f02d1130fef04875873b52067ea

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lavalamp, odinuge

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

@salaxander
Copy link

/unhold

@wojtek-t
Copy link
Member

For posterity - this LGTM too

Thanks for fixing this Daniel!

@lavalamp lavalamp deleted the xfrmr branch March 17, 2023 16:43
k8s-ci-robot added a commit that referenced this pull request Apr 4, 2023
…620-upstream-release-1.24

Automated cherry pick of #115620: client-go/cache: fix missing delete event on replace (+ #116623)
k8s-ci-robot added a commit that referenced this pull request Apr 4, 2023
…620-upstream-release-1.26

Automated cherry pick of #115620: client-go/cache: fix missing delete event on replace  (+ #116623)
k8s-ci-robot added a commit that referenced this pull request Apr 4, 2023
…620-upstream-release-1.25

Automated cherry pick of #115620: client-go/cache: fix missing delete event on replace  (+ #116623)
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/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. 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. release-blocker release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

9 participants