Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

lightning/backend: run batch split region in parallel for local backend #761

Merged
merged 14 commits into from
Mar 13, 2021
Merged
Prev Previous commit
Next Next commit
address review comments
  • Loading branch information
glorv committed Mar 12, 2021
commit 23e085d09c9352b7c8305d35a3ee3e10391a7df3
8 changes: 1 addition & 7 deletions pkg/lightning/backend/localhelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func (local *local) SplitAndScatterRegionByRanges(ctx context.Context, ranges []
ch := make(chan *splitInfo, size)
eg, splitCtx := errgroup.WithContext(ctx)

for i := 0; i < size; i++ {
for splitWorker := 0; splitWorker < size; splitWorker++ {
eg.Go(func() error {
for sp := range ch {
var newRegions []*split.RegionInfo
Expand Down Expand Up @@ -226,12 +226,6 @@ func (local *local) SplitAndScatterRegionByRanges(ctx context.Context, ranges []
return splitError
}

select {
case <-ctx.Done():
return ctx.Err()
default:
}

if len(retryKeys) == 0 {
break
} else {
Expand Down