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

Feat: parallel init cluster info #6060

Merged
merged 1 commit into from
May 31, 2023

Conversation

yyzxw
Copy link
Contributor

@yyzxw yyzxw commented May 31, 2023

Description of your changes

🤖 Generated by Copilot at b5ef09e

Summary

🚀🙌🔗

Improve multicluster initialization performance and error handling by using errgroup to parallelize cluster version queries in virtual_cluster.go.

We are the multicluster, we rise from the ashes
We use the errgroup to unleash our power
We fetch the versions in parallel, we defy the order
We handle the errors with grace, we are the multicluster

Walkthrough

  • Parallelize cluster version fetching using errgroup.Group ([link](https://github.com/kubevela/kubevela/pull/6060/files?diff=unified&w=0#diff-3b863babb08434dd0a998f7b6f89e87f139420f288089d65b778e67595259cb8R25-R26), [link](https://github.com/kubevela/kubevela/pull/6060/files?diff=unified&w=0#diff-3b863babb08434dd0a998f7b6f89e87f139420f288089d65b778e67595259cb8L65-R78))

In my case, if there are a lot of virtual clusters (secrets), but their corresponding clusters are temporarily disconnected, this will eventually cause the context to time out, and the requests will accumulate, causing the controller to take a long time to restart, This causes the controller to be rebooted frequently because the ready probe is not satisfied. Therefore, cluster information is initialized in parallel to accelerate the startup speed of controller.

Fixes #

I have:

  • Read and followed KubeVela's contribution process.
  • Related Docs updated properly. In a new feature or configuration option, an update to the documentation is necessary.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Special notes for your reviewer

@yyzxw yyzxw changed the title feature: parallel init cluster info Feat: parallel init cluster info May 31, 2023
@yyzxw yyzxw force-pushed the feature/enable-parall-init-cluster branch from b5ef09e to fc8bd38 Compare May 31, 2023 07:40
@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.03 ⚠️

Comparison is base (c039328) 61.00% compared to head (cfe48ff) 60.97%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6060      +/-   ##
==========================================
- Coverage   61.00%   60.97%   -0.03%     
==========================================
  Files         224      224              
  Lines       31274    31274              
==========================================
- Hits        19079    19070       -9     
- Misses      10430    10432       +2     
- Partials     1765     1772       +7     
Flag Coverage Δ
core-unittests 56.09% <0.00%> (-0.10%) ⬇️
e2e-multicluster-test 22.86% <100.00%> (-2.10%) ⬇️
e2etests 25.17% <100.00%> (+0.15%) ⬆️

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

Impacted Files Coverage Δ
pkg/multicluster/virtual_cluster.go 79.41% <100.00%> (ø)

... and 16 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yyzxw yyzxw force-pushed the feature/enable-parall-init-cluster branch from fc8bd38 to 49ecfdf Compare May 31, 2023 09:51
Signed-off-by: yyzxw <1020938856@qq.com>
@yyzxw yyzxw force-pushed the feature/enable-parall-init-cluster branch from 49ecfdf to cfe48ff Compare May 31, 2023 11:05
@yyzxw
Copy link
Contributor Author

yyzxw commented May 31, 2023

/retest go

@Somefive Somefive merged commit d6788f1 into kubevela:master May 31, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants