Skip to content

Commit

Permalink
restore: refine checksum request (pingcap#43)
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Shen <overvenus@gmail.com>
  • Loading branch information
overvenus authored Nov 8, 2019
1 parent 0f6019c commit 8711c94
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/restore/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
pd "github.com/pingcap/pd/client"
restore_util "github.com/pingcap/tidb-tools/pkg/restore-util"
"github.com/pingcap/tidb/domain"
"github.com/pingcap/tidb/kv"
"github.com/pingcap/tidb/session"
"github.com/pingcap/tidb/sessionctx"
"github.com/pingcap/tidb/store/tikv"
Expand Down Expand Up @@ -527,14 +528,15 @@ func (rc *Client) checksumRange(triedTime int, boundedStart []byte, boundedEnd [
// checksum key range [start, end) in region with retry
func (rc *Client) checksumRegion(triedTime int, start *[]byte, end *[]byte, region *metapb.Region, peer *metapb.Peer, reqData []byte) (*tipb.ChecksumResponse, error) {
reqCtx := &kvrpcpb.Context{
RegionId: region.GetId(),
RegionEpoch: region.GetRegionEpoch(),
Peer: peer,
RegionId: region.GetId(),
RegionEpoch: region.GetRegionEpoch(),
Peer: peer,
NotFillCache: true, // Do not fill rocksdb block cache.
}
ranges := []*coprocessor.KeyRange{{Start: *start, End: *end}}
req := &coprocessor.Request{
Context: reqCtx,
Tp: 105, // REQ_TYPE_CHECKSUM flag
Tp: kv.ReqTypeChecksum, // REQ_TYPE_CHECKSUM flag
Data: reqData,
Ranges: ranges,
}
Expand Down

0 comments on commit 8711c94

Please sign in to comment.