-
Notifications
You must be signed in to change notification settings - Fork 719
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
Health check for stores #203
Conversation
@@ -127,7 +128,7 @@ func (cb *capacityBalancer) ScoreType() scoreType { | |||
// selectBalanceRegion tries to select a store leader region to do balance and returns true, but if we cannot find any, | |||
// we try to find a store follower region and returns false. | |||
func (cb *capacityBalancer) selectBalanceRegion(cluster *clusterInfo, stores []*storeInfo) (*metapb.Region, *metapb.Peer, *metapb.Peer, bool) { | |||
store := selectFromStore(stores, cluster.getUnknownStores(), cb.filters, cb.st) | |||
store := selectFromStore(stores, nil, cb.filters, cb.st) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why nil now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unknown stores will be filtered out in stateFilter
, no need to maintain another unknown stores map now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so need to remove this arg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some places still need this arg, we may remove it after we do some refactor, but not in this PR.
17a69d8
to
5f86b01
Compare
@@ -187,6 +187,10 @@ type BalanceConfig struct { | |||
|
|||
// MaxTransferWaitCount is the max heartbeat count to wait leader transfer to finish. | |||
MaxTransferWaitCount uint64 `toml:"max-transfer-wait-count" json:"max-transfer-wait-count"` | |||
|
|||
// MaxStoreDownInterval is the max interval (in seconds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@queenypingcap please help to check comments.
Check unknown stores in `stateFilter` instead of maintaining an unknown stores map.
208d4f7
to
9302f40
Compare
@@ -49,6 +49,7 @@ var ( | |||
maxBalanceRetryPerLoop = flag.Uint64("max-balance-retry-per-loop", 10, "the max retry count to balance in a balance schedule") | |||
maxBalanceCountPerLoop = flag.Uint64("max-balance-count-per-loop", 3, "the max region count to balance in a balance schedule") | |||
maxTransferWaitCount = flag.Uint64("max-transfer-wait-count", 3, "the max heartbeat count to wait leader transfer to finish") | |||
maxStoreDownDuration = flag.Uint64("max-store-down-duration", 60, "the max duration a store without heartbeat will be considered to be down") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@queenypingcap please review the explanation.
LGTM |
LGTM |
1 similar comment
LGTM |
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Filter out unknown and down stores from balance.