diff --git a/cdc/entry/mounter_test.go b/cdc/entry/mounter_test.go index d26c015db8c..4eb16eb9576 100644 --- a/cdc/entry/mounter_test.go +++ b/cdc/entry/mounter_test.go @@ -28,8 +28,8 @@ import ( tidbkv "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/store/mockstore" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/util/testkit" + "github.com/tikv/client-go/v2/oracle" "go.uber.org/zap" ) diff --git a/cdc/entry/schema_storage_test.go b/cdc/entry/schema_storage_test.go index 698681049e0..7f9f13b44be 100644 --- a/cdc/entry/schema_storage_test.go +++ b/cdc/entry/schema_storage_test.go @@ -33,9 +33,9 @@ import ( "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/store/mockstore" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/types" "github.com/pingcap/tidb/util/testkit" + "github.com/tikv/client-go/v2/oracle" ) type schemaSuite struct{} diff --git a/cdc/entry/schema_test_helper.go b/cdc/entry/schema_test_helper.go index db98a71688c..7f6094751a5 100644 --- a/cdc/entry/schema_test_helper.go +++ b/cdc/entry/schema_test_helper.go @@ -22,8 +22,8 @@ import ( timeta "github.com/pingcap/tidb/meta" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/store/mockstore" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/util/testkit" + "github.com/tikv/client-go/v2/oracle" ) // SchemaTestHelper is a test helper for schema which creates an internal tidb instance to generate DDL jobs with meta information diff --git a/cdc/http_api_handler.go b/cdc/http_api_handler.go index 6dcf4de6807..2eea5b32e10 100644 --- a/cdc/http_api_handler.go +++ b/cdc/http_api_handler.go @@ -24,7 +24,7 @@ import ( "github.com/pingcap/ticdc/cdc/model" cerror "github.com/pingcap/ticdc/pkg/errors" "github.com/pingcap/ticdc/pkg/httputil" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" "go.uber.org/zap" ) diff --git a/cdc/http_handler.go b/cdc/http_handler.go index 0b89a4253a9..26e9d5e453f 100644 --- a/cdc/http_handler.go +++ b/cdc/http_handler.go @@ -28,7 +28,7 @@ import ( "github.com/pingcap/ticdc/pkg/config" cerror "github.com/pingcap/ticdc/pkg/errors" "github.com/pingcap/ticdc/pkg/logutil" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" "go.etcd.io/etcd/clientv3/concurrency" "go.uber.org/zap" ) diff --git a/cdc/kv/client.go b/cdc/kv/client.go index 645fcd59156..835d262059b 100644 --- a/cdc/kv/client.go +++ b/cdc/kv/client.go @@ -38,10 +38,10 @@ import ( "github.com/pingcap/ticdc/pkg/txnutil" "github.com/pingcap/ticdc/pkg/util" "github.com/pingcap/ticdc/pkg/version" - "github.com/pingcap/tidb/store/tikv" - tidbkv "github.com/pingcap/tidb/store/tikv/kv" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/prometheus/client_golang/prometheus" + tidbkv "github.com/tikv/client-go/v2/kv" + "github.com/tikv/client-go/v2/oracle" + "github.com/tikv/client-go/v2/tikv" pd "github.com/tikv/pd/client" "go.uber.org/zap" "golang.org/x/sync/errgroup" @@ -1167,7 +1167,7 @@ func (s *eventFeedSession) handleError(ctx context.Context, errInfo regionErrorI if notLeader := innerErr.GetNotLeader(); notLeader != nil { metricFeedNotLeaderCounter.Inc() // TODO: Handle the case that notleader.GetLeader() is nil. - s.regionCache.UpdateLeader(errInfo.verID, notLeader.GetLeader().GetStoreId(), errInfo.rpcCtx.AccessIdx) + s.regionCache.UpdateLeader(errInfo.verID, notLeader.GetLeader(), errInfo.rpcCtx.AccessIdx) } else if innerErr.GetEpochNotMatch() != nil { // TODO: If only confver is updated, we don't need to reload the region from region cache. metricFeedEpochNotMatchCounter.Inc() diff --git a/cdc/kv/client_bench_test.go b/cdc/kv/client_bench_test.go index 187f8f01d5c..193f6017220 100644 --- a/cdc/kv/client_bench_test.go +++ b/cdc/kv/client_bench_test.go @@ -30,9 +30,9 @@ import ( "github.com/pingcap/ticdc/pkg/security" "github.com/pingcap/ticdc/pkg/txnutil" "github.com/pingcap/tidb/store/mockstore/mockcopr" - "github.com/pingcap/tidb/store/tikv" - "github.com/pingcap/tidb/store/tikv/mockstore/mocktikv" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/mockstore/mocktikv" + "github.com/tikv/client-go/v2/oracle" + "github.com/tikv/client-go/v2/tikv" "go.uber.org/zap/zapcore" "google.golang.org/grpc" ) diff --git a/cdc/kv/client_test.go b/cdc/kv/client_test.go index fb58e847084..b04c3ae1eb3 100644 --- a/cdc/kv/client_test.go +++ b/cdc/kv/client_test.go @@ -43,9 +43,9 @@ import ( "github.com/pingcap/ticdc/pkg/util/testleak" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store/mockstore/mockcopr" - "github.com/pingcap/tidb/store/tikv" - "github.com/pingcap/tidb/store/tikv/mockstore/mocktikv" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/mockstore/mocktikv" + "github.com/tikv/client-go/v2/oracle" + "github.com/tikv/client-go/v2/tikv" "go.uber.org/zap" "google.golang.org/grpc" ) diff --git a/cdc/kv/region_worker.go b/cdc/kv/region_worker.go index 675186ddc4e..d075e057ed6 100644 --- a/cdc/kv/region_worker.go +++ b/cdc/kv/region_worker.go @@ -31,8 +31,8 @@ import ( "github.com/pingcap/ticdc/pkg/regionspan" "github.com/pingcap/ticdc/pkg/util" "github.com/pingcap/ticdc/pkg/workerpool" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/prometheus/client_golang/prometheus" + "github.com/tikv/client-go/v2/oracle" "go.uber.org/zap" "golang.org/x/sync/errgroup" "golang.org/x/time/rate" diff --git a/cdc/kv/store_op.go b/cdc/kv/store_op.go index d7583f221bb..6047db69de9 100644 --- a/cdc/kv/store_op.go +++ b/cdc/kv/store_op.go @@ -30,8 +30,8 @@ import ( "github.com/pingcap/tidb/meta" "github.com/pingcap/tidb/store" "github.com/pingcap/tidb/store/driver" - "github.com/pingcap/tidb/store/tikv" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" + "github.com/tikv/client-go/v2/tikv" "go.uber.org/zap" ) diff --git a/cdc/kv/testing.go b/cdc/kv/testing.go index ef57b8a2ee0..75f9ddf25fc 100644 --- a/cdc/kv/testing.go +++ b/cdc/kv/testing.go @@ -29,8 +29,8 @@ import ( "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store" "github.com/pingcap/tidb/store/driver" - "github.com/pingcap/tidb/store/tikv" "github.com/stretchr/testify/require" + "github.com/tikv/client-go/v2/tikv" pd "github.com/tikv/pd/client" "go.uber.org/zap" ) diff --git a/cdc/kv/token_region_test.go b/cdc/kv/token_region_test.go index 8545ccdf721..6dad49a935c 100644 --- a/cdc/kv/token_region_test.go +++ b/cdc/kv/token_region_test.go @@ -22,7 +22,7 @@ import ( "github.com/pingcap/check" "github.com/pingcap/errors" "github.com/pingcap/ticdc/pkg/util/testleak" - "github.com/pingcap/tidb/store/tikv" + "github.com/tikv/client-go/v2/tikv" "golang.org/x/sync/errgroup" ) diff --git a/cdc/model/changefeed.go b/cdc/model/changefeed.go index be160b3fd94..c9db6611c3f 100644 --- a/cdc/model/changefeed.go +++ b/cdc/model/changefeed.go @@ -25,7 +25,7 @@ import ( "github.com/pingcap/ticdc/pkg/config" "github.com/pingcap/ticdc/pkg/cyclic/mark" cerror "github.com/pingcap/ticdc/pkg/errors" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" "go.uber.org/zap" ) @@ -131,7 +131,7 @@ func (info *ChangeFeedInfo) GetStartTs() uint64 { return info.StartTs } - return oracle.EncodeTSO(info.CreateTime.Unix() * 1000) + return oracle.GoTimeToTS(info.CreateTime) } // GetCheckpointTs returns CheckpointTs if it's specified in ChangeFeedStatus, otherwise StartTs is returned. diff --git a/cdc/model/changefeed_test.go b/cdc/model/changefeed_test.go index c8954febcfe..c58bf67343f 100644 --- a/cdc/model/changefeed_test.go +++ b/cdc/model/changefeed_test.go @@ -23,7 +23,7 @@ import ( cerror "github.com/pingcap/ticdc/pkg/errors" "github.com/pingcap/ticdc/pkg/util/testleak" filter "github.com/pingcap/tidb-tools/pkg/table-filter" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" ) type configSuite struct{} @@ -345,7 +345,7 @@ func (s *changefeedSuite) TestGetTs(c *check.C) { CreateTime: createTime, } ) - c.Assert(info.GetStartTs(), check.Equals, oracle.EncodeTSO(createTime.Unix()*1000)) + c.Assert(info.GetStartTs(), check.Equals, oracle.GoTimeToTS(createTime)) info.StartTs = startTs c.Assert(info.GetStartTs(), check.Equals, startTs) diff --git a/cdc/owner.go b/cdc/owner.go index f5a55232dcc..dbdb9c89075 100644 --- a/cdc/owner.go +++ b/cdc/owner.go @@ -38,7 +38,7 @@ import ( "github.com/pingcap/ticdc/pkg/scheduler" "github.com/pingcap/ticdc/pkg/security" "github.com/pingcap/ticdc/pkg/util" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" pd "github.com/tikv/pd/client" "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/clientv3/concurrency" diff --git a/cdc/owner/changefeed.go b/cdc/owner/changefeed.go index 64ea4c40555..3cea8e16d42 100644 --- a/cdc/owner/changefeed.go +++ b/cdc/owner/changefeed.go @@ -27,8 +27,8 @@ import ( cerror "github.com/pingcap/ticdc/pkg/errors" "github.com/pingcap/ticdc/pkg/util" "github.com/pingcap/tidb/sessionctx/binloginfo" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/prometheus/client_golang/prometheus" + "github.com/tikv/client-go/v2/oracle" "go.uber.org/zap" ) diff --git a/cdc/owner/changefeed_test.go b/cdc/owner/changefeed_test.go index 02819ab20c0..f30e72032f1 100644 --- a/cdc/owner/changefeed_test.go +++ b/cdc/owner/changefeed_test.go @@ -26,7 +26,7 @@ import ( cdcContext "github.com/pingcap/ticdc/pkg/context" "github.com/pingcap/ticdc/pkg/orchestrator" "github.com/pingcap/ticdc/pkg/util/testleak" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" ) type mockDDLPuller struct { diff --git a/cdc/owner/gc_manager.go b/cdc/owner/gc_manager.go index 4f265b9db3b..2b9bb2be89f 100644 --- a/cdc/owner/gc_manager.go +++ b/cdc/owner/gc_manager.go @@ -24,7 +24,7 @@ import ( "github.com/pingcap/ticdc/pkg/config" cdcContext "github.com/pingcap/ticdc/pkg/context" cerror "github.com/pingcap/ticdc/pkg/errors" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" "go.uber.org/zap" ) diff --git a/cdc/owner/gc_manager_test.go b/cdc/owner/gc_manager_test.go index ed712f61a16..a2ec3cdd764 100644 --- a/cdc/owner/gc_manager_test.go +++ b/cdc/owner/gc_manager_test.go @@ -26,7 +26,7 @@ import ( cerror "github.com/pingcap/ticdc/pkg/errors" "github.com/pingcap/ticdc/pkg/orchestrator" "github.com/pingcap/ticdc/pkg/util/testleak" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" pd "github.com/tikv/pd/client" ) diff --git a/cdc/owner/owner_test.go b/cdc/owner/owner_test.go index 8b178d1d25b..02317160007 100644 --- a/cdc/owner/owner_test.go +++ b/cdc/owner/owner_test.go @@ -25,7 +25,7 @@ import ( "github.com/pingcap/ticdc/pkg/etcd" "github.com/pingcap/ticdc/pkg/orchestrator" "github.com/pingcap/ticdc/pkg/util/testleak" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" ) var _ = check.Suite(&ownerSuite{}) diff --git a/cdc/owner/schema_test.go b/cdc/owner/schema_test.go index ae9defcc87e..f787a5c81f1 100644 --- a/cdc/owner/schema_test.go +++ b/cdc/owner/schema_test.go @@ -23,7 +23,7 @@ import ( "github.com/pingcap/ticdc/cdc/model" "github.com/pingcap/ticdc/pkg/config" "github.com/pingcap/ticdc/pkg/util/testleak" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" ) var _ = check.Suite(&schemaSuite{}) diff --git a/cdc/owner_test.go b/cdc/owner_test.go index a697fa9755b..88b59b70027 100644 --- a/cdc/owner_test.go +++ b/cdc/owner_test.go @@ -41,7 +41,7 @@ import ( "github.com/pingcap/ticdc/pkg/util/testleak" "github.com/pingcap/tidb/meta" "github.com/pingcap/tidb/store/mockstore" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" pd "github.com/tikv/pd/client" "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/clientv3/concurrency" @@ -369,7 +369,7 @@ func (s *ownerSuite) TestOwnerHandleStaleChangeFeed(c *check.C) { info: &model.ChangeFeedInfo{State: model.StateNormal}, etcdCli: s.client, status: &model.ChangeFeedStatus{ - CheckpointTs: oracle.EncodeTSO(oracle.GetPhysical(time.Now())), + CheckpointTs: oracle.GoTimeToTS(time.Now()), }, targetTs: 2000, ddlState: model.ChangeFeedSyncDML, diff --git a/cdc/processor.go b/cdc/processor.go index 1a8793a5994..06b23636a8f 100644 --- a/cdc/processor.go +++ b/cdc/processor.go @@ -42,7 +42,7 @@ import ( "github.com/pingcap/ticdc/pkg/security" "github.com/pingcap/ticdc/pkg/util" tidbkv "github.com/pingcap/tidb/kv" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" pd "github.com/tikv/pd/client" "go.etcd.io/etcd/clientv3" "go.etcd.io/etcd/clientv3/concurrency" diff --git a/cdc/processor/pipeline/puller.go b/cdc/processor/pipeline/puller.go index 58713947867..7e82cea50b5 100644 --- a/cdc/processor/pipeline/puller.go +++ b/cdc/processor/pipeline/puller.go @@ -24,7 +24,7 @@ import ( "github.com/pingcap/ticdc/pkg/pipeline" "github.com/pingcap/ticdc/pkg/regionspan" "github.com/pingcap/ticdc/pkg/util" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" "golang.org/x/sync/errgroup" ) diff --git a/cdc/processor/processor.go b/cdc/processor/processor.go index 9bd167b42cc..f4301b66a68 100644 --- a/cdc/processor/processor.go +++ b/cdc/processor/processor.go @@ -40,8 +40,8 @@ import ( "github.com/pingcap/ticdc/pkg/regionspan" "github.com/pingcap/ticdc/pkg/retry" "github.com/pingcap/ticdc/pkg/util" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/prometheus/client_golang/prometheus" + "github.com/tikv/client-go/v2/oracle" "go.uber.org/zap" ) diff --git a/cdc/puller/mock_puller.go b/cdc/puller/mock_puller.go index 8a5f7394a65..eb660dde08d 100644 --- a/cdc/puller/mock_puller.go +++ b/cdc/puller/mock_puller.go @@ -28,8 +28,8 @@ import ( tidbkv "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/session" "github.com/pingcap/tidb/store/mockstore" - "github.com/pingcap/tidb/store/tikv/mockstore/mocktikv" "github.com/pingcap/tidb/util/testkit" + "github.com/tikv/client-go/v2/mockstore/mocktikv" "go.uber.org/zap" ) diff --git a/cdc/puller/mock_puller_test.go b/cdc/puller/mock_puller_test.go index b7b4be4aa52..1c80954cd3c 100644 --- a/cdc/puller/mock_puller_test.go +++ b/cdc/puller/mock_puller_test.go @@ -25,7 +25,7 @@ import ( "github.com/pingcap/ticdc/cdc/entry" "github.com/pingcap/ticdc/cdc/model" "github.com/pingcap/ticdc/pkg/util" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" ) type mockPullerSuite struct{} @@ -54,7 +54,7 @@ func (s *mockPullerSuite) TestTxnSort(c *check.C) { pm.MustExec("insert into test.test(id, a) values(?, ?)", 2, 2) pm.MustExec("insert into test.test(id, a) values(?, ?)", 3, 3) pm.MustExec("delete from test.test") - waitForGrowingTs(&ts, oracle.EncodeTSO(time.Now().Unix()*1000)) + waitForGrowingTs(&ts, oracle.GoTimeToTS(time.Now())) } func (s *mockPullerSuite) TestDDLPuller(c *check.C) { @@ -93,7 +93,7 @@ func (s *mockPullerSuite) TestDDLPuller(c *check.C) { pm.MustExec("insert into test.test(id, a) values(?, ?)", 2, 2) pm.MustExec("insert into test.test(id, a) values(?, ?)", 3, 3) pm.MustExec("delete from test.test") - waitForGrowingTs(&ts, oracle.EncodeTSO(time.Now().Unix()*1000)) + waitForGrowingTs(&ts, oracle.GoTimeToTS(time.Now())) } func (s *mockPullerSuite) TestStartTs(c *check.C) { @@ -122,7 +122,7 @@ func (s *mockPullerSuite) TestStartTs(c *check.C) { pm.MustExec("insert into test.test(id, a) values(?, ?)", 2, 2) pm.MustExec("insert into test.test(id, a) values(?, ?)", 3, 3) pm.MustExec("delete from test.test") - waitForGrowingTs(&ts, oracle.EncodeTSO(time.Now().Unix()*1000)) + waitForGrowingTs(&ts, oracle.GoTimeToTS(time.Now())) cancel() mu.Lock() index := len(rawTxns) / 2 diff --git a/cdc/puller/puller.go b/cdc/puller/puller.go index 93fd4f8ec71..8c09690cb0e 100644 --- a/cdc/puller/puller.go +++ b/cdc/puller/puller.go @@ -28,8 +28,8 @@ import ( "github.com/pingcap/ticdc/pkg/txnutil" "github.com/pingcap/ticdc/pkg/util" tidbkv "github.com/pingcap/tidb/kv" - "github.com/pingcap/tidb/store/tikv" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" + "github.com/tikv/client-go/v2/tikv" pd "github.com/tikv/pd/client" "go.uber.org/zap" "golang.org/x/sync/errgroup" diff --git a/cdc/puller/puller_test.go b/cdc/puller/puller_test.go index 93740b1b145..83007a08923 100644 --- a/cdc/puller/puller_test.go +++ b/cdc/puller/puller_test.go @@ -31,7 +31,7 @@ import ( "github.com/pingcap/ticdc/pkg/util/testleak" tidbkv "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store/mockstore" - "github.com/pingcap/tidb/store/tikv" + "github.com/tikv/client-go/v2/tikv" pd "github.com/tikv/pd/client" ) diff --git a/cdc/puller/sorter/merger.go b/cdc/puller/sorter/merger.go index 5ff7c7b918a..db0b6f4c507 100644 --- a/cdc/puller/sorter/merger.go +++ b/cdc/puller/sorter/merger.go @@ -29,7 +29,7 @@ import ( cerrors "github.com/pingcap/ticdc/pkg/errors" "github.com/pingcap/ticdc/pkg/notify" "github.com/pingcap/ticdc/pkg/util" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" "go.uber.org/zap" "golang.org/x/sync/errgroup" ) diff --git a/cdc/sink/codec/interface.go b/cdc/sink/codec/interface.go index f63b8e82ca3..1e1fafe24ae 100644 --- a/cdc/sink/codec/interface.go +++ b/cdc/sink/codec/interface.go @@ -19,7 +19,7 @@ import ( "github.com/pingcap/log" "github.com/pingcap/ticdc/cdc/model" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" "go.uber.org/zap" ) diff --git a/cmd/client_changefeed.go b/cmd/client_changefeed.go index ebfe3326740..d293308c176 100644 --- a/cmd/client_changefeed.go +++ b/cmd/client_changefeed.go @@ -34,10 +34,10 @@ import ( "github.com/pingcap/ticdc/pkg/security" "github.com/pingcap/ticdc/pkg/util" "github.com/pingcap/ticdc/pkg/version" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/r3labs/diff" "github.com/spf13/cobra" "github.com/spf13/pflag" + "github.com/tikv/client-go/v2/oracle" "go.uber.org/zap" ) diff --git a/cmd/client_tso.go b/cmd/client_tso.go index 21914cbaa88..179f636c733 100644 --- a/cmd/client_tso.go +++ b/cmd/client_tso.go @@ -16,8 +16,8 @@ package cmd import ( "os" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/spf13/cobra" + "github.com/tikv/client-go/v2/oracle" ) func newTsoCommand() *cobra.Command { diff --git a/cmd/cmd_test.go b/cmd/cmd_test.go index fab5dfa0eb2..4a4568f2cc2 100644 --- a/cmd/cmd_test.go +++ b/cmd/cmd_test.go @@ -24,8 +24,8 @@ import ( "github.com/pingcap/parser/model" "github.com/pingcap/ticdc/pkg/config" "github.com/pingcap/ticdc/pkg/util/testleak" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/spf13/cobra" + "github.com/tikv/client-go/v2/oracle" pd "github.com/tikv/pd/client" ) diff --git a/cmd/test.go b/cmd/test.go index 1c0a341154e..636f9c0c92b 100644 --- a/cmd/test.go +++ b/cmd/test.go @@ -19,8 +19,8 @@ import ( "strings" "github.com/pingcap/ticdc/cdc/kv" - "github.com/pingcap/tidb/store/tikv" "github.com/spf13/cobra" + "github.com/tikv/client-go/v2/tikv" pd "github.com/tikv/pd/client" ) diff --git a/cmd/util.go b/cmd/util.go index 63d7581d462..daeb443b852 100644 --- a/cmd/util.go +++ b/cmd/util.go @@ -42,9 +42,9 @@ import ( "github.com/pingcap/ticdc/pkg/logutil" "github.com/pingcap/ticdc/pkg/security" "github.com/pingcap/ticdc/pkg/util" - "github.com/pingcap/tidb/store/tikv/oracle" "github.com/spf13/cobra" "github.com/spf13/pflag" + "github.com/tikv/client-go/v2/oracle" "go.etcd.io/etcd/clientv3/concurrency" "go.uber.org/zap" ) diff --git a/go.mod b/go.mod index cd2b6efefa4..7a7ee200edd 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/golang/protobuf v1.3.4 github.com/golang/snappy v0.0.2 // indirect github.com/google/btree v1.0.0 - github.com/google/go-cmp v0.5.4 + github.com/google/go-cmp v0.5.5 github.com/google/uuid v1.1.1 github.com/grpc-ecosystem/grpc-gateway v1.14.3 // indirect github.com/integralist/go-findroot v0.0.0-20160518114804-ac90681525dc @@ -35,20 +35,21 @@ require ( github.com/onsi/ginkgo v1.9.0 // indirect github.com/onsi/gomega v1.6.0 // indirect github.com/philhofer/fwd v1.0.0 // indirect - github.com/pingcap/br v5.0.0-nightly.0.20210419090151-03762465b589+incompatible + github.com/pingcap/br v5.2.0-alpha.0.20210611153635-74f18bcbe19d+incompatible github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712 github.com/pingcap/errors v0.11.5-0.20201126102027-b0a155152ca3 github.com/pingcap/failpoint v0.0.0-20210316064728-7acb0f0a3dfd - github.com/pingcap/kvproto v0.0.0-20210429093846-65f54a202d7e + github.com/pingcap/kvproto v0.0.0-20210611081648-a215b4e61d2f github.com/pingcap/log v0.0.0-20210317133921-96f4fcab92a4 - github.com/pingcap/parser v0.0.0-20210427084954-8e8ed7927bde - github.com/pingcap/tidb v1.1.0-beta.0.20210508083641-8ed1d9d4a798 + github.com/pingcap/parser v0.0.0-20210618053735-57843e8185c4 + github.com/pingcap/tidb v1.1.0-beta.0.20210619135452-712fb1c55b48 github.com/pingcap/tidb-tools v4.0.9-0.20201127090955-2707c97b3853+incompatible github.com/prometheus/client_golang v1.5.1 github.com/r3labs/diff v1.1.0 github.com/spf13/cobra v1.0.0 github.com/spf13/pflag v1.0.5 - github.com/stretchr/testify v1.6.1 + github.com/stretchr/testify v1.7.0 + github.com/tikv/client-go/v2 v2.0.0-20210617115813-8d4847a86878 github.com/tikv/pd v1.1.0-beta.0.20210323121136-78679e5e209d github.com/tinylib/msgp v1.1.0 github.com/uber-go/atomic v1.4.0 @@ -56,7 +57,7 @@ require ( github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c go.etcd.io/bbolt v1.3.4 // indirect go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b - go.uber.org/zap v1.16.0 + go.uber.org/zap v1.17.0 golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect golang.org/x/exp v0.0.0-20200513190911-00229845015e // indirect golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect diff --git a/go.sum b/go.sum index 3d125375c5f..6f31f11e50e 100644 --- a/go.sum +++ b/go.sum @@ -107,7 +107,6 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa h1:OaNxuTZr7kxeODyLWsRMC+OD03aFUH+mW6r2d+MWa5Y= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/codahale/hdrhistogram v0.9.0/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/colinmarc/hdfs/v2 v2.1.1/go.mod h1:M3x+k8UKKmxtFu++uAZ0OtDU8jR3jnaZIAc6yK4Ue0c= github.com/coocood/bbloom v0.0.0-20190830030839-58deb6228d64 h1:W1SHiII3e0jVwvaQFglwu3kS9NLxOeTpvik7MbKCyuQ= github.com/coocood/bbloom v0.0.0-20190830030839-58deb6228d64/go.mod h1:F86k/6c7aDUdwSUevnLpHS/3Q9hzYCE99jGk2xsHnt0= @@ -280,8 +279,8 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -491,8 +490,8 @@ github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUM github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/badger v1.5.1-0.20200908111422-2e78ee155d19 h1:IXpGy7y9HyoShAFmzW2OPF0xCA5EOoSTyZHwsgYk9Ro= github.com/pingcap/badger v1.5.1-0.20200908111422-2e78ee155d19/go.mod h1:LyrqUOHZrUDf9oGi1yoz1+qw9ckSIhQb5eMa1acOLNQ= -github.com/pingcap/br v5.0.0-nightly.0.20210419090151-03762465b589+incompatible h1:VF2oZgvBqSIMmplEWXGGmktuQGdGGIGWwptmjJFhQbU= -github.com/pingcap/br v5.0.0-nightly.0.20210419090151-03762465b589+incompatible/go.mod h1:ymVmo50lQydxib0tmK5hHk4oteB7hZ0IMCArunwy3UQ= +github.com/pingcap/br v5.2.0-alpha.0.20210611153635-74f18bcbe19d+incompatible h1:L2W8DPb9rD83X15H1gyiFdKwZmi1pEDO8gULxzeDJrA= +github.com/pingcap/br v5.2.0-alpha.0.20210611153635-74f18bcbe19d+incompatible/go.mod h1:ymVmo50lQydxib0tmK5hHk4oteB7hZ0IMCArunwy3UQ= github.com/pingcap/check v0.0.0-20190102082844-67f458068fc8/go.mod h1:B1+S9LNcuMyLH/4HMTViQOJevkGiik3wW2AN9zb2fNQ= github.com/pingcap/check v0.0.0-20191107115940-caf2b9e6ccf4/go.mod h1:PYMCGwN0JHjoqGr3HrZoD+b8Tgx8bKnArhSq8YVzUMc= github.com/pingcap/check v0.0.0-20191216031241-8a5a85928f12/go.mod h1:PYMCGwN0JHjoqGr3HrZoD+b8Tgx8bKnArhSq8YVzUMc= @@ -517,25 +516,27 @@ github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989/go.mod h1:O17Xtb github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w= github.com/pingcap/kvproto v0.0.0-20200411081810-b85805c9476c/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= github.com/pingcap/kvproto v0.0.0-20210219064844-c1844a4775d6/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= -github.com/pingcap/kvproto v0.0.0-20210429093846-65f54a202d7e h1:oUMZ6X/Kpaoxfejh9/jQ+4UZ5xk9MRYcouWJ0oXRKNE= -github.com/pingcap/kvproto v0.0.0-20210429093846-65f54a202d7e/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= +github.com/pingcap/kvproto v0.0.0-20210531063847-f42e582bf0bb/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= +github.com/pingcap/kvproto v0.0.0-20210611081648-a215b4e61d2f h1:6K+5nbl1I3el9mYt/mlWorBR95qqmQdwrXYaNQrWWE8= +github.com/pingcap/kvproto v0.0.0-20210611081648-a215b4e61d2f/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8= github.com/pingcap/log v0.0.0-20200511115504-543df19646ad/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8= github.com/pingcap/log v0.0.0-20201112100606-8f1e84a3abc8/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8= github.com/pingcap/log v0.0.0-20210317133921-96f4fcab92a4 h1:ERrF0fTuIOnwfGbt71Ji3DKbOEaP189tjym50u8gpC8= github.com/pingcap/log v0.0.0-20210317133921-96f4fcab92a4/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8= -github.com/pingcap/parser v0.0.0-20210427084954-8e8ed7927bde h1:CcGOCE3kr8aYBy6rRcWWldidL1X5smQxV79nlnzOk+o= -github.com/pingcap/parser v0.0.0-20210427084954-8e8ed7927bde/go.mod h1:xZC8I7bug4GJ5KtHhgAikjTfU4kBv1Sbo3Pf1MZ6lVw= +github.com/pingcap/parser v0.0.0-20210525032559-c37778aff307/go.mod h1:xZC8I7bug4GJ5KtHhgAikjTfU4kBv1Sbo3Pf1MZ6lVw= +github.com/pingcap/parser v0.0.0-20210618053735-57843e8185c4 h1:NASsbyMTNW8pbYfoO/YTykO6MQJiNRa094lwCPU6R2Q= +github.com/pingcap/parser v0.0.0-20210618053735-57843e8185c4/go.mod h1:xZC8I7bug4GJ5KtHhgAikjTfU4kBv1Sbo3Pf1MZ6lVw= github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI= github.com/pingcap/sysutil v0.0.0-20210315073920-cc0985d983a3 h1:A9KL9R+lWSVPH8IqUuH1QSTRJ5FGoY1bT2IcfPKsWD8= github.com/pingcap/sysutil v0.0.0-20210315073920-cc0985d983a3/go.mod h1:tckvA041UWP+NqYzrJ3fMgC/Hw9wnmQ/tUkp/JaHly8= -github.com/pingcap/tidb v1.1.0-beta.0.20210508083641-8ed1d9d4a798 h1:ePV3RQgucx8FXwszL7xh0/TNsnSTMt4NPcLhsXM6Cqg= -github.com/pingcap/tidb v1.1.0-beta.0.20210508083641-8ed1d9d4a798/go.mod h1:F8dm93qiGIV73r+WwURsvppaxb6gRk+aj+zd3dXcEFk= +github.com/pingcap/tidb v1.1.0-beta.0.20210619135452-712fb1c55b48 h1:bpgPZdzo/9BR7F84Dp0HBxz8YfrIPxSmB7Kpbjnz0IY= +github.com/pingcap/tidb v1.1.0-beta.0.20210619135452-712fb1c55b48/go.mod h1:pyfNMQ5nci0Z9mis20T/mH/92hoJb8dyuqqP8h14JGM= github.com/pingcap/tidb-dashboard v0.0.0-20210312062513-eef5d6404638/go.mod h1:OzFN8H0EDMMqeulPhPMw2i2JaiZWOKFQ7zdRPhENNgo= github.com/pingcap/tidb-tools v4.0.9-0.20201127090955-2707c97b3853+incompatible h1:ceznmu/lLseGHP/jKyOa/3u/5H3wtLLLqkH2V3ssSjg= github.com/pingcap/tidb-tools v4.0.9-0.20201127090955-2707c97b3853+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM= -github.com/pingcap/tipb v0.0.0-20210422074242-57dd881b81b1 h1:Kcp3jIcQrqG+pT1JQ0oWyRncVKQtDgnMFzRt3zJBaBo= -github.com/pingcap/tipb v0.0.0-20210422074242-57dd881b81b1/go.mod h1:nsEhnMokcn7MRqd2J60yxpn/ac3ZH8A6GOJ9NslabUo= +github.com/pingcap/tipb v0.0.0-20210603161937-cfb5a9225f95 h1:Cj7FhGvYn8hrXDNcaHi0aTl0KdV67KTL+P5gBp3vqT4= +github.com/pingcap/tipb v0.0.0-20210603161937-cfb5a9225f95/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -632,8 +633,9 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E= github.com/swaggo/gin-swagger v1.2.0/go.mod h1:qlH2+W7zXGZkczuL+r2nEBR2JTT+/lX05Nn6vPhc7OI= github.com/swaggo/http-swagger v0.0.0-20200308142732-58ac5e232fba/go.mod h1:O1lAbCgAAX/KZ80LM/OXwtWFI/5TvZlwxSg8Cq08PV0= @@ -648,6 +650,8 @@ github.com/tiancaiamao/appdash v0.0.0-20181126055449-889f96f722a2/go.mod h1:2PfK github.com/tidwall/gjson v1.3.5/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls= github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tikv/client-go/v2 v2.0.0-20210617115813-8d4847a86878 h1:gAg9PiWK0srOvdrJ49tV2AzbTJnarRm/56+xzvGDLUs= +github.com/tikv/client-go/v2 v2.0.0-20210617115813-8d4847a86878/go.mod h1:2ZWVKSfm6BWBY0dgH0h6o+vAzNuXWD/z0ihkMNv3J6E= github.com/tikv/pd v1.1.0-beta.0.20210323121136-78679e5e209d h1:K0XnvsnT6ofLDuM8Rt3PuFQO4p8bNraeHYstspD316g= github.com/tikv/pd v1.1.0-beta.0.20210323121136-78679e5e209d/go.mod h1:Jw9KG11C/23Rr7DW4XWQ7H5xOgGZo6DFL1OKAF4+Igw= github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU= @@ -685,6 +689,8 @@ github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1 h1:d71/KA0LhvkrJ/Ok+Wx9qK7bU8meK github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1/go.mod h1:xlngVLeyQ/Qi05oQxhQ+oTuqa03RjMwMfk/7/TCs+QI= github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/wangjohn/quickselect v0.0.0-20161129230411-ed8402a42d5f h1:9DDCDwOyEy/gId+IEMrFHLuQ5R/WV0KNxWLler8X2OY= +github.com/wangjohn/quickselect v0.0.0-20161129230411-ed8402a42d5f/go.mod h1:8sdOQnirw1PrcnTJYkmW1iOHtUmblMmGdUOHyWYycLI= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= @@ -719,9 +725,10 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/automaxprocs v1.2.0/go.mod h1:YfO3fm683kQpzETxlTGZhGIVmXAhaw3gxeBADbpZtnU= +go.uber.org/atomic v1.8.0 h1:CUhrE4N1rqSE6FM9ecihEjRkLQu8cDfgDyoOs83mEY4= +go.uber.org/atomic v1.8.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= go.uber.org/dig v1.8.0/go.mod h1:X34SnWGr8Fyla9zQNO2GSO2D+TIuqB14OS8JhYocIyw= go.uber.org/fx v1.10.0/go.mod h1:vLRicqpG/qQEzno4SYU86iCwfT95EZza+Eba0ItuxqY= go.uber.org/goleak v0.10.0 h1:G3eWbSNIskeRqtsN/1uI5B+eP73y3JUuBsv9AZjehb4= @@ -730,16 +737,18 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.8.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.12.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= -go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= +go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1048,16 +1057,17 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o= -honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= +honnef.co/go/tools v0.2.0 h1:ws8AfbgTX3oIczLPNPCu5166oBg9ST2vNs0rcht+mDE= +honnef.co/go/tools v0.2.0/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= modernc.org/mathutil v1.2.2 h1:+yFk8hBprV+4c0U9GjFtL+dV3N8hOJ8JCituQcMShFY= modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= diff --git a/pkg/context/context.go b/pkg/context/context.go index a968392f308..86dce0e519e 100644 --- a/pkg/context/context.go +++ b/pkg/context/context.go @@ -24,7 +24,7 @@ import ( "github.com/pingcap/ticdc/cdc/model" "github.com/pingcap/ticdc/pkg/config" tidbkv "github.com/pingcap/tidb/kv" - "github.com/pingcap/tidb/store/tikv/oracle" + "github.com/tikv/client-go/v2/oracle" pd "github.com/tikv/pd/client" "go.uber.org/zap" ) diff --git a/pkg/txnutil/lock_resolver.go b/pkg/txnutil/lock_resolver.go index 76816542827..ba12709c801 100644 --- a/pkg/txnutil/lock_resolver.go +++ b/pkg/txnutil/lock_resolver.go @@ -20,9 +20,9 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/kvproto/pkg/kvrpcpb" "github.com/pingcap/log" - "github.com/pingcap/tidb/store/tikv" - tikverr "github.com/pingcap/tidb/store/tikv/error" - "github.com/pingcap/tidb/store/tikv/tikvrpc" + tikverr "github.com/tikv/client-go/v2/error" + "github.com/tikv/client-go/v2/tikv" + "github.com/tikv/client-go/v2/tikvrpc" "go.uber.org/zap" ) @@ -52,7 +52,7 @@ func (r *resolver) Resolve(ctx context.Context, regionID uint64, maxVersion uint Limit: scanLockLimit, }) - bo := tikv.NewBackoffer(ctx, tikv.GcResolveLockMaxBackoff) + bo := tikv.NewGcResolveLockMaxBackoffer(ctx) var loc *tikv.KeyLocation var key []byte flushRegion := func() error { @@ -83,7 +83,7 @@ func (r *resolver) Resolve(ctx context.Context, regionID uint64, maxVersion uint return errors.Trace(err) } if regionErr != nil { - err = bo.Backoff(tikv.BoRegionMiss, errors.New(regionErr.String())) + err = bo.Backoff(tikv.BoRegionMiss(), errors.New(regionErr.String())) if err != nil { return errors.Trace(err) } @@ -118,7 +118,7 @@ func (r *resolver) Resolve(ctx context.Context, regionID uint64, maxVersion uint if len(key) == 0 || (len(loc.EndKey) != 0 && bytes.Compare(key, loc.EndKey) >= 0) { break } - bo = tikv.NewBackoffer(ctx, tikv.GcResolveLockMaxBackoff) + bo = tikv.NewGcResolveLockMaxBackoffer(ctx) } log.Info("resolve lock successfully", zap.Uint64("regionID", regionID), zap.Uint64("maxVersion", maxVersion)) return nil diff --git a/tests/resolve_lock/main.go b/tests/resolve_lock/main.go index e20e1de156b..567a04ef471 100644 --- a/tests/resolve_lock/main.go +++ b/tests/resolve_lock/main.go @@ -35,10 +35,10 @@ import ( "github.com/pingcap/ticdc/tests/util" "github.com/pingcap/tidb/kv" "github.com/pingcap/tidb/store/driver" - "github.com/pingcap/tidb/store/tikv" - "github.com/pingcap/tidb/store/tikv/oracle" - "github.com/pingcap/tidb/store/tikv/tikvrpc" "github.com/pingcap/tidb/tablecodec" + "github.com/tikv/client-go/v2/oracle" + "github.com/tikv/client-go/v2/tikv" + "github.com/tikv/client-go/v2/tikvrpc" pd "github.com/tikv/pd/client" ) @@ -314,7 +314,7 @@ func (c *Locker) lockBatch(ctx context.Context, keys [][]byte, primary []byte) ( return 0, errors.Trace(err) } if regionErr != nil { - err = bo.Backoff(tikv.BoRegionMiss, errors.New(regionErr.String())) + err = bo.Backoff(tikv.BoRegionMiss(), errors.New(regionErr.String())) if err != nil { return 0, errors.Trace(err) }