statistics: avoid mutate global variable#28678
Conversation
This closes pingcap#28676 . Signed-off-by: tison <wander4096@gmail.com>
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
|
cc @feitian124 |
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
|
|
||
| // splitBuckets split the histogram buckets according to the feedback. | ||
| func splitBuckets(h *Histogram, feedback *QueryFeedback) ([]bucket, []bool, int64) { | ||
| func splitBuckets(h *Histogram, feedback *QueryFeedback, bucketCount int) ([]bucket, []bool, int64) { |
There was a problem hiding this comment.
how about add splitBucketsWithBucketCount for test purpose, likeUpdateHistogramWithBucketCount ?
There was a problem hiding this comment.
It's a private method with limited usage. It'd be better to just change the signature as using less global variable as possible.
There was a problem hiding this comment.
since I found that the meaning of bucketCount param in splitBuckets is not so clear after above change.
add splitBucketsWithBucketCount maybe better, or rename it to defaultBucketCount too?
There was a problem hiding this comment.
Naming is hard. I tend to use capacity actually, but it is originally count. I don't think carefully on changing the name and the reason we don't introduce splitBucketsWithBucketCount is already present.
|
sorry for inject this bug and thanks for help fix. |
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 91441f6 |
|
@tisonkun: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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 ti-community-infra/tichi repository. |
This closes #28676 .
Signed-off-by: tison wander4096@gmail.com
Release note