Fix wrong tikv store leader count#762
Merged
lucklove merged 16 commits intopingcap:masterfrom Sep 11, 2020
Merged
Conversation
Fix pingcap#761 Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
…o fix-evict-tikv
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
lonng
reviewed
Sep 10, 2020
lonng
reviewed
Sep 10, 2020
Comment on lines
+379
to
+380
| for mf := range mfChan { | ||
| fm := prom2json.NewFamily(mf) | ||
| fms = append(fms, fm) | ||
| } | ||
| for _, fm := range fms { |
Contributor
There was a problem hiding this comment.
Why not merge the two iterations to avoid use a slice to save the *prom2json.Family?
Member
Author
There was a problem hiding this comment.
I'm afraid that there may be goroutine leak. eg: the loop found target metric and returns but the sender has not finish all metrics
Contributor
There was a problem hiding this comment.
I think we can resolve it via:
defer close(mfChan)
for {
}
lonng
reviewed
Sep 10, 2020
lonng
reviewed
Sep 10, 2020
Signed-off-by: lucklove <gnu.crazier@gmail.com>
816c681 to
0177af5
Compare
37cfb62 to
3de4832
Compare
3de4832 to
0d385f8
Compare
ti-srebot
approved these changes
Sep 10, 2020
5e1c57c to
d1ebb27
Compare
Codecov Report
@@ Coverage Diff @@
## master #762 +/- ##
==========================================
+ Coverage 54.62% 54.71% +0.08%
==========================================
Files 260 260
Lines 21015 21070 +55
==========================================
+ Hits 11479 11528 +49
+ Misses 7993 7989 -4
- Partials 1543 1553 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #761
Signed-off-by: lucklove gnu.crazier@gmail.com
What problem does this PR solve?
After pd restart, the region leader information will be lost and tiup can't evict tikv leaders correctly.
What is changed and how it works?
Use kv metrics api to count leader instead of read it from PDs
Check List
Tests
Both tls and non-tls works:

Related changes
Release notes: