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

server: make region statistic loss some precision #3728

Merged
merged 14 commits into from
Jun 4, 2021

Conversation

nolouch
Copy link
Contributor

@nolouch nolouch commented Jun 1, 2021

Signed-off-by: nolouch [email protected]

What problem does this PR solve?

In the current situation, a change in traffic will trigger the update of save cache in the region heartbeat, which will cause the heartbeat to become more stressful. In fact, this part of the statistical data can work normally as long as it is within a certain accuracy.

What is changed and how it works?

Check List

  • Unit test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

add `flow-round-by-digit` to reduce the statistics update overhead

Signed-off-by: nolouch <[email protected]>
@ti-chi-bot ti-chi-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jun 1, 2021
@ti-chi-bot ti-chi-bot requested review from rleungx and Yisaer June 1, 2021 03:04
@codecov
Copy link

codecov bot commented Jun 1, 2021

Codecov Report

Merging #3728 (e6f7eec) into master (da4cdd4) will increase coverage by 0.20%.
The diff coverage is 89.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3728      +/-   ##
==========================================
+ Coverage   74.81%   75.01%   +0.20%     
==========================================
  Files         244      244              
  Lines       24423    24437      +14     
==========================================
+ Hits        18271    18332      +61     
+ Misses       4521     4487      -34     
+ Partials     1631     1618      -13     
Flag Coverage Δ
unittests 75.01% <89.47%> (+0.20%) ⬆️

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

Impacted Files Coverage Δ
server/config/config.go 75.15% <66.66%> (-0.11%) ⬇️
server/cluster/cluster.go 82.76% <100.00%> (-0.28%) ⬇️
server/core/region.go 89.94% <100.00%> (+0.41%) ⬆️
server/core/region_option.go 84.09% <100.00%> (+0.36%) ⬆️
server/grpc_service.go 47.77% <100.00%> (+<0.01%) ⬆️
server/schedule/operator/step.go 67.44% <0.00%> (-1.00%) ⬇️
server/core/storage.go 67.68% <0.00%> (-0.77%) ⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da4cdd4...e6f7eec. Read the comment docs.

Signed-off-by: nolouch <[email protected]>
server/config/config.go Outdated Show resolved Hide resolved
server/core/region_option.go Outdated Show resolved Hide resolved
Signed-off-by: nolouch <[email protected]>
@nolouch nolouch mentioned this pull request Jun 1, 2021
6 tasks
@nolouch nolouch force-pushed the improve_trace_region_flow branch from 9f4f642 to aac86d8 Compare June 1, 2021 07:10
Signed-off-by: nolouch <[email protected]>
@nolouch nolouch force-pushed the improve_trace_region_flow branch from aac86d8 to ddf7f42 Compare June 1, 2021 07:34
server/config/config.go Outdated Show resolved Hide resolved
server/core/region.go Outdated Show resolved Hide resolved
server/config/config.go Outdated Show resolved Hide resolved
server/config/config.go Show resolved Hide resolved
Signed-off-by: nolouch <[email protected]>
@nolouch
Copy link
Contributor Author

nolouch commented Jun 1, 2021

PTAL @rleungx @HunDunDM

@nolouch nolouch force-pushed the improve_trace_region_flow branch from d50f787 to 231d297 Compare June 1, 2021 17:46
Signed-off-by: nolouch <[email protected]>
@nolouch nolouch force-pushed the improve_trace_region_flow branch from 32e465c to f4c3d20 Compare June 2, 2021 09:43
Signed-off-by: nolouch <[email protected]>
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jun 2, 2021
Signed-off-by: nolouch <[email protected]>
@nolouch nolouch force-pushed the improve_trace_region_flow branch from 08b196c to 57190b3 Compare June 2, 2021 10:50
Signed-off-by: nolouch <[email protected]>
server/config/config.go Outdated Show resolved Hide resolved
server/config/config.go Outdated Show resolved Hide resolved
Signed-off-by: nolouch <[email protected]>
@@ -271,6 +271,11 @@ var (
ErrSemverNewVersion = errors.Normalize("new version error", errors.RFCCodeText("PD:semver:ErrSemverNewVersion"))
)

// config
var (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the error is PD:filepath:ErrFilePathAbs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated. PTAL

Signed-off-by: nolouch <[email protected]>
server/core/region_option.go Show resolved Hide resolved
server/core/region.go Outdated Show resolved Hide resolved
server/core/region.go Outdated Show resolved Hide resolved
Signed-off-by: nolouch <[email protected]>
server/grpc_service.go Show resolved Hide resolved
server/cluster/cluster.go Show resolved Hide resolved
Signed-off-by: nolouch <[email protected]>
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • HunDunDM
  • Yisaer

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jun 4, 2021
@nolouch
Copy link
Contributor Author

nolouch commented Jun 4, 2021

/merge

@ti-chi-bot
Copy link
Member

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

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.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: e1293db

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jun 4, 2021
@ti-chi-bot
Copy link
Member

@nolouch: 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.

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.

@ti-chi-bot ti-chi-bot merged commit 6891009 into tikv:master Jun 4, 2021
@nolouch nolouch deleted the improve_trace_region_flow branch June 4, 2021 05:17
bufferflies pushed a commit to bufferflies/pd that referenced this pull request Jul 9, 2021
* add the loss precision

Signed-off-by: nolouch <[email protected]>

* fix comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comments

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* fix

Signed-off-by: nolouch <[email protected]>

* clean

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
bufferflies pushed a commit to bufferflies/pd that referenced this pull request Jul 9, 2021
* add the loss precision

Signed-off-by: nolouch <[email protected]>

* fix comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comments

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* fix

Signed-off-by: nolouch <[email protected]>

* clean

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

* address comment

Signed-off-by: nolouch <[email protected]>

Co-authored-by: Ti Chi Robot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note Denotes a PR that will be considered when it comes time to generate release notes. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants