-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Recheck if transformed data is stale when doing live lookup during update #58375
Conversation
// this update should write to etcd because the transformer reported stale | ||
err = store.GuaranteedUpdate(ctx, key, out, true, nil, | ||
func(_ runtime.Object, _ storage.ResponseMeta) (runtime.Object, *uint64, error) { | ||
return input, nil, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using this inline function 3 times here. I'd rather extract it to a function with a meaningful name to make code shorter and self-explained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a closure, isn't it? Can't extract it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, now I see.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, smarterclayton Associated issue: #49565 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
[MILESTONENOTIFIER] Milestone Pull Request Current @hongchaodeng @liggitt @madhusudancs @smarterclayton Pull Request Labels
|
/test all [submit-queue is verifying that this PR is safe to merge] |
/retest |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
/cc @jpbetz |
Is this issue fixed for v1.8.4+? |
This issue was introduced in 1.8.3. The fix for 1.8.x was merged in #58377 and is pending release. |
Commit found in the "release-1.9" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
Fixes #49565
Caching storage can pass in a cached object to
GuaranteedUpdate
as a hint for the current object.If the hint is identical to the data we want to persist, before short-circuiting as a no-op update, we force a live lookup.
We should check two things on the result of that live lookup before short-circuiting as a no-op update:
After a live lookup, we checked byte equality, but not the stale indicator. This meant that key rotation or encrypted->decrypted, and decrypted->encrypted updates are broken.
Introduced in #54780 and picked back to 1.8 in #55294