Skip to content

Commit

Permalink
need to fix mocktikv
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao committed Jun 24, 2022
1 parent 65e917f commit 40a5b2a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions store/copr/coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,9 @@ func (c *CopClient) Send(ctx context.Context, req *kv.Request, variables interfa
if !ok {
return copErrorResponse{errors.Errorf("unsupported variables:%+v", variables)}
}
if req.StoreType == kv.TiFlash {
if req.BatchCop {
logutil.BgLogger().Debug("send batch requests")
return c.sendBatch(ctx, req, vars, option)
}
req.Paging = false
if req.StoreType == kv.TiFlash && req.BatchCop {
logutil.BgLogger().Debug("send batch requests")
return c.sendBatch(ctx, req, vars, option)
}
failpoint.Inject("DisablePaging", func(_ failpoint.Value) {
req.Paging = false
Expand Down Expand Up @@ -863,7 +860,9 @@ func (worker *copIteratorWorker) handleCopPagingResult(bo *Backoffer, rpcCtx *ti
pagingRange := resp.pbResp.Range
// only paging requests need to calculate the next ranges
if pagingRange == nil {
return nil, errors.New("lastRange in paging should not be nil")
// If the storage engine doesn't support paging protocol, it should have return all the region data.
// So we finish here.
return nil, nil
}
// calculate next ranges and grow the paging size
task.ranges = worker.calculateRemain(task.ranges, pagingRange, worker.req.Desc)
Expand Down

0 comments on commit 40a5b2a

Please sign in to comment.