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
*: balance based on read flow #708
Conversation
Signed-off-by: UncP <uncp.xu@gmail.com>
Signed-off-by: UncP <uncp.xu@gmail.com>
Signed-off-by: UncP <uncp.xu@gmail.com>
Signed-off-by: UncP <uncp.xu@gmail.com>
pdctl/command/hot_command.go
Outdated
hotRegionsPrefix = "pd/api/v1/hotspot/regions" | ||
hotStoresPrefix = "pd/api/v1/hotspot/stores" | ||
hotRegionsPrefix = "pd/api/v1/hotspot/regions" | ||
hotReadRegionsPrefix = "pd/api/v1/hotspot/readregions" |
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.
Maybe regions/write
and regions/read
.
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.
"pd/api/v1/hotspot/regions"
this is for write, maybe
"pd/api/v1/hotspot/read"
this is for read ?
server/balancer.go
Outdated
regionInfo := cluster.getRegion(r.RegionID) | ||
leaderStoreID := regionInfo.Leader.GetStoreId() | ||
storeIDs := regionInfo.GetStoreIds() | ||
for storeID := range storeIDs { |
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.
No need the loop. We can update leaderStoreID
directly.
Signed-off-by: UncP <uncp.xu@gmail.com>
/run-full-test |
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.
the rest LGTM.
server/cache.go
Outdated
} | ||
|
||
func newClusterInfo(id IDAllocator) *clusterInfo { | ||
return &clusterInfo{ | ||
id: id, | ||
stores: newStoresInfo(), | ||
regions: newRegionsInfo(), | ||
readStatistics: cache.NewDefaultCache(writeStatCacheMaxLen), |
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.
rename writeStatCacheMaxLen
to a better one.
LGTM. PTAL @zhangjinpeng1987 @overvenus |
LGTM |
No description provided.