-
Notifications
You must be signed in to change notification settings - Fork 916
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
karmada-search: fix the problem that ResourceVersion base64 encrypted repeatedly when starting multiple informer to watch resource #3376
karmada-search: fix the problem that ResourceVersion base64 encrypted repeatedly when starting multiple informer to watch resource #3376
Conversation
Welcome @niuyueyang1996! It looks like this is your first PR to karmada-io/karmada 🎉 |
/assign @huntsman-li |
@@ -315,7 +315,6 @@ func (c *MultiClusterCache) Watch(ctx context.Context, gvr schema.GroupVersionRe | |||
} | |||
|
|||
mux.AddSource(w, func(e watch.Event) { | |||
// We can safely modify data because it is deepCopied in cacheWatcher.convertToWatchEvent |
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.
the note is wrong.
if object is *cachingObject,will not DeepCopy.
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.
cachingObject
will be deep-copied lazily, but our usage violate its condition:
karmada/vendor/k8s.io/apiserver/pkg/storage/cacher/caching_object.go
Lines 71 to 75 in 681b946
// The lazy deep-copy make is useful, as effectively the only | |
// case when we are setting some fields are ResourceVersion for | |
// DELETE events, so in all other cases we can effectively avoid | |
// performing any deep copies. | |
deepCopied bool |
Thanks, I will check it. |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #3376 +/- ##
==========================================
+ Coverage 51.62% 51.64% +0.02%
==========================================
Files 210 210
Lines 18928 18927 -1
==========================================
+ Hits 9771 9775 +4
+ Misses 8631 8626 -5
Partials 526 526
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
LGTM @niuyueyang1996 Could you add message to the second commit, or squash them, thanks. |
pod resourceVersion will base64 duplicate. soo deepCopy event. Signed-off-by: niuyueyang <719415781@qq.com>
i already squash them. |
Hi @niuyueyang1996 @ikaven1024, thanks to all of you! |
Ask @RainbowMango to help run the CI test. |
I think so. |
i have another question in #3377. |
Do you mean that #3377 raises two questions, but the current pr only solves one of them? Ask @ikaven1024 to help take a look again~ |
yes,the current pr only fix the bug. |
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.
Can you guys help to propose a release-notes? @XiShanYongYe-Chang @ikaven1024
I have reply it in #3377. |
@niuyueyang1996 @ikaven1024 How about update the release-note like this:
|
LGTM |
i agree with the release-note. |
Thanks~ @niuyueyang1996, can you help update the release-note and title. /approve Leave lgtm to @ikaven1024 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: XiShanYongYe-Chang 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 |
/lgtm |
…-#3376-upstream-release-1.5 Automated cherry pick of #3376: if start many watcher to watch pod. pod resourceVersion will
…-#3376-upstream-release-1.3 Automated cherry pick of #3376: if start many watcher to watch pod. pod resourceVersion will
…-#3376-upstream-release-1.4 Automated cherry pick of #3376: if start many watcher to watch pod. pod resourceVersion will
if start many watcher to watch pod.
pod resourceVersion will base64 duplicate.
soo deepCopy event.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #3377
Special notes for your reviewer:
Does this PR introduce a user-facing change?: