Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
Signed-off-by: HunDunDM <hundundm@gmail.com>
  • Loading branch information
HunDunDM committed Mar 12, 2021
1 parent 5ea19b8 commit d51ef57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/statistics/region_collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ func notIsolatedStoresWithLabel(stores []*core.StoreInfo, label string) [][]*cor
}

if len(valueStoresMap) == 0 {
// Usually it is because all TiKVs lack this label.
if len(emptyValueStores) > 1 {
return [][]*core.StoreInfo{emptyValueStores}
}
Expand All @@ -301,12 +302,15 @@ func notIsolatedStoresWithLabel(stores []*core.StoreInfo, label string) [][]*cor

var res [][]*core.StoreInfo
if len(emptyValueStores) == 0 {
// No TiKV lacks this label.
for _, stores := range valueStoresMap {
if len(stores) > 1 {
res = append(res, stores)
}
}
} else {
// Usually it is because some TiKVs lack this label.
// The TiKVs in each label and the TiKVs without label form a group.
for _, stores := range valueStoresMap {
stores = append(stores, emptyValueStores...)
res = append(res, stores)
Expand Down

0 comments on commit d51ef57

Please sign in to comment.