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

metrics, cluster: fix miss heartbeat update #3559

Closed
wants to merge 1 commit into from

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Apr 1, 2021

What problem does this PR solve?

Close #3199 and close #3558

Check List

Tests

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

image
image

Release note

  • No release note

@lhy1024 lhy1024 added component/metrics Metrics. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. component/cluster Cluster logic. needs-cherry-pick-release-5.0 The PR needs to cherry pick to release-5.0 branch. labels Apr 1, 2021
@ti-chi-bot
Copy link
Member

[REVIEW NOTIFICATION]

This pull request has not been approved.

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 writing /lgtm in a comment.
Reviewer can cancel approval by writing /lgtm cancel in a comment.

Signed-off-by: lhy1024 <admin@liudos.us>
@sonarcloud
Copy link

sonarcloud bot commented Apr 1, 2021

SonarCloud Quality Gate failed.

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
7.5% 7.5% Duplication

@@ -548,6 +548,11 @@ func (c *RaftCluster) processRegionHeartbeat(region *core.RegionInfo) error {
writeItems := c.CheckWriteStatus(region)
readItems := c.CheckReadStatus(region)
c.RUnlock()
c.Lock()
Copy link
Contributor

Choose a reason for hiding this comment

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

this lock will become the heartbeat bottleneck.

@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #3559 (d76649e) into master (82671c2) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3559      +/-   ##
==========================================
+ Coverage   74.66%   74.75%   +0.09%     
==========================================
  Files         245      245              
  Lines       24090    24111      +21     
==========================================
+ Hits        17986    18024      +38     
+ Misses       4495     4485      -10     
+ Partials     1609     1602       -7     
Flag Coverage Δ
unittests 74.75% <100.00%> (+0.09%) ⬆️

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

Impacted Files Coverage Δ
server/cluster/cluster.go 83.81% <100.00%> (+0.88%) ⬆️
server/id/id.go 76.19% <0.00%> (-4.77%) ⬇️
pkg/btree/btree.go 85.30% <0.00%> (-0.97%) ⬇️
server/server.go 72.90% <0.00%> (-0.61%) ⬇️
server/grpc_service.go 47.39% <0.00%> (-0.23%) ⬇️
client/client.go 72.10% <0.00%> (-0.14%) ⬇️
server/statistics/metrics.go 100.00% <0.00%> (ø)
server/tso/allocator_manager.go 78.07% <0.00%> (+0.16%) ⬆️
server/statistics/region_collection.go 97.41% <0.00%> (+0.33%) ⬆️
... and 5 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 82671c2...d76649e. Read the comment docs.

@lhy1024 lhy1024 closed this Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/cluster Cluster logic. component/metrics Metrics. needs-cherry-pick-release-4.0 The PR needs to cherry pick to release-4.0 branch. needs-cherry-pick-release-5.0 The PR needs to cherry pick to release-5.0 branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

metrics: the num of offline Region is unexpected The statistics of miss-peer is not accurate sometimes
3 participants