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

proxy list with rv=0 no longer access member cluster etcd #4896

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ikaven1024
Copy link
Member

What type of PR is this?
/kind bug

What this PR does / why we need it:
When client request list with rv=0, proxy fetch objects from cache. It works as expected.
While when pagination occurs, a continue will be responsed. This continue will filled with cluster's versions.

if err := c.fillMissingClusterResourceVersion(ctx, responseResourceVersion, clusters, gvr); err != nil {

And the next paging request will access etcd with version in continue. We should make it accessing cache also to improve performance.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-search`: proxy list with rv=0 no longer access member cluster etcd

Signed-off-by: yingjinhui <yingjinhui@didiglobal.com>
@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label May 2, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign xishanyongye-chang after the PR has been reviewed.
You can assign the PR to them by writing /assign @xishanyongye-chang in a comment when ready.

The full list of commands accepted by this bot can be found 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

@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label May 2, 2024
@ikaven1024
Copy link
Member Author

Run karmada-search with --v=4, and request pods with limit=1 and rv=0, get logs:

I0502 22:55:20.201074   20847 multi_cluster_cache.go:233] List member cluster kwok-cluster1 with &internalversion.ListOptions{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, LabelSelector:labels.internalSelector(nil), FieldSelector:fields.andTerm{}, Watch:false, AllowWatchBookmarks:false, ResourceVersion:"0", ResourceVersionMatch:"", TimeoutSeconds:(*int64)(nil), Limit:1, Continue:"", SendInitialEvents:(*bool)(nil)}
I0502 22:55:20.219607   20847 multi_cluster_cache.go:233] List member cluster kwok-cluster2 with &internalversion.ListOptions{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, LabelSelector:labels.internalSelector(nil), FieldSelector:fields.andTerm{}, Watch:false, AllowWatchBookmarks:false, ResourceVersion:"0", ResourceVersionMatch:"", TimeoutSeconds:(*int64)(nil), Limit:1, Continue:"", SendInitialEvents:(*bool)(nil)}

From the logs, we can see that both two member clusters are accessed with ResourceVersion:"0".

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 16.66667% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 53.11%. Comparing base (5bc8c54) to head (7015546).
Report is 2 commits behind head on master.

Files Patch % Lines
pkg/search/proxy/store/multi_cluster_cache.go 16.66% 4 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4896      +/-   ##
==========================================
- Coverage   53.12%   53.11%   -0.02%     
==========================================
  Files         251      251              
  Lines       20417    20422       +5     
==========================================
  Hits        10847    10847              
- Misses       8856     8860       +4     
- Partials      714      715       +1     
Flag Coverage Δ
unittests 53.11% <16.66%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ikaven1024 ikaven1024 marked this pull request as draft May 3, 2024 12:07
@karmada-bot karmada-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 3, 2024
@RainbowMango
Copy link
Member

Thanks @ikaven1024 , please assign this to @XiShanYongYe-Chang or me once it's ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants