diff --git a/store/tikv/coprocessor.go b/store/tikv/coprocessor.go index 712de3f1b7b30..e87aa312ef078 100644 --- a/store/tikv/coprocessor.go +++ b/store/tikv/coprocessor.go @@ -779,7 +779,9 @@ func (worker *copIteratorWorker) handleCopStreamResult(bo *Backoffer, rpcCtx *RP logutil.Logger(context.Background()).Info("stream recv timeout", zap.Error(err)) return worker.buildCopTasksFromRemain(bo, lastRange, task) } - lastRange = resp.Range + if resp.Range != nil { + lastRange = resp.Range + } } }