-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: fix wrong result when to concurrency merge global stats #48852
Conversation
Signed-off-by: Weizhen Wang <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #48852 +/- ##
================================================
+ Coverage 71.0271% 72.6426% +1.6155%
================================================
Files 1367 1391 +24
Lines 404903 411535 +6632
================================================
+ Hits 287591 298950 +11359
+ Misses 97306 93662 -3644
+ Partials 20006 18923 -1083
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
Signed-off-by: Weizhen Wang <[email protected]>
12d133f
to
63374c8
Compare
2a6ca43
to
6583952
Compare
worker.respCh <- resp | ||
return | ||
} | ||
|
||
partNum := len(allTopNs) |
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.
BUG 1:
It should check all tops. but here is to check the part. it will create a bug.
counter[encodedVal] += float64(val.Count) | ||
worker.mu.Lock() | ||
_, exists := worker.counter[encodedVal] | ||
worker.counter[encodedVal] += float64(val.Count) | ||
if exists { |
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.
BUG 2
it should merge the global counter. but it merge the counter in echo worker.
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.
BUG 3
and it will create wrong result from BinarySearchRemoveVal
. it will remove it second.
pkg/sessionctx/variable/tidb_vars.go
Outdated
@@ -1361,7 +1361,7 @@ const ( | |||
DefTiDBOptRangeMaxSize = 64 * int64(size.MB) // 64 MB | |||
DefTiDBCostModelVer = 2 | |||
DefTiDBServerMemoryLimitSessMinSize = 128 << 20 | |||
DefTiDBMergePartitionStatsConcurrency = 1 | |||
DefTiDBMergePartitionStatsConcurrency = 2 |
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.
Add a todo comment to change it back 1 (This is a temp value just for test concurrency partition stats)
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.
I have been reverted.
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.
LGTM
Signed-off-by: Weizhen Wang <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AilinKid, elsa0520 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 |
/retest |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
/cherrypick release-7.1 |
@hawkingrei: new pull request created to branch In 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. |
Signed-off-by: ti-chi-bot <[email protected]>
Signed-off-by: ti-chi-bot <[email protected]>
@hawkingrei: new pull request created to branch In 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 #48713
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.