Repository navigation
planner: cache mpp info to avoid frequent grpc calling - #65694
Conversation
|
Hi @xzhangxian1008. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/run-check-issue-triage-complete |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #65694 +/- ##
================================================
- Coverage 76.3196% 76.1720% -0.1476%
================================================
Files 2041 2067 +26
Lines 562141 585393 +23252
================================================
+ Hits 429024 445906 +16882
- Misses 132210 136655 +4445
- Partials 907 2832 +1925
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/cc @copilot |
|
/cc @windtalker @solotzg |
| } | ||
|
|
||
| if len(uncachedServersInfo) > 0 { | ||
| ch := make(chan [][]types.Datum, len(uncachedServersInfo)) |
There was a problem hiding this comment.
Why use chan?
deleted
| waitWg := &sync.WaitGroup{} | ||
| waitWg.Add(len(uncachedServersInfo)) | ||
| for i := range uncachedServersInfo { | ||
| go func(info []infoschema.ServerInfo) { |
There was a problem hiding this comment.
Consider fetching once for the full slice, or pass the single-server slice into the call and use the row’s address only when the fetch is truly per-server.
The extra goroutine layer may be unnecessary since FetchClusterServerInfoWithoutPrivilegeCheck already fans out internally.
There was a problem hiding this comment.
Consider fetching once for the full slice, or pass the single-server slice into the call and use the row’s address only when the fetch is truly per-server.
The extra goroutine layer may be unnecessary since
FetchClusterServerInfoWithoutPrivilegeCheckalready fans out internally.
fixed
|
/hold |
|
@solotzg: adding LGTM is restricted to approvers and reviewers in OWNERS files. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
| infos := infoschema.FetchClusterServerInfoWithoutPrivilegeCheck(ctx, sctx.GetSessionVars(), serversInfo, e.serverInfoType, true) | ||
| rowCount := 0 | ||
| for _, info := range infos { | ||
| if info.Err != nil { |
There was a problem hiding this comment.
if info.Err == nil {?
fixed
|
|
||
| results := make([][]types.Datum, 0, rowCount) | ||
| for _, info := range infos { | ||
| if info.Err != nil { |
|
/test check-dev |
[LGTM Timeline notifier]Timeline:
|
|
/test pull-br-integration-test |
|
/hold cancel |
|
/test check-dev2 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, solotzg, windtalker, winoros, wjhuang2016 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test pull-br-integration-test |
|
/retest |
|
/cherrypick release-8.5 |
|
@xzhangxian1008: new pull request created to branch DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
/cherrypick release-nextgen-202603 |
|
@xzhangxian1008: new pull request created to branch DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
/cherrypick release-nextgen-202603 |
|
@xzhangxian1008: failed to apply #65694 on top of branch "release-nextgen-202603": DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #65701
Problem Summary:
What changed and how does it work?
We define a new struct called
MPPInfoManagerand set a global variableGlobalMPPInfoManagerwithMPPInfoManagertype. mpp info are all cached in this variable. IngetTiFlashServerMinLogicalCores, we will check the cache first then call grpc for uncached tiflash stores. When we get a failed tiflash store infilterAliveStoresHelper, we will remove it's cache.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.
Summary by CodeRabbit
Refactor
Tests