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

cluster: fix health metrics (#2987) #3368

Merged
merged 4 commits into from
Jan 26, 2021

Conversation

ti-srebot
Copy link
Contributor

@ti-srebot ti-srebot commented Jan 20, 2021

cherry-pick #2987 to release-4.0
You can switch your code base to this Pull Request by using git-extras:

# In pd repo:
git pr https://github.com/tikv/pd/pull/3368

After apply modifications, you can push your change to this PR via:

git push [email protected]:ti-srebot/pd.git pr/3368:release-4.0-66c26169b813

Signed-off-by: disksing [email protected]

What problem does this PR solve?

What is changed and how it works?

  • add metrics reset (after removing a member, you will still need to restart PD or transfer leader to reset metrics)
  • fix wrong value

Check List

Tests

  • Manual test (add detailed scripts or steps below)
  1. start 3pd+1tikv cluster
  2. check /metrics output
pd_cluster_health_status{name="pd1"} 1
pd_cluster_health_status{name="pd2"} 1
pd_cluster_health_status{name="pd3"} 1
  1. delete member pd3
  2. transfer leader
  3. check /metrics output again, removed member is not displayed
pd_cluster_health_status{name="pd1"} 1
pd_cluster_health_status{name="pd2"} 1

Release note

  • Fix the issue that member health metrics not correct

@ti-srebot ti-srebot added component/metrics Metrics. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug. type/cherry-pick labels Jan 20, 2021
@ti-srebot ti-srebot added this to the v4.0.11 milestone Jan 20, 2021
@ti-chi-bot ti-chi-bot requested a review from jebter January 20, 2021 04:28
@ti-srebot
Copy link
Contributor Author

@disksing you're already a collaborator in bot's repo.

Copy link
Contributor

@lhy1024 lhy1024 left a comment

Choose a reason for hiding this comment

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

plz fix conflict

Signed-off-by: nolouch <[email protected]>
@nolouch
Copy link
Contributor

nolouch commented Jan 20, 2021

/run-all-tests

1 similar comment
@rleungx
Copy link
Member

rleungx commented Jan 26, 2021

/run-all-tests

@codecov
Copy link

codecov bot commented Jan 26, 2021

Codecov Report

Merging #3368 (879155e) into release-4.0 (d00a83a) will increase coverage by 0.04%.
The diff coverage is 28.57%.

Impacted file tree graph

@@               Coverage Diff               @@
##           release-4.0    #3368      +/-   ##
===============================================
+ Coverage        74.71%   74.76%   +0.04%     
===============================================
  Files              209      209              
  Lines            19681    19683       +2     
===============================================
+ Hits             14705    14716      +11     
+ Misses            3644     3636       -8     
+ Partials          1332     1331       -1     
Flag Coverage Δ
unittests 74.76% <28.57%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
server/cluster/cluster.go 79.62% <28.57%> (+0.05%) ⬆️
pkg/dashboard/adapter/manager.go 81.52% <0.00%> (-3.27%) ⬇️
pkg/etcdutil/etcdutil.go 76.47% <0.00%> (-1.48%) ⬇️
client/client.go 69.03% <0.00%> (-0.51%) ⬇️
server/member/leader.go 68.34% <0.00%> (-0.46%) ⬇️
server/grpc_service.go 59.47% <0.00%> (-0.41%) ⬇️
server/server.go 74.12% <0.00%> (+0.49%) ⬆️
pkg/btree/btree.go 86.26% <0.00%> (+0.96%) ⬆️
pkg/mock/mockhbstream/mockhbstream.go 92.59% <0.00%> (+3.70%) ⬆️
server/id/id.go 80.95% <0.00%> (+4.76%) ⬆️
... and 1 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 d00a83a...879155e. Read the comment docs.

@rleungx
Copy link
Member

rleungx commented Jan 26, 2021

/merge

@ti-chi-bot
Copy link
Member

@rleungx: 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: dcd6804

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

@ti-srebot: Your PR has out-of-dated, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/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 ti-chi-bot merged commit 2b3f7a7 into tikv:release-4.0 Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/metrics Metrics. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants