Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion br/pkg/task/backup_ebs.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ func waitUntilAllScheduleStopped(ctx context.Context, cfg Config, allStores []*m
defer mutex.Unlock()
allRegions = append(allRegions, regions...)
}

storeLeaderRegionsFlat := make([]*metapb.Region, 0, 100*len(allStores))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 100? Maybe add a comment? Do you expect 100 regions per store?

for i := range allStores {
store := allStores[i]
if ectx.Err() != nil {
Expand All @@ -371,7 +373,7 @@ func waitUntilAllScheduleStopped(ctx context.Context, cfg Config, allStores []*m
return errors.Trace(err)
}

storeLeaderRegions := make([]*metapb.Region, 0, 100)
storeLeaderRegions := storeLeaderRegionsFlat[i*100 : 0 : (i+1)*100]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the same 100? does it need to be kept in sync with the other 100 on line 357? If so, maybe put it in a variable.

for {
response, err2 := checkAdminClient.Recv()
if err2 != nil {
Expand Down