Skip to content

Commit

Permalink
Revert "This is an automated cherry-pick of pingcap#44803"
Browse files Browse the repository at this point in the history
This reverts commit d19162e.
  • Loading branch information
GMHDBJD committed Jun 29, 2023
1 parent d19162e commit 7a2bdad
Show file tree
Hide file tree
Showing 23 changed files with 7 additions and 4,424 deletions.
56 changes: 2 additions & 54 deletions br/pkg/checksum/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,7 @@ type ExecutorBuilder struct {

oldTable *metautil.Table

<<<<<<< HEAD
concurrency uint
=======
concurrency uint
backoffWeight int

oldKeyspace []byte
newKeyspace []byte
>>>>>>> 89bf7432279 (importinto/lightning: do remote checksum via sql (#44803))
}

// NewExecutorBuilder returns a new executor builder.
Expand All @@ -59,32 +51,13 @@ func (builder *ExecutorBuilder) SetConcurrency(conc uint) *ExecutorBuilder {
return builder
}

<<<<<<< HEAD
=======
// SetBackoffWeight set the backoffWeight of the checksum executing.
func (builder *ExecutorBuilder) SetBackoffWeight(backoffWeight int) *ExecutorBuilder {
builder.backoffWeight = backoffWeight
return builder
}

func (builder *ExecutorBuilder) SetOldKeyspace(keyspace []byte) *ExecutorBuilder {
builder.oldKeyspace = keyspace
return builder
}

func (builder *ExecutorBuilder) SetNewKeyspace(keyspace []byte) *ExecutorBuilder {
builder.newKeyspace = keyspace
return builder
}

>>>>>>> 89bf7432279 (importinto/lightning: do remote checksum via sql (#44803))
// Build builds a checksum executor.
func (builder *ExecutorBuilder) Build() (*Executor, error) {
reqs, err := buildChecksumRequest(builder.table, builder.oldTable, builder.ts, builder.concurrency)
if err != nil {
return nil, errors.Trace(err)
}
return &Executor{reqs: reqs, backoffWeight: builder.backoffWeight}, nil
return &Executor{reqs: reqs}, nil
}

func buildChecksumRequest(
Expand Down Expand Up @@ -289,8 +262,7 @@ func updateChecksumResponse(resp, update *tipb.ChecksumResponse) {

// Executor is a checksum executor.
type Executor struct {
reqs []*kv.Request
backoffWeight int
reqs []*kv.Request
}

// Len returns the total number of checksum requests.
Expand Down Expand Up @@ -336,31 +308,7 @@ func (exec *Executor) Execute(
//
// It is useful in TiDB, however, it's a place holder in BR.
killed := uint32(0)
<<<<<<< HEAD
resp, err := sendChecksumRequest(ctx, client, req, kv.NewVariables(&killed))
=======
var (
resp *tipb.ChecksumResponse
err error
)
err = utils.WithRetry(ctx, func() error {
vars := kv.NewVariables(&killed)
if exec.backoffWeight > 0 {
vars.BackOffWeight = exec.backoffWeight
}
resp, err = sendChecksumRequest(ctx, client, req, vars)
failpoint.Inject("checksumRetryErr", func(val failpoint.Value) {
// first time reach here. return error
if val.(bool) {
err = errors.New("inject checksum error")
}
})
if err != nil {
return errors.Trace(err)
}
return nil
}, &checksumBackoffer)
>>>>>>> 89bf7432279 (importinto/lightning: do remote checksum via sql (#44803))
if err != nil {
return nil, errors.Trace(err)
}
Expand Down
6 changes: 0 additions & 6 deletions br/pkg/lightning/backend/local/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ go_library(
"//kv",
"//parser/model",
"//parser/mysql",
<<<<<<< HEAD
=======
"//sessionctx/variable",
"//store/pdtypes",
>>>>>>> 89bf7432279 (importinto/lightning: do remote checksum via sql (#44803))
"//table",
"//tablecodec",
"//types",
Expand All @@ -67,7 +62,6 @@ go_library(
"@com_github_pingcap_kvproto//pkg/metapb",
"@com_github_pingcap_kvproto//pkg/pdpb",
"@com_github_tikv_client_go_v2//error",
"@com_github_tikv_client_go_v2//kv",
"@com_github_tikv_client_go_v2//oracle",
"@com_github_tikv_client_go_v2//tikv",
"@com_github_tikv_pd_client//:client",
Expand Down
5 changes: 0 additions & 5 deletions br/pkg/lightning/common/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ go_library(
"//br/pkg/utils",
"//errno",
"//parser/model",
<<<<<<< HEAD
=======
"//parser/mysql",
"//sessionctx/variable",
>>>>>>> 89bf7432279 (importinto/lightning: do remote checksum via sql (#44803))
"//store/driver/error",
"//table/tables",
"//util",
Expand Down
109 changes: 0 additions & 109 deletions br/pkg/lightning/common/common.go

This file was deleted.

Loading

0 comments on commit 7a2bdad

Please sign in to comment.