From 5a92e3d3dc8fa293304af6a8f511b25aa19188f0 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Thu, 3 Mar 2022 14:36:28 +0800 Subject: [PATCH 01/11] *(both): update dep of etcd, go-mysql and others Signed-off-by: lance6716 --- cdc/api/owner.go | 7 +- cdc/api/owner_test.go | 2 +- cdc/api/status.go | 2 +- cdc/capture/capture.go | 13 +- cdc/processor/agent.go | 7 +- cdc/processor/agent_test.go | 9 +- cdc/redo/writer/file.go | 7 +- cdc/server.go | 19 +- cdc/server_test.go | 11 +- dm/dm/ctl/common/util.go | 2 +- dm/dm/ctl/master/config.go | 2 +- dm/dm/master/config.go | 2 +- dm/dm/master/config_test.go | 2 +- dm/dm/master/etcd.go | 2 +- dm/dm/master/etcd_test.go | 4 +- dm/dm/master/openapi_test.go | 4 +- dm/dm/master/scheduler/scheduler.go | 2 +- dm/dm/master/scheduler/scheduler_test.go | 6 +- dm/dm/master/server.go | 4 +- dm/dm/master/server_test.go | 4 +- dm/dm/master/shardddl/optimist.go | 2 +- dm/dm/master/shardddl/optimist_test.go | 4 +- dm/dm/master/shardddl/pessimist.go | 2 +- dm/dm/master/shardddl/pessimist_test.go | 6 +- dm/dm/worker/server.go | 2 +- dm/dm/worker/server_test.go | 6 +- dm/dm/worker/source_worker.go | 2 +- dm/dm/worker/source_worker_test.go | 2 +- dm/dm/worker/subtask.go | 2 +- dm/dm/worker/subtask_test.go | 2 +- dm/dm/worker/utils.go | 2 +- dm/dm/worker/utils_test.go | 1 - dm/loader/lightning.go | 2 +- dm/loader/loader.go | 2 +- dm/loader/util.go | 2 +- dm/pkg/election/election.go | 6 +- dm/pkg/election/election_test.go | 4 +- dm/pkg/etcdutil/etcdutil.go | 4 +- dm/pkg/etcdutil/etcdutil_test.go | 12 +- dm/pkg/ha/bound.go | 4 +- dm/pkg/ha/keepalive.go | 4 +- dm/pkg/ha/load_task.go | 4 +- dm/pkg/ha/openapi_task_config.go | 4 +- dm/pkg/ha/ops.go | 4 +- dm/pkg/ha/relay.go | 4 +- dm/pkg/ha/source.go | 2 +- dm/pkg/ha/source_test.go | 4 +- dm/pkg/ha/stage.go | 4 +- dm/pkg/ha/subtask.go | 2 +- dm/pkg/ha/task_cli_args.go | 2 +- dm/pkg/ha/worker.go | 2 +- dm/pkg/shardddl/optimism/column.go | 2 +- dm/pkg/shardddl/optimism/info.go | 4 +- dm/pkg/shardddl/optimism/info_test.go | 4 +- dm/pkg/shardddl/optimism/keeper.go | 2 +- dm/pkg/shardddl/optimism/keeper_test.go | 1 - dm/pkg/shardddl/optimism/lock.go | 2 +- dm/pkg/shardddl/optimism/lock_test.go | 1 - dm/pkg/shardddl/optimism/operation.go | 6 +- dm/pkg/shardddl/optimism/ops.go | 2 +- dm/pkg/shardddl/optimism/table.go | 4 +- dm/pkg/shardddl/pessimism/info.go | 6 +- dm/pkg/shardddl/pessimism/info_test.go | 4 +- dm/pkg/shardddl/pessimism/operation.go | 6 +- dm/pkg/shardddl/pessimism/operation_test.go | 4 +- dm/pkg/shardddl/pessimism/ops.go | 2 +- dm/pkg/upgrade/upgrade.go | 2 +- dm/pkg/upgrade/upgrade_test.go | 4 +- dm/pkg/upgrade/version.go | 2 +- dm/syncer/safe_mode_test.go | 6 +- dm/syncer/shardddl/optimist.go | 2 +- dm/syncer/shardddl/pessimist.go | 2 +- dm/syncer/shardddl/pessimist_test.go | 4 +- dm/syncer/syncer.go | 2 +- dm/tests/adjust_gtid/data/db2.increment.sql | 5 +- go.mod | 44 ++--- go.sum | 183 ++++++++++++++----- pkg/cmd/cli/cli_capture_list.go | 5 +- pkg/cmd/factory/factory_impl.go | 13 +- pkg/errorutil/ignore.go | 2 +- pkg/errorutil/ignore_test.go | 2 +- pkg/etcd/client.go | 11 +- pkg/etcd/client_test.go | 4 +- pkg/etcd/etcd.go | 18 +- pkg/etcd/etcd_test.go | 15 +- pkg/etcd/util.go | 2 +- pkg/etcd/util_test.go | 2 +- pkg/orchestrator/etcd_worker.go | 17 +- pkg/orchestrator/etcd_worker_test.go | 11 +- tests/integration_tests/move_table/main.go | 13 +- tests/utils/cdc_state_checker/cdc_monitor.go | 11 +- 91 files changed, 376 insertions(+), 272 deletions(-) diff --git a/cdc/api/owner.go b/cdc/api/owner.go index 9777b0a6098..c11a9cd10df 100644 --- a/cdc/api/owner.go +++ b/cdc/api/owner.go @@ -24,13 +24,14 @@ import ( "github.com/gin-gonic/gin" "github.com/pingcap/errors" "github.com/pingcap/log" + "github.com/tikv/client-go/v2/oracle" + "go.etcd.io/etcd/client/v3/concurrency" + "go.uber.org/zap" + "github.com/pingcap/tiflow/cdc/capture" "github.com/pingcap/tiflow/cdc/model" cerror "github.com/pingcap/tiflow/pkg/errors" "github.com/pingcap/tiflow/pkg/logutil" - "github.com/tikv/client-go/v2/oracle" - "go.etcd.io/etcd/clientv3/concurrency" - "go.uber.org/zap" ) const ( diff --git a/cdc/api/owner_test.go b/cdc/api/owner_test.go index bd09d0ec7cc..6be9226407b 100644 --- a/cdc/api/owner_test.go +++ b/cdc/api/owner_test.go @@ -23,7 +23,7 @@ import ( "github.com/gin-gonic/gin" "github.com/stretchr/testify/require" - "go.etcd.io/etcd/clientv3/concurrency" + "go.etcd.io/etcd/client/v3/concurrency" ) func TestHTTPStatus(t *testing.T) { diff --git a/cdc/api/status.go b/cdc/api/status.go index e71c1528c03..79d9da7537d 100644 --- a/cdc/api/status.go +++ b/cdc/api/status.go @@ -24,7 +24,7 @@ import ( "github.com/pingcap/tiflow/cdc/capture" "github.com/pingcap/tiflow/pkg/etcd" "github.com/pingcap/tiflow/pkg/version" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" ) // status of cdc server diff --git a/cdc/capture/capture.go b/cdc/capture/capture.go index 8154531ed67..535d59e7185 100644 --- a/cdc/capture/capture.go +++ b/cdc/capture/capture.go @@ -25,6 +25,13 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/log" tidbkv "github.com/pingcap/tidb/kv" + "github.com/tikv/client-go/v2/tikv" + pd "github.com/tikv/pd/client" + "go.etcd.io/etcd/client/v3/concurrency" + "go.etcd.io/etcd/server/v3/mvcc" + "go.uber.org/zap" + "golang.org/x/time/rate" + "github.com/pingcap/tiflow/cdc/kv" "github.com/pingcap/tiflow/cdc/model" "github.com/pingcap/tiflow/cdc/owner" @@ -39,12 +46,6 @@ import ( "github.com/pingcap/tiflow/pkg/p2p" "github.com/pingcap/tiflow/pkg/pdtime" "github.com/pingcap/tiflow/pkg/version" - "github.com/tikv/client-go/v2/tikv" - pd "github.com/tikv/pd/client" - "go.etcd.io/etcd/clientv3/concurrency" - "go.etcd.io/etcd/mvcc" - "go.uber.org/zap" - "golang.org/x/time/rate" ) // Capture represents a Capture server, it monitors the changefeed information in etcd and schedules Task on it. diff --git a/cdc/processor/agent.go b/cdc/processor/agent.go index 18d8762c9cb..f6886d50ee4 100644 --- a/cdc/processor/agent.go +++ b/cdc/processor/agent.go @@ -20,6 +20,10 @@ import ( "github.com/benbjohnson/clock" "github.com/pingcap/errors" "github.com/pingcap/log" + "go.etcd.io/etcd/client/v3/concurrency" + "go.uber.org/zap" + "golang.org/x/time/rate" + "github.com/pingcap/tiflow/cdc/model" "github.com/pingcap/tiflow/cdc/scheduler" "github.com/pingcap/tiflow/pkg/config" @@ -28,9 +32,6 @@ import ( "github.com/pingcap/tiflow/pkg/etcd" "github.com/pingcap/tiflow/pkg/p2p" "github.com/pingcap/tiflow/pkg/version" - "go.etcd.io/etcd/clientv3/concurrency" - "go.uber.org/zap" - "golang.org/x/time/rate" ) const ( diff --git a/cdc/processor/agent_test.go b/cdc/processor/agent_test.go index f6ed64d2c17..37aaaaa00d7 100644 --- a/cdc/processor/agent_test.go +++ b/cdc/processor/agent_test.go @@ -19,16 +19,17 @@ import ( "time" "github.com/pingcap/failpoint" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" + "github.com/pingcap/tiflow/cdc/model" pscheduler "github.com/pingcap/tiflow/cdc/scheduler" cdcContext "github.com/pingcap/tiflow/pkg/context" "github.com/pingcap/tiflow/pkg/etcd" "github.com/pingcap/tiflow/pkg/p2p" "github.com/pingcap/tiflow/pkg/version" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/mvcc/mvccpb" ) const ( diff --git a/cdc/redo/writer/file.go b/cdc/redo/writer/file.go index fb4e78953e9..2e263e357a7 100644 --- a/cdc/redo/writer/file.go +++ b/cdc/redo/writer/file.go @@ -29,13 +29,14 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/log" "github.com/pingcap/tidb/br/pkg/storage" - "github.com/pingcap/tiflow/cdc/redo/common" - cerror "github.com/pingcap/tiflow/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/uber-go/atomic" - pioutil "go.etcd.io/etcd/pkg/ioutil" + pioutil "go.etcd.io/etcd/pkg/v3/ioutil" "go.uber.org/multierr" "go.uber.org/zap" + + "github.com/pingcap/tiflow/cdc/redo/common" + cerror "github.com/pingcap/tiflow/pkg/errors" ) const ( diff --git a/cdc/server.go b/cdc/server.go index 185ec75d273..a4a6aaaceb0 100644 --- a/cdc/server.go +++ b/cdc/server.go @@ -28,6 +28,16 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/log" tidbkv "github.com/pingcap/tidb/kv" + "github.com/prometheus/client_golang/prometheus" + pd "github.com/tikv/pd/client" + "go.etcd.io/etcd/client/pkg/v3/logutil" + clientv3 "go.etcd.io/etcd/client/v3" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + "golang.org/x/sync/errgroup" + "google.golang.org/grpc" + "google.golang.org/grpc/backoff" + "github.com/pingcap/tiflow/cdc/capture" "github.com/pingcap/tiflow/cdc/kv" "github.com/pingcap/tiflow/cdc/sorter/unified" @@ -41,15 +51,6 @@ import ( "github.com/pingcap/tiflow/pkg/util" "github.com/pingcap/tiflow/pkg/version" p2pProto "github.com/pingcap/tiflow/proto/p2p" - "github.com/prometheus/client_golang/prometheus" - pd "github.com/tikv/pd/client" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/pkg/logutil" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "golang.org/x/sync/errgroup" - "google.golang.org/grpc" - "google.golang.org/grpc/backoff" ) const ( diff --git a/cdc/server_test.go b/cdc/server_test.go index 784b7f15543..df512965b6d 100644 --- a/cdc/server_test.go +++ b/cdc/server_test.go @@ -29,6 +29,12 @@ import ( "time" "github.com/pingcap/tidb/br/pkg/httputil" + "github.com/stretchr/testify/require" + "github.com/tikv/pd/pkg/tempurl" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/server/v3/embed" + "golang.org/x/sync/errgroup" + "github.com/pingcap/tiflow/cdc/capture" "github.com/pingcap/tiflow/cdc/model" "github.com/pingcap/tiflow/pkg/config" @@ -37,11 +43,6 @@ import ( "github.com/pingcap/tiflow/pkg/retry" security2 "github.com/pingcap/tiflow/pkg/security" "github.com/pingcap/tiflow/pkg/util" - "github.com/stretchr/testify/require" - "github.com/tikv/pd/pkg/tempurl" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/embed" - "golang.org/x/sync/errgroup" ) type testServer struct { diff --git a/dm/dm/ctl/common/util.go b/dm/dm/ctl/common/util.go index b0e37396185..1855bf6e0bc 100644 --- a/dm/dm/ctl/common/util.go +++ b/dm/dm/ctl/common/util.go @@ -32,7 +32,7 @@ import ( toolutils "github.com/pingcap/tidb-tools/pkg/utils" "github.com/pingcap/tidb/parser" "github.com/spf13/cobra" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "google.golang.org/grpc" "google.golang.org/grpc/codes" diff --git a/dm/dm/ctl/master/config.go b/dm/dm/ctl/master/config.go index 122b9ea2c1c..e689b3172f1 100644 --- a/dm/dm/ctl/master/config.go +++ b/dm/dm/ctl/master/config.go @@ -23,7 +23,7 @@ import ( "github.com/pingcap/errors" "github.com/spf13/cobra" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/dm/ctl/common" diff --git a/dm/dm/master/config.go b/dm/dm/master/config.go index 9dbac15a4b2..f1315edba78 100644 --- a/dm/dm/master/config.go +++ b/dm/dm/master/config.go @@ -26,7 +26,7 @@ import ( "time" "github.com/BurntSushi/toml" - "go.etcd.io/etcd/embed" + "go.etcd.io/etcd/server/v3/embed" "go.uber.org/zap" "github.com/pingcap/tiflow/dm/dm/config" diff --git a/dm/dm/master/config_test.go b/dm/dm/master/config_test.go index 7b1f1531e3e..f3378f82d67 100644 --- a/dm/dm/master/config_test.go +++ b/dm/dm/master/config_test.go @@ -23,7 +23,7 @@ import ( capturer "github.com/kami-zh/go-capturer" "github.com/pingcap/check" - "go.etcd.io/etcd/embed" + "go.etcd.io/etcd/server/v3/embed" "github.com/pingcap/tiflow/dm/pkg/log" "github.com/pingcap/tiflow/dm/pkg/terror" diff --git a/dm/dm/master/etcd.go b/dm/dm/master/etcd.go index a10b53af54b..d0b4adfd3ab 100644 --- a/dm/dm/master/etcd.go +++ b/dm/dm/master/etcd.go @@ -22,7 +22,7 @@ import ( "time" toolutils "github.com/pingcap/tidb-tools/pkg/utils" - "go.etcd.io/etcd/embed" + "go.etcd.io/etcd/server/v3/embed" "go.uber.org/zap" "google.golang.org/grpc" diff --git a/dm/dm/master/etcd_test.go b/dm/dm/master/etcd_test.go index 402396e0e40..61697a7b6b0 100644 --- a/dm/dm/master/etcd_test.go +++ b/dm/dm/master/etcd_test.go @@ -24,8 +24,8 @@ import ( "github.com/pingcap/check" "github.com/tikv/pd/pkg/tempurl" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/embed" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/server/v3/embed" "github.com/pingcap/tiflow/dm/pkg/log" "github.com/pingcap/tiflow/dm/pkg/terror" diff --git a/dm/dm/master/openapi_test.go b/dm/dm/master/openapi_test.go index 453fee955c1..b686aac9505 100644 --- a/dm/dm/master/openapi_test.go +++ b/dm/dm/master/openapi_test.go @@ -28,8 +28,8 @@ import ( "github.com/pingcap/check" "github.com/pingcap/failpoint" "github.com/tikv/pd/pkg/tempurl" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/integration" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/checker" "github.com/pingcap/tiflow/dm/dm/config" diff --git a/dm/dm/master/scheduler/scheduler.go b/dm/dm/master/scheduler/scheduler.go index 0eded7196da..ef50cee4603 100644 --- a/dm/dm/master/scheduler/scheduler.go +++ b/dm/dm/master/scheduler/scheduler.go @@ -21,7 +21,7 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/failpoint" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/atomic" "go.uber.org/zap" diff --git a/dm/dm/master/scheduler/scheduler_test.go b/dm/dm/master/scheduler/scheduler_test.go index 63dc17592c0..b6f4f8798a1 100644 --- a/dm/dm/master/scheduler/scheduler_test.go +++ b/dm/dm/master/scheduler/scheduler_test.go @@ -22,9 +22,9 @@ import ( . "github.com/pingcap/check" "github.com/pingcap/failpoint" - "go.etcd.io/etcd/clientv3" - v3rpc "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" - "go.etcd.io/etcd/integration" + v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/dm/master/workerrpc" diff --git a/dm/dm/master/server.go b/dm/dm/master/server.go index 278270e0601..9a9c2b47c88 100644 --- a/dm/dm/master/server.go +++ b/dm/dm/master/server.go @@ -32,8 +32,8 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb-tools/pkg/dbutil" toolutils "github.com/pingcap/tidb-tools/pkg/utils" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/embed" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/server/v3/embed" "go.uber.org/atomic" "go.uber.org/zap" "google.golang.org/grpc" diff --git a/dm/dm/master/server_test.go b/dm/dm/master/server_test.go index 19d7be46ebd..855e01e44fe 100644 --- a/dm/dm/master/server_test.go +++ b/dm/dm/master/server_test.go @@ -40,8 +40,8 @@ import ( "github.com/pingcap/tidb/sessionctx" tidbmock "github.com/pingcap/tidb/util/mock" "github.com/tikv/pd/pkg/tempurl" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/integration" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/tests/v3/integration" "google.golang.org/grpc" "github.com/pingcap/tiflow/dm/checker" diff --git a/dm/dm/master/shardddl/optimist.go b/dm/dm/master/shardddl/optimist.go index 58a899b4c05..d3d182bcd29 100644 --- a/dm/dm/master/shardddl/optimist.go +++ b/dm/dm/master/shardddl/optimist.go @@ -22,7 +22,7 @@ import ( "github.com/pingcap/failpoint" "github.com/pingcap/tidb-tools/pkg/dbutil" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/pingcap/tiflow/dm/dm/common" diff --git a/dm/dm/master/shardddl/optimist_test.go b/dm/dm/master/shardddl/optimist_test.go index b3e6c84e13e..8296f0798bb 100644 --- a/dm/dm/master/shardddl/optimist_test.go +++ b/dm/dm/master/shardddl/optimist_test.go @@ -26,8 +26,8 @@ import ( "github.com/pingcap/tidb/parser/model" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/mock" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/integration" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/dm/pb" diff --git a/dm/dm/master/shardddl/pessimist.go b/dm/dm/master/shardddl/pessimist.go index 61f58a566ed..19dbedeccd7 100644 --- a/dm/dm/master/shardddl/pessimist.go +++ b/dm/dm/master/shardddl/pessimist.go @@ -19,7 +19,7 @@ import ( "sync" "time" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/pingcap/failpoint" diff --git a/dm/dm/master/shardddl/pessimist_test.go b/dm/dm/master/shardddl/pessimist_test.go index b2daee93b4c..b7688e155a7 100644 --- a/dm/dm/master/shardddl/pessimist_test.go +++ b/dm/dm/master/shardddl/pessimist_test.go @@ -21,9 +21,9 @@ import ( "time" . "github.com/pingcap/check" - "go.etcd.io/etcd/clientv3" - v3rpc "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" - "go.etcd.io/etcd/integration" + v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/dm/config" diff --git a/dm/dm/worker/server.go b/dm/dm/worker/server.go index 6cfcbd481bc..532fd7825f2 100644 --- a/dm/dm/worker/server.go +++ b/dm/dm/worker/server.go @@ -36,7 +36,7 @@ import ( "github.com/pingcap/errors" toolutils "github.com/pingcap/tidb-tools/pkg/utils" "github.com/soheilhy/cmux" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/atomic" "go.uber.org/zap" "google.golang.org/grpc" diff --git a/dm/dm/worker/server_test.go b/dm/dm/worker/server_test.go index 984240f3846..7f7af93a1a9 100644 --- a/dm/dm/worker/server_test.go +++ b/dm/dm/worker/server_test.go @@ -26,9 +26,9 @@ import ( . "github.com/pingcap/check" "github.com/pingcap/failpoint" "github.com/tikv/pd/pkg/tempurl" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/embed" - v3rpc "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" + v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/server/v3/embed" "google.golang.org/grpc" "github.com/pingcap/tiflow/dm/dm/config" diff --git a/dm/dm/worker/source_worker.go b/dm/dm/worker/source_worker.go index 487d5361bcc..86e87fc1225 100644 --- a/dm/dm/worker/source_worker.go +++ b/dm/dm/worker/source_worker.go @@ -24,7 +24,7 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/failpoint" bf "github.com/pingcap/tidb-tools/pkg/binlog-filter" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/atomic" "go.uber.org/zap" diff --git a/dm/dm/worker/source_worker_test.go b/dm/dm/worker/source_worker_test.go index a9ec7be9691..bc5dc21659c 100644 --- a/dm/dm/worker/source_worker_test.go +++ b/dm/dm/worker/source_worker_test.go @@ -24,7 +24,7 @@ import ( . "github.com/pingcap/check" "github.com/pingcap/failpoint" "github.com/tikv/pd/pkg/tempurl" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/dm/pb" diff --git a/dm/dm/worker/subtask.go b/dm/dm/worker/subtask.go index 772723ff3f9..b7a5d2eb841 100644 --- a/dm/dm/worker/subtask.go +++ b/dm/dm/worker/subtask.go @@ -22,7 +22,7 @@ import ( "github.com/go-mysql-org/go-mysql/mysql" "github.com/pingcap/failpoint" "github.com/prometheus/client_golang/prometheus" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/atomic" "go.uber.org/zap" diff --git a/dm/dm/worker/subtask_test.go b/dm/dm/worker/subtask_test.go index 8fd1b6eb166..47ea2a7b4d7 100644 --- a/dm/dm/worker/subtask_test.go +++ b/dm/dm/worker/subtask_test.go @@ -30,7 +30,7 @@ import ( . "github.com/pingcap/check" "github.com/pingcap/errors" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" ) const ( diff --git a/dm/dm/worker/utils.go b/dm/dm/worker/utils.go index 0b4aad256b8..9d569d3e56e 100644 --- a/dm/dm/worker/utils.go +++ b/dm/dm/worker/utils.go @@ -14,7 +14,7 @@ package worker import ( - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/dm/pb" diff --git a/dm/dm/worker/utils_test.go b/dm/dm/worker/utils_test.go index 0a63f9eb3ff..1f1be9d017b 100644 --- a/dm/dm/worker/utils_test.go +++ b/dm/dm/worker/utils_test.go @@ -17,7 +17,6 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.etcd.io/etcd/integration" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/dm/pb" diff --git a/dm/loader/lightning.go b/dm/loader/lightning.go index 94aba624773..98eb68cd49e 100644 --- a/dm/loader/lightning.go +++ b/dm/loader/lightning.go @@ -24,7 +24,7 @@ import ( "github.com/pingcap/tidb/br/pkg/lightning" "github.com/pingcap/tidb/br/pkg/lightning/checkpoints" lcfg "github.com/pingcap/tidb/br/pkg/lightning/config" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/atomic" "go.uber.org/zap" diff --git a/dm/loader/loader.go b/dm/loader/loader.go index 4761f1b22cd..3a66c268e09 100644 --- a/dm/loader/loader.go +++ b/dm/loader/loader.go @@ -25,7 +25,7 @@ import ( "sync" "time" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "golang.org/x/sync/errgroup" "github.com/pingcap/tiflow/dm/dm/config" diff --git a/dm/loader/util.go b/dm/loader/util.go index f132a2fab0a..db7d4669328 100644 --- a/dm/loader/util.go +++ b/dm/loader/util.go @@ -22,7 +22,7 @@ import ( "path/filepath" "strings" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/pingcap/failpoint" diff --git a/dm/pkg/election/election.go b/dm/pkg/election/election.go index 6fd924deb49..7e610ecf1ff 100644 --- a/dm/pkg/election/election.go +++ b/dm/pkg/election/election.go @@ -23,9 +23,9 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/failpoint" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/clientv3/concurrency" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/client/v3/concurrency" "go.uber.org/atomic" "go.uber.org/zap" diff --git a/dm/pkg/election/election_test.go b/dm/pkg/election/election_test.go index bac257439b6..22bd325962a 100644 --- a/dm/pkg/election/election_test.go +++ b/dm/pkg/election/election_test.go @@ -24,8 +24,8 @@ import ( . "github.com/pingcap/check" "github.com/pingcap/failpoint" "github.com/tikv/pd/pkg/tempurl" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/embed" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/server/v3/embed" "github.com/pingcap/tiflow/dm/pkg/etcdutil" "github.com/pingcap/tiflow/dm/pkg/log" diff --git a/dm/pkg/etcdutil/etcdutil.go b/dm/pkg/etcdutil/etcdutil.go index f90b329e391..8ebc4e4a584 100644 --- a/dm/pkg/etcdutil/etcdutil.go +++ b/dm/pkg/etcdutil/etcdutil.go @@ -22,8 +22,8 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/failpoint" - "go.etcd.io/etcd/clientv3" - v3rpc "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" + v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" tcontext "github.com/pingcap/tiflow/dm/pkg/context" diff --git a/dm/pkg/etcdutil/etcdutil_test.go b/dm/pkg/etcdutil/etcdutil_test.go index 5d2357c9a53..f840244454b 100644 --- a/dm/pkg/etcdutil/etcdutil_test.go +++ b/dm/pkg/etcdutil/etcdutil_test.go @@ -24,12 +24,12 @@ import ( "github.com/pingcap/failpoint" "github.com/stretchr/testify/require" "github.com/tikv/pd/pkg/tempurl" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/clientv3/clientv3util" - "go.etcd.io/etcd/embed" - v3rpc "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" - "go.etcd.io/etcd/etcdserver/etcdserverpb" - "go.etcd.io/etcd/integration" + "go.etcd.io/etcd/api/v3/etcdserverpb" + v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/client/v3/clientv3util" + "go.etcd.io/etcd/server/v3/embed" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/pkg/log" "github.com/pingcap/tiflow/dm/pkg/terror" diff --git a/dm/pkg/ha/bound.go b/dm/pkg/ha/bound.go index 1a6da3bd7af..11dce257773 100644 --- a/dm/pkg/ha/bound.go +++ b/dm/pkg/ha/bound.go @@ -19,8 +19,8 @@ import ( "time" "github.com/pingcap/failpoint" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/pingcap/tiflow/dm/dm/common" diff --git a/dm/pkg/ha/keepalive.go b/dm/pkg/ha/keepalive.go index ada13ba86da..6eb5eea4905 100644 --- a/dm/pkg/ha/keepalive.go +++ b/dm/pkg/ha/keepalive.go @@ -19,8 +19,8 @@ import ( "sync/atomic" "time" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/pingcap/tiflow/dm/dm/common" diff --git a/dm/pkg/ha/load_task.go b/dm/pkg/ha/load_task.go index 4d019600470..c26a5d22648 100644 --- a/dm/pkg/ha/load_task.go +++ b/dm/pkg/ha/load_task.go @@ -18,8 +18,8 @@ import ( "encoding/json" "fmt" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/ha/openapi_task_config.go b/dm/pkg/ha/openapi_task_config.go index 009dc2304e3..8bb9f3721e4 100644 --- a/dm/pkg/ha/openapi_task_config.go +++ b/dm/pkg/ha/openapi_task_config.go @@ -16,8 +16,8 @@ package ha import ( "context" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/clientv3/clientv3util" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/client/v3/clientv3util" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/openapi" diff --git a/dm/pkg/ha/ops.go b/dm/pkg/ha/ops.go index b6e2d2eb519..bb826fa597c 100644 --- a/dm/pkg/ha/ops.go +++ b/dm/pkg/ha/ops.go @@ -14,8 +14,8 @@ package ha import ( - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/ha/relay.go b/dm/pkg/ha/relay.go index 3b9bd029a60..0de8bd583a3 100644 --- a/dm/pkg/ha/relay.go +++ b/dm/pkg/ha/relay.go @@ -17,8 +17,8 @@ import ( "context" "time" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/pingcap/tiflow/dm/dm/common" diff --git a/dm/pkg/ha/source.go b/dm/pkg/ha/source.go index 0901362c2c5..a96b6811d21 100644 --- a/dm/pkg/ha/source.go +++ b/dm/pkg/ha/source.go @@ -17,7 +17,7 @@ import ( "context" "github.com/pingcap/failpoint" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/dm/config" diff --git a/dm/pkg/ha/source_test.go b/dm/pkg/ha/source_test.go index 2dfd3120b21..baede8daf88 100644 --- a/dm/pkg/ha/source_test.go +++ b/dm/pkg/ha/source_test.go @@ -22,8 +22,8 @@ import ( "testing" . "github.com/pingcap/check" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/integration" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/config" ) diff --git a/dm/pkg/ha/stage.go b/dm/pkg/ha/stage.go index 0cee6ce77ce..b56b806a304 100644 --- a/dm/pkg/ha/stage.go +++ b/dm/pkg/ha/stage.go @@ -17,8 +17,8 @@ import ( "context" "encoding/json" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/pingcap/tiflow/dm/dm/common" diff --git a/dm/pkg/ha/subtask.go b/dm/pkg/ha/subtask.go index 80b3bdfd60e..1ca6b1b2194 100644 --- a/dm/pkg/ha/subtask.go +++ b/dm/pkg/ha/subtask.go @@ -16,7 +16,7 @@ package ha import ( "context" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/dm/config" diff --git a/dm/pkg/ha/task_cli_args.go b/dm/pkg/ha/task_cli_args.go index 70f51e06484..2e3e0cf4d72 100644 --- a/dm/pkg/ha/task_cli_args.go +++ b/dm/pkg/ha/task_cli_args.go @@ -16,7 +16,7 @@ package ha import ( "context" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/dm/config" diff --git a/dm/pkg/ha/worker.go b/dm/pkg/ha/worker.go index e28f7663f19..52b89e57498 100644 --- a/dm/pkg/ha/worker.go +++ b/dm/pkg/ha/worker.go @@ -17,7 +17,7 @@ import ( "context" "encoding/json" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/shardddl/optimism/column.go b/dm/pkg/shardddl/optimism/column.go index bddf728b841..a9c26f443d0 100644 --- a/dm/pkg/shardddl/optimism/column.go +++ b/dm/pkg/shardddl/optimism/column.go @@ -16,7 +16,7 @@ package optimism import ( "encoding/json" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/shardddl/optimism/info.go b/dm/pkg/shardddl/optimism/info.go index bdb43c067ce..143b591b200 100644 --- a/dm/pkg/shardddl/optimism/info.go +++ b/dm/pkg/shardddl/optimism/info.go @@ -20,8 +20,8 @@ import ( "github.com/pingcap/tidb-tools/pkg/schemacmp" "github.com/pingcap/tidb/parser/model" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/shardddl/optimism/info_test.go b/dm/pkg/shardddl/optimism/info_test.go index 44a35c1c41d..ef942dd2ed7 100644 --- a/dm/pkg/shardddl/optimism/info_test.go +++ b/dm/pkg/shardddl/optimism/info_test.go @@ -27,8 +27,8 @@ import ( "github.com/pingcap/tidb/parser/model" "github.com/pingcap/tidb/sessionctx" "github.com/pingcap/tidb/util/mock" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/integration" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/shardddl/optimism/keeper.go b/dm/pkg/shardddl/optimism/keeper.go index f1f0d3dc57c..d796a1bdcb5 100644 --- a/dm/pkg/shardddl/optimism/keeper.go +++ b/dm/pkg/shardddl/optimism/keeper.go @@ -18,7 +18,7 @@ import ( "sync" "github.com/pingcap/tidb-tools/pkg/schemacmp" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/pkg/log" diff --git a/dm/pkg/shardddl/optimism/keeper_test.go b/dm/pkg/shardddl/optimism/keeper_test.go index 5aefe4173c2..14302f911f0 100644 --- a/dm/pkg/shardddl/optimism/keeper_test.go +++ b/dm/pkg/shardddl/optimism/keeper_test.go @@ -20,7 +20,6 @@ import ( "github.com/pingcap/tidb/parser" "github.com/pingcap/tidb/parser/model" "github.com/pingcap/tidb/util/mock" - "go.etcd.io/etcd/integration" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/pkg/conn" diff --git a/dm/pkg/shardddl/optimism/lock.go b/dm/pkg/shardddl/optimism/lock.go index d1b207a9f48..93245e5d1b6 100644 --- a/dm/pkg/shardddl/optimism/lock.go +++ b/dm/pkg/shardddl/optimism/lock.go @@ -24,7 +24,7 @@ import ( "github.com/pingcap/tidb/parser" "github.com/pingcap/tidb/parser/ast" "github.com/pingcap/tidb/parser/model" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "golang.org/x/net/context" diff --git a/dm/pkg/shardddl/optimism/lock_test.go b/dm/pkg/shardddl/optimism/lock_test.go index 5960b139491..defe2ea96b1 100644 --- a/dm/pkg/shardddl/optimism/lock_test.go +++ b/dm/pkg/shardddl/optimism/lock_test.go @@ -25,7 +25,6 @@ import ( "github.com/pingcap/tidb/parser/ast" "github.com/pingcap/tidb/parser/model" "github.com/pingcap/tidb/util/mock" - "go.etcd.io/etcd/integration" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/pkg/conn" diff --git a/dm/pkg/shardddl/optimism/operation.go b/dm/pkg/shardddl/optimism/operation.go index 99dcd7dda52..efec47b33dd 100644 --- a/dm/pkg/shardddl/optimism/operation.go +++ b/dm/pkg/shardddl/optimism/operation.go @@ -17,9 +17,9 @@ import ( "context" "encoding/json" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/clientv3/clientv3util" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/client/v3/clientv3util" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/shardddl/optimism/ops.go b/dm/pkg/shardddl/optimism/ops.go index 28c92f3e495..d6322542fd8 100644 --- a/dm/pkg/shardddl/optimism/ops.go +++ b/dm/pkg/shardddl/optimism/ops.go @@ -14,7 +14,7 @@ package optimism import ( - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/shardddl/optimism/table.go b/dm/pkg/shardddl/optimism/table.go index 0951720fd77..c729c324ab1 100644 --- a/dm/pkg/shardddl/optimism/table.go +++ b/dm/pkg/shardddl/optimism/table.go @@ -18,8 +18,8 @@ import ( "encoding/json" "fmt" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/shardddl/pessimism/info.go b/dm/pkg/shardddl/pessimism/info.go index 066ab514500..4aa614d801e 100644 --- a/dm/pkg/shardddl/pessimism/info.go +++ b/dm/pkg/shardddl/pessimism/info.go @@ -17,9 +17,9 @@ import ( "context" "encoding/json" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/clientv3/clientv3util" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/client/v3/clientv3util" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/shardddl/pessimism/info_test.go b/dm/pkg/shardddl/pessimism/info_test.go index 43427197d3e..cb21a3b1b73 100644 --- a/dm/pkg/shardddl/pessimism/info_test.go +++ b/dm/pkg/shardddl/pessimism/info_test.go @@ -22,8 +22,8 @@ import ( . "github.com/pingcap/check" "github.com/pingcap/tidb-tools/pkg/dbutil" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/integration" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/utils" diff --git a/dm/pkg/shardddl/pessimism/operation.go b/dm/pkg/shardddl/pessimism/operation.go index 7a7fc786c7d..05184e8945b 100644 --- a/dm/pkg/shardddl/pessimism/operation.go +++ b/dm/pkg/shardddl/pessimism/operation.go @@ -17,9 +17,9 @@ import ( "context" "encoding/json" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/clientv3/clientv3util" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/client/v3/clientv3util" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/shardddl/pessimism/operation_test.go b/dm/pkg/shardddl/pessimism/operation_test.go index 74e86ab5102..b8c48f92cbd 100644 --- a/dm/pkg/shardddl/pessimism/operation_test.go +++ b/dm/pkg/shardddl/pessimism/operation_test.go @@ -19,8 +19,8 @@ import ( "time" . "github.com/pingcap/check" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/mvccpb" + clientv3 "go.etcd.io/etcd/client/v3" ) func (t *testForEtcd) TestOperationJSON(c *C) { diff --git a/dm/pkg/shardddl/pessimism/ops.go b/dm/pkg/shardddl/pessimism/ops.go index 643afb06df5..0b45a3d085c 100644 --- a/dm/pkg/shardddl/pessimism/ops.go +++ b/dm/pkg/shardddl/pessimism/ops.go @@ -16,7 +16,7 @@ package pessimism import ( "context" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/pkg/upgrade/upgrade.go b/dm/pkg/upgrade/upgrade.go index 79fe79aa2e8..a8de0f30914 100644 --- a/dm/pkg/upgrade/upgrade.go +++ b/dm/pkg/upgrade/upgrade.go @@ -19,7 +19,7 @@ import ( "time" "github.com/pingcap/tidb-tools/pkg/dbutil" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/pingcap/tiflow/dm/dm/common" diff --git a/dm/pkg/upgrade/upgrade_test.go b/dm/pkg/upgrade/upgrade_test.go index 0504ccd79b5..7e0410a7a95 100644 --- a/dm/pkg/upgrade/upgrade_test.go +++ b/dm/pkg/upgrade/upgrade_test.go @@ -19,8 +19,8 @@ import ( "testing" . "github.com/pingcap/check" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/integration" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/common" ) diff --git a/dm/pkg/upgrade/version.go b/dm/pkg/upgrade/version.go index 6d6d6f249a8..1c941d229e4 100644 --- a/dm/pkg/upgrade/version.go +++ b/dm/pkg/upgrade/version.go @@ -16,7 +16,7 @@ package upgrade import ( "encoding/json" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/etcdutil" diff --git a/dm/syncer/safe_mode_test.go b/dm/syncer/safe_mode_test.go index ed677525b6b..ee121ff481e 100644 --- a/dm/syncer/safe_mode_test.go +++ b/dm/syncer/safe_mode_test.go @@ -17,14 +17,14 @@ import ( "time" "github.com/go-mysql-org/go-mysql/mysql" + "github.com/stretchr/testify/require" + "go.uber.org/zap" + "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/pkg/binlog" tcontext "github.com/pingcap/tiflow/dm/pkg/context" "github.com/pingcap/tiflow/dm/pkg/log" mode "github.com/pingcap/tiflow/dm/syncer/safe-mode" - "github.com/stretchr/testify/require" - "go.etcd.io/etcd/integration" - "go.uber.org/zap" ) type mockCheckpointForSafeMode struct { diff --git a/dm/syncer/shardddl/optimist.go b/dm/syncer/shardddl/optimist.go index 4b076e96008..f940e28cf7c 100644 --- a/dm/syncer/shardddl/optimist.go +++ b/dm/syncer/shardddl/optimist.go @@ -19,7 +19,7 @@ import ( filter "github.com/pingcap/tidb-tools/pkg/table-filter" "github.com/pingcap/tidb/parser/model" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/pingcap/tiflow/dm/pkg/log" diff --git a/dm/syncer/shardddl/pessimist.go b/dm/syncer/shardddl/pessimist.go index 4b7d104b68c..bdc31d720f7 100644 --- a/dm/syncer/shardddl/pessimist.go +++ b/dm/syncer/shardddl/pessimist.go @@ -17,7 +17,7 @@ import ( "context" "sync" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "github.com/pingcap/tiflow/dm/pkg/log" diff --git a/dm/syncer/shardddl/pessimist_test.go b/dm/syncer/shardddl/pessimist_test.go index a36450f8aa7..533524d3215 100644 --- a/dm/syncer/shardddl/pessimist_test.go +++ b/dm/syncer/shardddl/pessimist_test.go @@ -19,8 +19,8 @@ import ( "time" . "github.com/pingcap/check" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/integration" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/common" "github.com/pingcap/tiflow/dm/pkg/log" diff --git a/dm/syncer/syncer.go b/dm/syncer/syncer.go index 599ad4ee588..6b35a30e2f5 100644 --- a/dm/syncer/syncer.go +++ b/dm/syncer/syncer.go @@ -38,7 +38,7 @@ import ( "github.com/pingcap/tidb/parser/format" "github.com/pingcap/tidb/parser/model" "github.com/pingcap/tidb/sessionctx" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/atomic" "go.uber.org/zap" diff --git a/dm/tests/adjust_gtid/data/db2.increment.sql b/dm/tests/adjust_gtid/data/db2.increment.sql index 9be41c3a531..bfb3d4f05a4 100644 --- a/dm/tests/adjust_gtid/data/db2.increment.sql +++ b/dm/tests/adjust_gtid/data/db2.increment.sql @@ -2,4 +2,7 @@ use adjust_gtid; delete from t2 where name = 'Sansa'; -- test sql_mode=NO_AUTO_VALUE_ON_ZERO -insert into t2 (id, name) values (0,'haha') \ No newline at end of file +insert into t2 (id, name) values (0,'haha'); + +create table t3(c int primary key, t time(2)); +insert into t3 values(1, '-00:00:00.01'); diff --git a/go.mod b/go.mod index 58a4fcab58a..418a079cc91 100644 --- a/go.mod +++ b/go.mod @@ -25,18 +25,18 @@ require ( github.com/frankban/quicktest v1.11.1 // indirect github.com/getkin/kin-openapi v0.80.0 github.com/gin-gonic/gin v1.7.4 - github.com/go-mysql-org/go-mysql v1.4.1-0.20211217061939-06f932768788 + github.com/go-mysql-org/go-mysql v1.4.1-0.20220221114137-89145541e0d4 github.com/go-sql-driver/mysql v1.6.0 github.com/gogo/gateway v1.1.0 github.com/gogo/protobuf v1.3.2 github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.2 - github.com/google/btree v1.0.0 + github.com/google/btree v1.0.1 github.com/google/go-cmp v0.5.6 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/google/uuid v1.1.2 - github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/integralist/go-findroot v0.0.0-20160518114804-ac90681525dc @@ -53,12 +53,12 @@ require ( github.com/pingcap/check v0.0.0-20211026125417-57bd13f7b5f0 github.com/pingcap/errors v0.11.5-0.20211224045212-9687c2b0f87c github.com/pingcap/failpoint v0.0.0-20210918120811-547c13e3eb00 - github.com/pingcap/kvproto v0.0.0-20211224055123-d1a140660c39 - github.com/pingcap/log v0.0.0-20211207084639-71a2e5860834 - github.com/pingcap/tidb v1.1.0-beta.0.20220210065735-92f5a6340ca2 - github.com/pingcap/tidb-tools v5.2.3-0.20211105044302-2dabb6641a6e+incompatible - github.com/pingcap/tidb/parser v0.0.0-20220210065735-92f5a6340ca2 - github.com/prometheus/client_golang v1.7.1 + github.com/pingcap/kvproto v0.0.0-20220303025110-d5eb908517b2 + github.com/pingcap/log v0.0.0-20211215031037-e024ba4eb0ee + github.com/pingcap/tidb v1.1.0-beta.0.20220303050146-f5a52909b6af + github.com/pingcap/tidb-tools v5.4.1-0.20220302060346-b6d9cbe5dff1+incompatible + github.com/pingcap/tidb/parser v0.0.0-20220303050146-f5a52909b6af + github.com/prometheus/client_golang v1.11.0 github.com/prometheus/client_model v0.2.0 github.com/r3labs/diff v1.1.0 github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 @@ -73,35 +73,35 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 github.com/tidwall/gjson v1.9.1 github.com/tidwall/sjson v1.2.2 - github.com/tikv/client-go/v2 v2.0.0-rc.0.20220107040026-d22815099720 - github.com/tikv/pd v1.1.0-beta.0.20220207063535-9268bed87199 + github.com/tikv/client-go/v2 v2.0.0-rc.0.20220217140116-589cf79b2ab5 + github.com/tikv/pd v1.1.0-beta.0.20220303060546-3695d8164800 + github.com/tikv/pd/client v0.0.0-20220216080339-1b8f82378ee7 github.com/tinylib/msgp v1.1.0 github.com/uber-go/atomic v1.4.0 github.com/vmihailenco/msgpack/v5 v5.3.5 github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c github.com/xitongsys/parquet-go v1.6.0 // indirect - go.etcd.io/etcd v0.5.0-alpha.5.0.20210512015243-d19fbe541bf9 + go.etcd.io/etcd/api/v3 v3.5.2 + go.etcd.io/etcd/client/pkg/v3 v3.5.2 + go.etcd.io/etcd/client/v3 v3.5.2 + go.etcd.io/etcd/pkg/v3 v3.5.2 + go.etcd.io/etcd/server/v3 v3.5.2 + go.etcd.io/etcd/tests/v3 v3.5.2 go.uber.org/atomic v1.9.0 go.uber.org/goleak v1.1.12 go.uber.org/multierr v1.7.0 - go.uber.org/zap v1.19.1 + go.uber.org/zap v1.20.0 golang.org/x/net v0.0.0-20211020060615-d418f374d309 golang.org/x/sync v0.0.0-20210220032951-036812b2e83c golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e golang.org/x/text v0.3.7 golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba google.golang.org/genproto v0.0.0-20210825212027-de86158e7fda - google.golang.org/grpc v1.40.0 + google.golang.org/grpc v1.43.0 gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect gopkg.in/yaml.v2 v2.4.0 - sigs.k8s.io/yaml v1.2.0 // indirect upper.io/db.v3 v3.7.1+incompatible ) -replace ( - // Fix CVE-2020-26160. - github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt/jwt v3.2.1+incompatible - // cloud.google.com/go/storage will upgrade grpc to v1.40.0 - // we need keep the replacement until go.etcd.io supports the higher version of grpc. - google.golang.org/grpc v1.40.0 => google.golang.org/grpc v1.29.1 -) +// Fix CVE-2020-26160. +replace github.com/dgrijalva/jwt-go v3.2.0+incompatible => github.com/golang-jwt/jwt v3.2.1+incompatible diff --git a/go.sum b/go.sum index ee42888fbda..3908a3a6936 100644 --- a/go.sum +++ b/go.sum @@ -104,6 +104,7 @@ github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuy github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alvaroloes/enumer v1.1.2/go.mod h1:FxrjvuXoDAx9isTJrv4c+T410zFi0DtXIT0m65DJ+Wo= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -131,6 +132,7 @@ github.com/aws/aws-sdk-go v1.35.3/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+ github.com/axw/gocov v1.0.0/go.mod h1:LvQpEYiwwIb2nYkXY2fDWhg9/AsYqkhmrCshjlUJECE= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6/go.mod h1:6YNgTHLutezwnBvyneBbwvB8C82y3dcoOj5EQJIdGXA= +github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -138,6 +140,7 @@ github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+Ce github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blacktear23/go-proxyprotocol v0.0.0-20180807104634-af7a81e8dd0d h1:rQlvB2AYWme2bIB18r/SipGiMEVJYE9U0z+MGoU/LtQ= github.com/blacktear23/go-proxyprotocol v0.0.0-20180807104634-af7a81e8dd0d/go.mod h1:VKt7CNAQxpFpSDz3sXyj9hY/GbVsQCr0sB3w59nE7lU= @@ -153,6 +156,8 @@ github.com/carlmjohnson/flagext v0.21.0/go.mod h1:Eenv0epIUAr4NuedNmkzI8WmBmjIxZ github.com/cenkalti/backoff/v4 v4.0.2 h1:JIufpQLbh4DkbQoii76ItQIUFzevQSqOLZca4eamEDs= github.com/cenkalti/backoff/v4 v4.0.2/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= +github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= @@ -173,11 +178,17 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/datadriven v1.0.0 h1:uhZrAfEayBecH2w2tZmhe20HJ7hDvrrA4x2Bg9YdZKM= github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4= +github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM= github.com/cockroachdb/errors v1.8.1 h1:A5+txlVZfOqFBDa4mGz2bUWSp0aHElvHX2bKkdbQu+Y= github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= @@ -201,6 +212,7 @@ github.com/coocood/rtutil v0.0.0-20190304133409-c84515f646f2 h1:NnLfQ77q0G4k2Of2 github.com/coocood/rtutil v0.0.0-20190304133409-c84515f646f2/go.mod h1:7qG7YFnOALvsx6tKTNmQot8d7cGFXM9TidzvRFLWYwM= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= @@ -209,9 +221,9 @@ github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7 github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/corona10/goimagehash v1.0.2/go.mod h1:/l9umBhvcHQXVtQO1V6Gp1yD20STawkhRnnX0D1bvVI= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -273,7 +285,6 @@ github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/edwingeng/deque v0.0.0-20191220032131-8596380dee17 h1:8i9x3Q4hW1kLE4ScsOtUlwVHT76LKhkmOw9zbDxnyUc= github.com/edwingeng/deque v0.0.0-20191220032131-8596380dee17/go.mod h1:3Ys1pJhyVaB6iWigv4o2r6Ug1GZmfDWqvqmO6bjojg0= -github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= @@ -282,9 +293,11 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= +github.com/etcd-io/gofail v0.0.0-20190801230047-ad7f989257ca/go.mod h1:49H/RkXP8pKaZy4h0d+NW16rSLhyVBt4o6VLJbmOqDE= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= @@ -299,6 +312,8 @@ github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= +github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/form3tech-oss/jwt-go v3.2.5+incompatible h1:/l4kBbb4/vGSsdtB5nUe8L7B9mImVMaBPw9L/0TBHU8= github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= @@ -316,6 +331,7 @@ github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo github.com/gdamore/tcell v1.3.0/go.mod h1:Hjvr+Ofd+gLglo7RYKxxnzCBmev3BzsS67MebKS4zMM= github.com/getkin/kin-openapi v0.80.0 h1:W/s5/DNnDCR8P+pYyafEWlGk4S7/AfQUWXgrRSSAzf8= github.com/getkin/kin-openapi v0.80.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg= +github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -342,12 +358,14 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= -github.com/go-mysql-org/go-mysql v1.4.1-0.20211217061939-06f932768788 h1:0IsP4ViNmA7ZElbCE4/lINdTppdw3jdcAiJaPDyeHx8= -github.com/go-mysql-org/go-mysql v1.4.1-0.20211217061939-06f932768788/go.mod h1:3lFZKf7l95Qo70+3XB2WpiSf9wu2s3na3geLMaIIrqQ= +github.com/go-mysql-org/go-mysql v1.4.1-0.20220221114137-89145541e0d4 h1:6AopLIKxyLXWY8PRxIq0q33BedlkNNcJfgJSBZh6Bks= +github.com/go-mysql-org/go-mysql v1.4.1-0.20220221114137-89145541e0d4/go.mod h1:TRs381neMzw+J5+bobjUY2ZsIMgvp4wBCRBW274gc68= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= @@ -390,6 +408,7 @@ github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LB github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= @@ -423,8 +442,9 @@ github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4er github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= @@ -463,8 +483,9 @@ github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golangci/lint-1 v0.0.0-20181222135242-d2cdd8c08219/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= +github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -498,6 +519,7 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -529,8 +551,9 @@ github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0U github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= @@ -580,7 +603,6 @@ github.com/improbable-eng/grpc-web v0.12.0 h1:GlCS+lMZzIkfouf7CNqY+qqpowdKuJLSLL github.com/improbable-eng/grpc-web v0.12.0/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6OL4eEvELdran/3cs= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/influxdata/tdigest v0.0.1/go.mod h1:Z0kXnxzbTC2qrx4NaIzYkE1k66+6oEDQTvL95hQFh5Y= github.com/integralist/go-findroot v0.0.0-20160518114804-ac90681525dc h1:4IZpk3M4m6ypx0IlRoEyEyY1gAdicWLMQ0NcG/gBnnA= github.com/integralist/go-findroot v0.0.0-20160518114804-ac90681525dc/go.mod h1:UlaC6ndby46IJz9m/03cZPKKkR9ykeIVBBDE3UDBdJk= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= @@ -647,6 +669,8 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22 github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/joomcode/errorx v1.0.1/go.mod h1:kgco15ekB6cs+4Xjzo7SPeXzx38PbJzBwbnu9qfVNHQ= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -660,10 +684,10 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= -github.com/juju/ratelimit v1.0.1 h1:+7AIFJVQ0EQgq/K9+0Krm7m530Du7tIz0METWzN0RgY= github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d h1:cVtBfNW5XTHiKQe7jDaDBSh/EVM4XLPutLAGboIXuM0= @@ -734,6 +758,7 @@ github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= @@ -802,7 +827,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.5.0 h1:2EkzeTSqBB4V4bJwWrt5gIIrZmpJBcoIRGS2kWLgzmk= github.com/montanaflynn/stats v0.5.0/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= @@ -824,22 +848,29 @@ github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef h1:K0Fn+DoFqNqktdZtdV3 github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef/go.mod h1:7WjlapSfwQyo6LNmIvEWzsW1hbBQfpUO4JWnuQRmva8= github.com/nicksnyder/go-i18n v1.10.0/go.mod h1:HrK7VCrbOvQoUAQ7Vpy7i87N7JZZZ7R2xBGjv0j365Q= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oleiade/reflections v1.0.1/go.mod h1:rdFxbxq4QXVZWj0F+e9jqjDkc7dbp97vkRixKo2JR60= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= -github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/opentracing/basictracer-go v1.0.0 h1:YyUAhaEfjoWXclZVJ9sGoNct7j4TVk7lZWlQw5UXuoo= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -855,7 +886,6 @@ github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCr github.com/petermattis/goid v0.0.0-20211229010228-4d14c490ee36/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= -github.com/phf/go-queue v0.0.0-20170504031614-9abe38d0371d h1:U+PMnTlV2tu7RuMK5etusZG3Cf+rpow5hqQByeCzJ2g= github.com/phf/go-queue v0.0.0-20170504031614-9abe38d0371d/go.mod h1:lXfE4PvvTW5xOjO6Mba8zDPyw8M93B6AQ7frTGnMlA8= github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ= github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= @@ -870,7 +900,6 @@ github.com/pingcap/check v0.0.0-20191216031241-8a5a85928f12/go.mod h1:PYMCGwN0JH github.com/pingcap/check v0.0.0-20200212061837-5e12011dc712/go.mod h1:PYMCGwN0JHjoqGr3HrZoD+b8Tgx8bKnArhSq8YVzUMc= github.com/pingcap/check v0.0.0-20211026125417-57bd13f7b5f0 h1:HVl5539r48eA+uDuX/ziBmQCxzT1pGrzWbKuXT46Bq0= github.com/pingcap/check v0.0.0-20211026125417-57bd13f7b5f0/go.mod h1:PYMCGwN0JHjoqGr3HrZoD+b8Tgx8bKnArhSq8YVzUMc= -github.com/pingcap/errcode v0.3.0 h1:IF6LC/4+b1KNwrMlr2rBTUrojFPMexXBcDWZSpNwxjg= github.com/pingcap/errcode v0.3.0/go.mod h1:4b2X8xSqxIroj/IZ9MX/VGZhAwc11wB9wRIzHvz6SeM= github.com/pingcap/errors v0.11.0/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= @@ -896,17 +925,19 @@ github.com/pingcap/kvproto v0.0.0-20200411081810-b85805c9476c/go.mod h1:IOdRDPLy github.com/pingcap/kvproto v0.0.0-20210219064844-c1844a4775d6/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= github.com/pingcap/kvproto v0.0.0-20210805052247-76981389e818/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= github.com/pingcap/kvproto v0.0.0-20210915062418-0f5764a128ad/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= -github.com/pingcap/kvproto v0.0.0-20211213085605-3329b3c5404c/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= -github.com/pingcap/kvproto v0.0.0-20211224055123-d1a140660c39 h1:ygiBX0nLWmpN3tD2I0OHhRZ7pOlh8PdjqvuzoaCJEEg= -github.com/pingcap/kvproto v0.0.0-20211224055123-d1a140660c39/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= +github.com/pingcap/kvproto v0.0.0-20220106070556-3fa8fa04f898/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= +github.com/pingcap/kvproto v0.0.0-20220215045702-d229fcc888c8/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= +github.com/pingcap/kvproto v0.0.0-20220228094105-9bb22e5a97fc/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI= +github.com/pingcap/kvproto v0.0.0-20220303025110-d5eb908517b2 h1:l+d3TYHO1ohk/li9YlOH0efNecAPdI4s4Ze5jbS6oLc= +github.com/pingcap/kvproto v0.0.0-20220303025110-d5eb908517b2/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/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8= github.com/pingcap/log v0.0.0-20210625125904-98ed8e2eb1c7/go.mod h1:8AanEdAHATuRurdGxZXBz0At+9avep+ub7U1AGYLIMM= github.com/pingcap/log v0.0.0-20210906054005-afc726e70354/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= -github.com/pingcap/log v0.0.0-20211207084639-71a2e5860834 h1:/wKEagMl3KDpt7758/4Z+31yY3uxQCygOZ1xSbRXCP0= -github.com/pingcap/log v0.0.0-20211207084639-71a2e5860834/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= +github.com/pingcap/log v0.0.0-20211215031037-e024ba4eb0ee h1:VO2t6IBpfvW34TdtD/G10VvnGqjLic1jzOuHjUb5VqM= +github.com/pingcap/log v0.0.0-20211215031037-e024ba4eb0ee/go.mod h1:DWQW5jICDR7UJh4HtxXSM20Churx4CQL0fwL/SoOSA4= github.com/pingcap/parser v0.0.0-20210415081931-48e7f467fd74/go.mod h1:xZC8I7bug4GJ5KtHhgAikjTfU4kBv1Sbo3Pf1MZ6lVw= github.com/pingcap/parser v0.0.0-20210525032559-c37778aff307/go.mod h1:xZC8I7bug4GJ5KtHhgAikjTfU4kBv1Sbo3Pf1MZ6lVw= github.com/pingcap/sysutil v0.0.0-20200206130906-2bfa6dc40bcd/go.mod h1:EB/852NMQ+aRKioCpToQ94Wl7fktV+FNnxf3CX/TTXI= @@ -916,23 +947,22 @@ github.com/pingcap/sysutil v0.0.0-20211208032423-041a72e5860d/go.mod h1:7j18ezaW github.com/pingcap/sysutil v0.0.0-20220114020952-ea68d2dbf5b4 h1:HYbcxtnkN3s5tqrZ/z3eJS4j3Db8wMphEm1q10lY/TM= github.com/pingcap/sysutil v0.0.0-20220114020952-ea68d2dbf5b4/go.mod h1:sDCsM39cGiv2vwunZkaFA917vVkqDTGSPbbV7z4Oops= github.com/pingcap/tidb v1.1.0-beta.0.20211023132847-efa94595c071/go.mod h1:Ci7ABF58a4jn6YtaHi7655jP409edqC2JxWWFRqOubg= -github.com/pingcap/tidb v1.1.0-beta.0.20220210065735-92f5a6340ca2 h1:0GZfSPfQ5zSXPo+mn8mqSsm6G/JerW8L+KZXGLT8pLk= -github.com/pingcap/tidb v1.1.0-beta.0.20220210065735-92f5a6340ca2/go.mod h1:1ATxD29hPy7OXNIxyZWb9PqA12F5YjmYoO9uh/655OY= +github.com/pingcap/tidb v1.1.0-beta.0.20220303050146-f5a52909b6af h1:XZfzhsveemMcFOnltF+V6ZwzQ8p1iczdHXwbZnnXuaE= +github.com/pingcap/tidb v1.1.0-beta.0.20220303050146-f5a52909b6af/go.mod h1:tXnQq3ZPgehlgpeZ8X+Mr/dvwjiAlmE6nt3H8pOY4zI= github.com/pingcap/tidb-dashboard v0.0.0-20210312062513-eef5d6404638/go.mod h1:OzFN8H0EDMMqeulPhPMw2i2JaiZWOKFQ7zdRPhENNgo= github.com/pingcap/tidb-dashboard v0.0.0-20210716172320-2226872e3296/go.mod h1:OCXbZTBTIMRcIt0jFsuCakZP+goYRv6IjawKbwLS2TQ= -github.com/pingcap/tidb-dashboard v0.0.0-20211206031355-bcc43a01d537/go.mod h1:OCXbZTBTIMRcIt0jFsuCakZP+goYRv6IjawKbwLS2TQ= github.com/pingcap/tidb-dashboard v0.0.0-20220117082709-e8076b5c79ba/go.mod h1:4hk/3owVGWdvI9Kx6yCqqvM1T5PVgwyQNyMQxD3rwfc= github.com/pingcap/tidb-tools v5.0.3+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM= -github.com/pingcap/tidb-tools v5.2.2-0.20211019062242-37a8bef2fa17+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM= -github.com/pingcap/tidb-tools v5.2.3-0.20211105044302-2dabb6641a6e+incompatible h1:acgn+tiufY2FnubfxaBuRjqvrknesyP8tXOTi2Otkwg= -github.com/pingcap/tidb-tools v5.2.3-0.20211105044302-2dabb6641a6e+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM= +github.com/pingcap/tidb-tools v5.4.1-0.20220221041303-00998a9a4bfd+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM= +github.com/pingcap/tidb-tools v5.4.1-0.20220302060346-b6d9cbe5dff1+incompatible h1:DLtjKK4k9++IE4zJBjfPbA0kAncx9uVQVJiamT/Cglc= +github.com/pingcap/tidb-tools v5.4.1-0.20220302060346-b6d9cbe5dff1+incompatible/go.mod h1:XGdcy9+yqlDSEMTpOXnwf3hiTeqrV6MN/u1se9N8yIM= github.com/pingcap/tidb/parser v0.0.0-20211011031125-9b13dc409c5e/go.mod h1:e1MGCA9Sg3T8jid8PKAEq5eYVuMMCq4n8gJ+Kqp4Plg= github.com/pingcap/tidb/parser v0.0.0-20211023132847-efa94595c071/go.mod h1:e1MGCA9Sg3T8jid8PKAEq5eYVuMMCq4n8gJ+Kqp4Plg= -github.com/pingcap/tidb/parser v0.0.0-20220210065735-92f5a6340ca2 h1:qbcHdNrYV+9kLFfF5Rc5vFI4wDPRdJtaFUbKDK6LD88= -github.com/pingcap/tidb/parser v0.0.0-20220210065735-92f5a6340ca2/go.mod h1:ElJiub4lRy6UZDb+0JHDkGEdr6aOli+ykhyej7VCLoI= +github.com/pingcap/tidb/parser v0.0.0-20220303050146-f5a52909b6af h1:4ZapyLBNNKE4byEp+BekyIP0PV8e2UzIwci6TtIf2Pg= +github.com/pingcap/tidb/parser v0.0.0-20220303050146-f5a52909b6af/go.mod h1:ElJiub4lRy6UZDb+0JHDkGEdr6aOli+ykhyej7VCLoI= github.com/pingcap/tipb v0.0.0-20211008080435-3fd327dfce0e/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs= -github.com/pingcap/tipb v0.0.0-20220107024056-3b91949a18a7 h1:DHU4vw0o15qdKsf7d/Pyhun4YtX8FwoDQxG0plPByUg= -github.com/pingcap/tipb v0.0.0-20220107024056-3b91949a18a7/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs= +github.com/pingcap/tipb v0.0.0-20220110031732-29e23c62eeac h1:bVklq/Np5uHUylW4Htyhi92TNrvIqVwht/+bHk0R/Tk= +github.com/pingcap/tipb v0.0.0-20220110031732-29e23c62eeac/go.mod h1:A7mrd7WHBl1o63LE2bIBGEJMTNWXqhgmYiOvMLxozfs= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 h1:49lOXmGaUpV9Fz3gd7TFZY106KVlPVa5jcYD1gaQf98= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= @@ -955,8 +985,9 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -969,16 +1000,18 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/r3labs/diff v1.1.0 h1:V53xhrbTHrWFWq3gI4b94AjgEJOerO1+1l0xyHOBi8M= github.com/r3labs/diff v1.1.0/go.mod h1:7WjXasNzi0vJetRcB/RqNl5dlIsmXcTTLmF5IoH6Xig= @@ -1030,8 +1063,9 @@ github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749/go.mod h1:ZY1cvUeJ github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0 h1:mj/nMDAwTBiaCqMEs4cYCqF7pO6Np7vhy1D1wcQGz+E= github.com/shurcooL/httpgzip v0.0.0-20190720172056-320755c1c1b0/go.mod h1:919LwcH0M7/W4fcZ0/jy0qGght1GIhqyS/EgWGH2j5Q= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= -github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd h1:ug7PpSOB5RBPK1Kg6qskGBoP3Vnj/aNYFTznWvlkGo0= github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= +github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 h1:pXY9qYc/MP5zdvqWEUH6SjNiu7VhSjuVFTFiTcphaLU= +github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726 h1:xT+JlYxNGqyT+XcU8iUrN18JYed2TvG9yN5ULG2jATM= github.com/siddontang/go v0.0.0-20180604090527-bdc77568d726/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw= github.com/siddontang/go-log v0.0.0-20180807004314-8d05993dda07 h1:oI+RNwuC9jF2g2lP0u0cVEEZrc/AYBCuFdvwrLWM/6Q= @@ -1040,6 +1074,7 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= @@ -1058,6 +1093,7 @@ github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -1068,6 +1104,7 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1112,13 +1149,15 @@ github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhso github.com/tidwall/sjson v1.2.2 h1:H1Llj/C9G+BoUN2DsybLHjWvr9dx4Uazavf0sXQ+rOs= github.com/tidwall/sjson v1.2.2/go.mod h1:jmW2RZpbKuExPFUHeFSBMiovT9ZyOziEHDRkbsdp0B0= github.com/tikv/client-go/v2 v2.0.0-alpha.0.20211011083157-49c8dd23f1f0/go.mod h1:00plYwQsQ5kBUmafHO+JkjznGgFaBokMZl82TZIbsQk= -github.com/tikv/client-go/v2 v2.0.0-rc.0.20220107040026-d22815099720 h1:GgXeSpvljDDkwScjOXM4NSVrR6hWnQthM8ZiHGHyBf8= -github.com/tikv/client-go/v2 v2.0.0-rc.0.20220107040026-d22815099720/go.mod h1:Yn4EKNn2y8XrudACiBGnVpDwfIXqi5oLPADpIoAcPyg= +github.com/tikv/client-go/v2 v2.0.0-rc.0.20220217140116-589cf79b2ab5 h1:xfhhUvnueHqt+mYfRR5ONAVezrqNBCvcWSh4Ml6Isjc= +github.com/tikv/client-go/v2 v2.0.0-rc.0.20220217140116-589cf79b2ab5/go.mod h1:gaHSp8rnxZ0w36qb6QPPNPh9P0Mu5vAEwCQcc0Brni4= github.com/tikv/pd v1.1.0-beta.0.20210323121136-78679e5e209d/go.mod h1:Jw9KG11C/23Rr7DW4XWQ7H5xOgGZo6DFL1OKAF4+Igw= github.com/tikv/pd v1.1.0-beta.0.20210818082359-acba1da0018d/go.mod h1:rammPjeZgpvfrQRPkijcx8tlxF1XM5+m6kRXrkDzCAA= -github.com/tikv/pd v1.1.0-beta.0.20211214024235-3c626f28bd32/go.mod h1:v9lIYxM8VeWZl4aF7jqsDXvqQoRjXdi7vYo5cO1g/2w= -github.com/tikv/pd v1.1.0-beta.0.20220207063535-9268bed87199 h1:54W4oA8BhAEyxliOZgWeIiOZQB6Oc25EXXRN3/hOSEE= -github.com/tikv/pd v1.1.0-beta.0.20220207063535-9268bed87199/go.mod h1:PWnQYE+JxAk4A31CtmZiBAhBMLXsAc9JaHCHpakX9Is= +github.com/tikv/pd v1.1.0-beta.0.20220303060546-3695d8164800 h1:lIfIwqe1HPa0suhMpiI200nYxau+rXWXTqZxSGg1HS4= +github.com/tikv/pd v1.1.0-beta.0.20220303060546-3695d8164800/go.mod h1:J/dj1zpEE9b7idgONGFttnXM+ncl88LmnkD/xDbq0hA= +github.com/tikv/pd/client v0.0.0-20220216070739-26c668271201/go.mod h1:fEvI5fhAuJn1Fn87VJF8ByE9Vc16EzWGoePZB21/nL8= +github.com/tikv/pd/client v0.0.0-20220216080339-1b8f82378ee7 h1:RRiYmyzHgTgV0mrp6Ue6cGn0EAB7U1YHnEfVWEGCKk8= +github.com/tikv/pd/client v0.0.0-20220216080339-1b8f82378ee7/go.mod h1:fEvI5fhAuJn1Fn87VJF8ByE9Vc16EzWGoePZB21/nL8= github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tklauser/go-sysconf v0.3.4/go.mod h1:Cl2c8ZRWfHD5IrfHo9VN+FX9kCFjIOyVklgXycLB6ek= @@ -1129,8 +1168,9 @@ github.com/tklauser/numcpus v0.3.0 h1:ILuRUQBtssgnxw0XXIjKUC56fgnOrFoQQ/4+DeU2bi github.com/tklauser/numcpus v0.3.0/go.mod h1:yFGUr7TUHQRAhyqBcEg0Ge34zDBAsIvJJcyE6boqnA8= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966 h1:j6JEOq5QWFker+d7mFQYOhjTZonQ7YkLTHm56dbn+yM= github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4dN7GR16kFc5fp3d1RIYzJW5onx8Ybykw2YQFA= +github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/twmb/murmur3 v1.1.3 h1:D83U0XYKcHRYwYIpBKf3Pks91Z0Byda/9SJ8B6EMRcA= github.com/twmb/murmur3 v1.1.3/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/uber-go/atomic v1.4.0 h1:yOuPqEq4ovnhEjpHmfFwsqBXDYbQeT6Nb0bwD6XnD5o= @@ -1150,12 +1190,10 @@ github.com/ugorji/go/codec v1.1.5-pre/go.mod h1:tULtS6Gy1AE1yCENaw4Vb//HLH5njI2t github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ= github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= -github.com/unrolled/render v1.0.1 h1:VDDnQQVfBMsOsp3VaCJszSO0nkBIVEYoPWeRThk9spY= github.com/unrolled/render v1.0.1/go.mod h1:gN9T0NhL4Bfbwu8ann7Ry/TGHYfosul+J0obPf6NBdM= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/urfave/negroni v0.3.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= -github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= @@ -1207,16 +1245,34 @@ github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQ github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.etcd.io/etcd v0.5.0-alpha.5.0.20200824191128-ae9734ed278b/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.etcd.io/etcd v0.5.0-alpha.5.0.20210512015243-d19fbe541bf9 h1:MNsY1TIsWLNCMT4DzZjFOxbDKfSoULYP0OFjJ8dSxts= go.etcd.io/etcd v0.5.0-alpha.5.0.20210512015243-d19fbe541bf9/go.mod h1:q+i20RPAmay+xq8LJ3VMOhXCNk4YCk3V7QP91meFavw= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/api/v3 v3.5.2 h1:tXok5yLlKyuQ/SXSjtqHc4uzNaMqZi2XsoSPr/LlJXI= +go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/pkg/v3 v3.5.2 h1:4hzqQ6hIb3blLyQ8usCU4h3NghkqcsohEQ3o3VetYxE= +go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.etcd.io/etcd/client/v2 v2.305.2 h1:ymrVwTkefuqA/rPkSW7/B4ApijbPVefRumkY+stNfS0= +go.etcd.io/etcd/client/v2 v2.305.2/go.mod h1:2D7ZejHVMIfog1221iLSYlQRzrtECw3kz4I4VAQm3qI= +go.etcd.io/etcd/client/v3 v3.5.2 h1:WdnejrUtQC4nCxK0/dLTMqKOB+U5TP/2Ya0BJL+1otA= +go.etcd.io/etcd/client/v3 v3.5.2/go.mod h1:kOOaWFFgHygyT0WlSmL8TJiXmMysO/nNUlEsSsN6W4o= +go.etcd.io/etcd/etcdutl/v3 v3.5.2/go.mod h1:f+KEUNxRzqQGq1Y/SsaDN5cmlOGRWgfE3lXEDi5F1Ys= +go.etcd.io/etcd/pkg/v3 v3.5.2 h1:YZUojdoPhOyl5QILYnR8LTUbbNefu/sV4ma+ZMr2tto= +go.etcd.io/etcd/pkg/v3 v3.5.2/go.mod h1:zsXz+9D/kijzRiG/UnFGDTyHKcVp0orwiO8iMLAi+k0= +go.etcd.io/etcd/raft/v3 v3.5.2 h1:uCC37qOXqBvKqTGHGyhASsaCsnTuJugl1GvneJNwHWo= +go.etcd.io/etcd/raft/v3 v3.5.2/go.mod h1:G6pCP1sFgbjod7/KnEHY0vHUViqxjkdt6AiKsD0GRr8= +go.etcd.io/etcd/server/v3 v3.5.2 h1:B6ytJvS4Fmt8nkjzS2/8POf4tuPhFMluE0lWd4dx/7U= +go.etcd.io/etcd/server/v3 v3.5.2/go.mod h1:mlG8znIEz4N/28GABrohZCBM11FqgGVQcpbcyJgh0j0= +go.etcd.io/etcd/tests/v3 v3.5.2 h1:uk7/uMGVebpBDl+roivowHt6gJ5Fnqwik3syDkoSKdo= +go.etcd.io/etcd/tests/v3 v3.5.2/go.mod h1:Jdzbei4uFi9C3xDBfCwckRXjlX0UPooiP4g/zXgBMgQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1225,6 +1281,27 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= +go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0 h1:sO4WKdPAudZGKPcpZT4MJn6JaDmpyLrMPDGGyA1SttE= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= +go.opentelemetry.io/otel v0.20.0 h1:eaP0Fqu7SXHwvjiqDq83zImeehOHX8doTvU9AwXON8g= +go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= +go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg= +go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= +go.opentelemetry.io/otel/metric v0.20.0 h1:4kzhXFP+btKm4jwxpjIqjs41A7MakRFUS86bqLHTIw8= +go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= +go.opentelemetry.io/otel/oteltest v0.20.0 h1:HiITxCawalo5vQzdHfKeZurV8x7ljcqAgiWzF6Vaeaw= +go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= +go.opentelemetry.io/otel/sdk v0.20.0 h1:JsxtGXd06J8jrnya7fdI/U/MR6yXA5DtbZy+qoHQlr8= +go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0 h1:c5VRjxCXdQlx1HjzwGdQHzZaVI82b5EbBgOu2ljD92g= +go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= +go.opentelemetry.io/otel/sdk/metric v0.20.0 h1:7ao1wpzHRVKf0OQ7GIxiQJA6X7DLX9o14gmVon7mMK8= +go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= +go.opentelemetry.io/otel/trace v0.20.0 h1:1DL6EXUdcg95gukhuRRvLDO/4X5THh/5dIV52lqtnbw= +go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= +go.opentelemetry.io/proto/otlp v0.7.0 h1:rwOQPCuKAKmwGKq2aVNnYIibI6wnV7EvzgfTCzcdGg8= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= 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= @@ -1241,6 +1318,7 @@ go.uber.org/fx v1.12.0/go.mod h1:egT3Kyg1JFYQkvKLZ3EsykxkNrZxgXS+gKoKo7abERY= go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI= go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -1260,8 +1338,9 @@ go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= -go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI= go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= +go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= +go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= 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-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1281,6 +1360,7 @@ golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201217014255-9d1352758620/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -1387,6 +1467,7 @@ golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1475,16 +1556,20 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210217105451-b926d437f341/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1495,6 +1580,7 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1599,6 +1685,7 @@ golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201125231158-b5590deeca9b/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210112230658-8b4aab62c064/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -1619,9 +1706,7 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= -gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -1685,6 +1770,7 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1732,7 +1818,6 @@ google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= -google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= @@ -1748,6 +1833,9 @@ google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= +google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= @@ -1780,6 +1868,7 @@ gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8 gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/jcmturner/aescts.v1 v1.0.1 h1:cVVZBK2b1zY26haWB4vbBiZrfFQnfbTVrE3xZq6hrEw= gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= diff --git a/pkg/cmd/cli/cli_capture_list.go b/pkg/cmd/cli/cli_capture_list.go index 9f122b5b290..1f62a4491e1 100644 --- a/pkg/cmd/cli/cli_capture_list.go +++ b/pkg/cmd/cli/cli_capture_list.go @@ -17,13 +17,14 @@ import ( "context" "github.com/pingcap/errors" + "github.com/spf13/cobra" + "go.etcd.io/etcd/client/v3/concurrency" + cmdcontext "github.com/pingcap/tiflow/pkg/cmd/context" "github.com/pingcap/tiflow/pkg/cmd/factory" "github.com/pingcap/tiflow/pkg/cmd/util" cerror "github.com/pingcap/tiflow/pkg/errors" "github.com/pingcap/tiflow/pkg/etcd" - "github.com/spf13/cobra" - "go.etcd.io/etcd/clientv3/concurrency" ) // capture holds capture information. diff --git a/pkg/cmd/factory/factory_impl.go b/pkg/cmd/factory/factory_impl.go index b35274ffcd5..9761cd9b38a 100644 --- a/pkg/cmd/factory/factory_impl.go +++ b/pkg/cmd/factory/factory_impl.go @@ -20,17 +20,18 @@ import ( "github.com/pingcap/errors" tidbkv "github.com/pingcap/tidb/kv" + pd "github.com/tikv/pd/client" + etcdlogutil "go.etcd.io/etcd/client/pkg/v3/logutil" + clientv3 "go.etcd.io/etcd/client/v3" + "go.uber.org/zap" + "google.golang.org/grpc" + "google.golang.org/grpc/backoff" + "github.com/pingcap/tiflow/cdc/kv" cmdconetxt "github.com/pingcap/tiflow/pkg/cmd/context" "github.com/pingcap/tiflow/pkg/etcd" "github.com/pingcap/tiflow/pkg/security" "github.com/pingcap/tiflow/pkg/version" - pd "github.com/tikv/pd/client" - "go.etcd.io/etcd/clientv3" - etcdlogutil "go.etcd.io/etcd/pkg/logutil" - "go.uber.org/zap" - "google.golang.org/grpc" - "google.golang.org/grpc/backoff" ) type factoryImpl struct { diff --git a/pkg/errorutil/ignore.go b/pkg/errorutil/ignore.go index 3de2b82d311..81c6faf3352 100644 --- a/pkg/errorutil/ignore.go +++ b/pkg/errorutil/ignore.go @@ -19,7 +19,7 @@ import ( tddl "github.com/pingcap/tidb/ddl" "github.com/pingcap/tidb/infoschema" "github.com/pingcap/tidb/parser/mysql" - v3rpc "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" + v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" ) // IsIgnorableMySQLDDLError is used to check what error can be ignored diff --git a/pkg/errorutil/ignore_test.go b/pkg/errorutil/ignore_test.go index 825bf7d91b6..569c4270bd3 100644 --- a/pkg/errorutil/ignore_test.go +++ b/pkg/errorutil/ignore_test.go @@ -21,7 +21,7 @@ import ( "github.com/pingcap/tidb/infoschema" tmysql "github.com/pingcap/tidb/parser/mysql" "github.com/stretchr/testify/require" - v3rpc "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" + v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" ) func newMysqlErr(number uint16, message string) *mysql.MySQLError { diff --git a/pkg/etcd/client.go b/pkg/etcd/client.go index b8cb028216b..42932ec81d0 100644 --- a/pkg/etcd/client.go +++ b/pkg/etcd/client.go @@ -20,14 +20,15 @@ import ( "github.com/benbjohnson/clock" "github.com/pingcap/errors" "github.com/pingcap/log" - cerrors "github.com/pingcap/tiflow/pkg/errors" - "github.com/pingcap/tiflow/pkg/errorutil" - "github.com/pingcap/tiflow/pkg/retry" "github.com/prometheus/client_golang/prometheus" - "go.etcd.io/etcd/clientv3" - v3rpc "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" + v3rpc "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "google.golang.org/grpc/codes" + + cerrors "github.com/pingcap/tiflow/pkg/errors" + "github.com/pingcap/tiflow/pkg/errorutil" + "github.com/pingcap/tiflow/pkg/retry" ) // etcd operation names diff --git a/pkg/etcd/client_test.go b/pkg/etcd/client_test.go index b8fe6bcbbee..faf155a1445 100644 --- a/pkg/etcd/client_test.go +++ b/pkg/etcd/client_test.go @@ -24,8 +24,8 @@ import ( "github.com/benbjohnson/clock" "github.com/pingcap/errors" "github.com/stretchr/testify/require" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" + "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + clientv3 "go.etcd.io/etcd/client/v3" ) type mockClient struct { diff --git a/pkg/etcd/etcd.go b/pkg/etcd/etcd.go index 5c6a4209645..907595eaa7b 100644 --- a/pkg/etcd/etcd.go +++ b/pkg/etcd/etcd.go @@ -19,20 +19,20 @@ import ( "net/url" "time" + "github.com/pingcap/errors" "github.com/pingcap/log" - "github.com/pingcap/tiflow/cdc/model" - cerror "github.com/pingcap/tiflow/pkg/errors" "github.com/prometheus/client_golang/prometheus" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/clientv3/concurrency" - "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" - "go.etcd.io/etcd/mvcc/mvccpb" + "github.com/tikv/pd/pkg/tempurl" + "go.etcd.io/etcd/api/v3/mvccpb" + "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/client/v3/concurrency" + "go.etcd.io/etcd/server/v3/embed" "go.uber.org/zap" "google.golang.org/grpc/codes" - "github.com/pingcap/errors" - "github.com/tikv/pd/pkg/tempurl" - "go.etcd.io/etcd/embed" + "github.com/pingcap/tiflow/cdc/model" + cerror "github.com/pingcap/tiflow/pkg/errors" ) const ( diff --git a/pkg/etcd/etcd_test.go b/pkg/etcd/etcd_test.go index 36b604d44cf..6ea3a03cb42 100644 --- a/pkg/etcd/etcd_test.go +++ b/pkg/etcd/etcd_test.go @@ -25,17 +25,18 @@ import ( "testing" "time" - "github.com/pingcap/tiflow/cdc/model" - cerror "github.com/pingcap/tiflow/pkg/errors" - "github.com/pingcap/tiflow/pkg/util" "github.com/stretchr/testify/require" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/clientv3/concurrency" - "go.etcd.io/etcd/embed" - "go.etcd.io/etcd/pkg/logutil" + "go.etcd.io/etcd/client/pkg/v3/logutil" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/client/v3/concurrency" + "go.etcd.io/etcd/server/v3/embed" "go.uber.org/zap" "go.uber.org/zap/zapcore" "golang.org/x/sync/errgroup" + + "github.com/pingcap/tiflow/cdc/model" + cerror "github.com/pingcap/tiflow/pkg/errors" + "github.com/pingcap/tiflow/pkg/util" ) type Captures []*model.CaptureInfo diff --git a/pkg/etcd/util.go b/pkg/etcd/util.go index e70ec080edf..3707089cb65 100644 --- a/pkg/etcd/util.go +++ b/pkg/etcd/util.go @@ -13,7 +13,7 @@ package etcd -import "go.etcd.io/etcd/clientv3" +import clientv3 "go.etcd.io/etcd/client/v3" func getRevisionFromWatchOpts(opts ...clientv3.OpOption) int64 { op := &clientv3.Op{} diff --git a/pkg/etcd/util_test.go b/pkg/etcd/util_test.go index 210202c4f32..39ee4b5f91d 100644 --- a/pkg/etcd/util_test.go +++ b/pkg/etcd/util_test.go @@ -18,7 +18,7 @@ import ( "testing" "github.com/stretchr/testify/require" - "go.etcd.io/etcd/clientv3" + clientv3 "go.etcd.io/etcd/client/v3" ) func TestGetRevisionFromWatchOpts(t *testing.T) { diff --git a/pkg/orchestrator/etcd_worker.go b/pkg/orchestrator/etcd_worker.go index 8c60a853a00..d7b23a3c760 100644 --- a/pkg/orchestrator/etcd_worker.go +++ b/pkg/orchestrator/etcd_worker.go @@ -22,18 +22,19 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/failpoint" "github.com/pingcap/log" - cerrors "github.com/pingcap/tiflow/pkg/errors" - "github.com/pingcap/tiflow/pkg/etcd" - "github.com/pingcap/tiflow/pkg/orchestrator/util" "github.com/prometheus/client_golang/prometheus" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/clientv3/concurrency" - "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" - "go.etcd.io/etcd/etcdserver/etcdserverpb" - "go.etcd.io/etcd/mvcc/mvccpb" + "go.etcd.io/etcd/api/v3/etcdserverpb" + "go.etcd.io/etcd/api/v3/mvccpb" + "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/client/v3/concurrency" "go.uber.org/zap" "go.uber.org/zap/zapcore" "golang.org/x/time/rate" + + cerrors "github.com/pingcap/tiflow/pkg/errors" + "github.com/pingcap/tiflow/pkg/etcd" + "github.com/pingcap/tiflow/pkg/orchestrator/util" ) const ( diff --git a/pkg/orchestrator/etcd_worker_test.go b/pkg/orchestrator/etcd_worker_test.go index a46eb83cab9..be5c6d3da0c 100644 --- a/pkg/orchestrator/etcd_worker_test.go +++ b/pkg/orchestrator/etcd_worker_test.go @@ -27,15 +27,16 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/log" - cerrors "github.com/pingcap/tiflow/pkg/errors" - "github.com/pingcap/tiflow/pkg/etcd" - "github.com/pingcap/tiflow/pkg/orchestrator/util" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/etcdserver/api/v3rpc/rpctypes" + "go.etcd.io/etcd/api/v3/v3rpc/rpctypes" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "golang.org/x/sync/errgroup" + + cerrors "github.com/pingcap/tiflow/pkg/errors" + "github.com/pingcap/tiflow/pkg/etcd" + "github.com/pingcap/tiflow/pkg/orchestrator/util" ) const ( diff --git a/tests/integration_tests/move_table/main.go b/tests/integration_tests/move_table/main.go index 0dfcb569491..102d166b4fd 100644 --- a/tests/integration_tests/move_table/main.go +++ b/tests/integration_tests/move_table/main.go @@ -29,18 +29,19 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/log" + "go.etcd.io/etcd/client/pkg/v3/logutil" + clientv3 "go.etcd.io/etcd/client/v3" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + "google.golang.org/grpc" + "google.golang.org/grpc/backoff" + "github.com/pingcap/tiflow/cdc/model" cerrors "github.com/pingcap/tiflow/pkg/errors" "github.com/pingcap/tiflow/pkg/etcd" "github.com/pingcap/tiflow/pkg/httputil" "github.com/pingcap/tiflow/pkg/retry" "github.com/pingcap/tiflow/pkg/security" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/pkg/logutil" - "go.uber.org/zap" - "go.uber.org/zap/zapcore" - "google.golang.org/grpc" - "google.golang.org/grpc/backoff" ) var ( diff --git a/tests/utils/cdc_state_checker/cdc_monitor.go b/tests/utils/cdc_state_checker/cdc_monitor.go index b5bc997860e..0c3480c9498 100644 --- a/tests/utils/cdc_state_checker/cdc_monitor.go +++ b/tests/utils/cdc_state_checker/cdc_monitor.go @@ -19,16 +19,17 @@ import ( "github.com/pingcap/errors" "github.com/pingcap/log" - "github.com/pingcap/tiflow/pkg/etcd" - "github.com/pingcap/tiflow/pkg/orchestrator" - "github.com/pingcap/tiflow/pkg/security" "github.com/prometheus/client_golang/prometheus" - "go.etcd.io/etcd/clientv3" - "go.etcd.io/etcd/pkg/logutil" + "go.etcd.io/etcd/client/pkg/v3/logutil" + clientv3 "go.etcd.io/etcd/client/v3" "go.uber.org/zap" "go.uber.org/zap/zapcore" "google.golang.org/grpc" "google.golang.org/grpc/backoff" + + "github.com/pingcap/tiflow/pkg/etcd" + "github.com/pingcap/tiflow/pkg/orchestrator" + "github.com/pingcap/tiflow/pkg/security" ) type cdcMonitor struct { From 97c3f3da53d3cc456e46aa26a90f16a286c435c6 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Thu, 3 Mar 2022 15:13:59 +0800 Subject: [PATCH 02/11] fix CI Signed-off-by: lance6716 --- dm/dm/worker/utils_test.go | 1 + dm/pkg/shardddl/optimism/keeper_test.go | 1 + dm/pkg/shardddl/optimism/lock_test.go | 1 + dm/syncer/safe_mode_test.go | 1 + dm/tests/_utils/run_dm_master_info_log | 28 +++++++++++++++++++++++++ dm/tests/all_mode/run.sh | 3 ++- 6 files changed, 34 insertions(+), 1 deletion(-) create mode 100755 dm/tests/_utils/run_dm_master_info_log diff --git a/dm/dm/worker/utils_test.go b/dm/dm/worker/utils_test.go index 1f1be9d017b..0476b60fdeb 100644 --- a/dm/dm/worker/utils_test.go +++ b/dm/dm/worker/utils_test.go @@ -17,6 +17,7 @@ import ( "testing" "github.com/stretchr/testify/require" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/dm/pb" diff --git a/dm/pkg/shardddl/optimism/keeper_test.go b/dm/pkg/shardddl/optimism/keeper_test.go index 14302f911f0..e886054a7ab 100644 --- a/dm/pkg/shardddl/optimism/keeper_test.go +++ b/dm/pkg/shardddl/optimism/keeper_test.go @@ -20,6 +20,7 @@ import ( "github.com/pingcap/tidb/parser" "github.com/pingcap/tidb/parser/model" "github.com/pingcap/tidb/util/mock" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/pkg/conn" diff --git a/dm/pkg/shardddl/optimism/lock_test.go b/dm/pkg/shardddl/optimism/lock_test.go index defe2ea96b1..2d2d41270cf 100644 --- a/dm/pkg/shardddl/optimism/lock_test.go +++ b/dm/pkg/shardddl/optimism/lock_test.go @@ -25,6 +25,7 @@ import ( "github.com/pingcap/tidb/parser/ast" "github.com/pingcap/tidb/parser/model" "github.com/pingcap/tidb/util/mock" + "go.etcd.io/etcd/tests/v3/integration" "github.com/pingcap/tiflow/dm/dm/config" "github.com/pingcap/tiflow/dm/pkg/conn" diff --git a/dm/syncer/safe_mode_test.go b/dm/syncer/safe_mode_test.go index ee121ff481e..527a98a636f 100644 --- a/dm/syncer/safe_mode_test.go +++ b/dm/syncer/safe_mode_test.go @@ -18,6 +18,7 @@ import ( "github.com/go-mysql-org/go-mysql/mysql" "github.com/stretchr/testify/require" + "go.etcd.io/etcd/tests/v3/integration" "go.uber.org/zap" "github.com/pingcap/tiflow/dm/dm/config" diff --git a/dm/tests/_utils/run_dm_master_info_log b/dm/tests/_utils/run_dm_master_info_log new file mode 100755 index 00000000000..e4052b79947 --- /dev/null +++ b/dm/tests/_utils/run_dm_master_info_log @@ -0,0 +1,28 @@ +#!/bin/sh +# parameter 1: work directory +# parameter 2: master-addr port +# parameter 3: config file for DM-master +# parameter 4: binary version, previous or current, can be omitted + +set -eu + +workdir=$1 +port=$2 +conf=$3 + +binary=$PWD/bin/dm-master.test +if [ "$#" -ge 4 ]; then + version=$4 + binary=$PWD/bin/dm-master.test.$version +fi + +PWD=$(pwd) + +mkdir -p $workdir/log + +echo "[$(date)] <<<<<< START DM-MASTER on port $port, config: $conf >>>>>>" +cd $workdir +$binary -test.coverprofile="$TEST_DIR/cov.$TEST_NAME.master.out" DEVEL \ + --master-addr=:$port --log-file="$workdir/log/dm-master.log" -L=info \ + --config="$conf" >>$workdir/log/stdout.log 2>&1 & +cd $PWD diff --git a/dm/tests/all_mode/run.sh b/dm/tests/all_mode/run.sh index e3f23df4231..e13d886b0a9 100755 --- a/dm/tests/all_mode/run.sh +++ b/dm/tests/all_mode/run.sh @@ -406,7 +406,8 @@ function run() { check_contains 'Query OK, 3 rows affected' # start DM worker and master - run_dm_master $WORK_DIR/master $MASTER_PORT $cur/conf/dm-master.toml + # set log level of DM-master to info, because debug level will let etcd print KV, thus expose the password in task config + run_dm_master_info_log $WORK_DIR/master $MASTER_PORT $cur/conf/dm-master.toml check_rpc_alive $cur/../bin/check_master_online 127.0.0.1:$MASTER_PORT check_metric $MASTER_PORT 'start_leader_counter' 3 0 2 run_dm_worker $WORK_DIR/worker1 $WORKER1_PORT $cur/conf/dm-worker1.toml From c1ccba3bef4257e9ba1afb41aa0f522ef6de3339 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Thu, 3 Mar 2022 15:24:08 +0800 Subject: [PATCH 03/11] fix more --- pkg/etcd/etcd_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/etcd/etcd_test.go b/pkg/etcd/etcd_test.go index 6ea3a03cb42..bd0399189f3 100644 --- a/pkg/etcd/etcd_test.go +++ b/pkg/etcd/etcd_test.go @@ -80,7 +80,10 @@ func (s *etcdTester) tearDownTest(t *testing.T) { logEtcdError: for { select { - case err := <-s.etcd.Err(): + case err, ok := <-s.etcd.Err(): + if !ok { + break logEtcdError + } t.Logf("etcd server error: %v", err) default: break logEtcdError From 756405185fc4b2868d3c523b2d8f8515dc80bad1 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Thu, 3 Mar 2022 16:01:54 +0800 Subject: [PATCH 04/11] fix more case Signed-off-by: lance6716 --- dm/dm/master/etcd_test.go | 2 +- dm/dm/master/openapi_test.go | 1 + dm/dm/master/scheduler/scheduler_test.go | 1 + dm/dm/master/server_test.go | 1 + dm/dm/master/shardddl/pessimist_test.go | 1 + dm/dm/worker/utils_test.go | 1 + dm/pkg/etcdutil/etcdutil_test.go | 1 + dm/pkg/ha/source_test.go | 1 + dm/pkg/shardddl/optimism/info_test.go | 1 + dm/pkg/shardddl/optimism/keeper_test.go | 1 + dm/pkg/shardddl/optimism/lock_test.go | 1 + dm/pkg/shardddl/pessimism/info_test.go | 1 + dm/pkg/upgrade/upgrade_test.go | 1 + dm/syncer/safe_mode_test.go | 1 + dm/syncer/shardddl/pessimist_test.go | 1 + pkg/leakutil/leak_helper.go | 2 +- pkg/util/testleak/leaktest.go | 2 +- 17 files changed, 17 insertions(+), 3 deletions(-) diff --git a/dm/dm/master/etcd_test.go b/dm/dm/master/etcd_test.go index 61697a7b6b0..e20ec8ed045 100644 --- a/dm/dm/master/etcd_test.go +++ b/dm/dm/master/etcd_test.go @@ -178,7 +178,7 @@ func (t *testEtcdSuite) TestPrepareJoinEtcd(c *check.C) { cfgAfter2.AdvertisePeerUrls = cfgAfter2.PeerUrls err = prepareJoinEtcd(cfgAfter2) c.Assert(terror.ErrMasterJoinEmbedEtcdFail.Equal(err), check.IsTrue) - c.Assert(err, check.ErrorMatches, ".*fail to join embed etcd: there is a member that has not joined successfully, continue the join or remove it.*") + c.Assert(err, check.ErrorMatches, ".*context deadline exceeded.*") // start the joining etcd cfgAfterEtcd := genEmbedEtcdConfigWithLogger("info") diff --git a/dm/dm/master/openapi_test.go b/dm/dm/master/openapi_test.go index b686aac9505..d808682da21 100644 --- a/dm/dm/master/openapi_test.go +++ b/dm/dm/master/openapi_test.go @@ -60,6 +60,7 @@ type openAPISuite struct { } func (t *openAPISuite) SetUpSuite(c *check.C) { + integration.BeforeTest(t) checkAndAdjustSourceConfigFunc = checkAndNoAdjustSourceConfigMock } diff --git a/dm/dm/master/scheduler/scheduler_test.go b/dm/dm/master/scheduler/scheduler_test.go index b6f4f8798a1..b21e7e6562a 100644 --- a/dm/dm/master/scheduler/scheduler_test.go +++ b/dm/dm/master/scheduler/scheduler_test.go @@ -60,6 +60,7 @@ func TestScheduler(t *testing.T) { t.Fatal(err) } + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/dm/master/server_test.go b/dm/dm/master/server_test.go index 855e01e44fe..663de35f48c 100644 --- a/dm/dm/master/server_test.go +++ b/dm/dm/master/server_test.go @@ -187,6 +187,7 @@ func TestMaster(t *testing.T) { } func (t *testMaster) SetUpSuite(c *check.C) { + integration.BeforeTest(t.testT) err := log.InitLogger(&log.Config{}) c.Assert(err, check.IsNil) t.workerClients = make(map[string]workerrpc.Client) diff --git a/dm/dm/master/shardddl/pessimist_test.go b/dm/dm/master/shardddl/pessimist_test.go index b7688e155a7..87f9a352f1c 100644 --- a/dm/dm/master/shardddl/pessimist_test.go +++ b/dm/dm/master/shardddl/pessimist_test.go @@ -57,6 +57,7 @@ func TestShardDDL(t *testing.T) { } tt = t + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/dm/worker/utils_test.go b/dm/dm/worker/utils_test.go index 0476b60fdeb..4310251a579 100644 --- a/dm/dm/worker/utils_test.go +++ b/dm/dm/worker/utils_test.go @@ -25,6 +25,7 @@ import ( ) func TestGetExpectValidatorStage(t *testing.T) { + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/etcdutil/etcdutil_test.go b/dm/pkg/etcdutil/etcdutil_test.go index f840244454b..e2fc494de22 100644 --- a/dm/pkg/etcdutil/etcdutil_test.go +++ b/dm/pkg/etcdutil/etcdutil_test.go @@ -50,6 +50,7 @@ func (t *testEtcdUtilSuite) SetUpSuite(c *C) { } func TestSuite(t *testing.T) { + integration.BeforeTest(t) // inject *testing.T to suite s := etcdTestSuite.(*testEtcdUtilSuite) s.testT = t diff --git a/dm/pkg/ha/source_test.go b/dm/pkg/ha/source_test.go index baede8daf88..f0da34b69ad 100644 --- a/dm/pkg/ha/source_test.go +++ b/dm/pkg/ha/source_test.go @@ -77,6 +77,7 @@ var ( ) func TestHA(t *testing.T) { + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/shardddl/optimism/info_test.go b/dm/pkg/shardddl/optimism/info_test.go index ef942dd2ed7..a221c393a64 100644 --- a/dm/pkg/shardddl/optimism/info_test.go +++ b/dm/pkg/shardddl/optimism/info_test.go @@ -37,6 +37,7 @@ import ( var etcdTestCli *clientv3.Client func TestInfo(t *testing.T) { + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/shardddl/optimism/keeper_test.go b/dm/pkg/shardddl/optimism/keeper_test.go index e886054a7ab..1ab8e2ce915 100644 --- a/dm/pkg/shardddl/optimism/keeper_test.go +++ b/dm/pkg/shardddl/optimism/keeper_test.go @@ -32,6 +32,7 @@ type testKeeper struct{} var _ = Suite(&testKeeper{}) func TestKeeper(t *testing.T) { + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/shardddl/optimism/lock_test.go b/dm/pkg/shardddl/optimism/lock_test.go index 2d2d41270cf..a9c49e492a2 100644 --- a/dm/pkg/shardddl/optimism/lock_test.go +++ b/dm/pkg/shardddl/optimism/lock_test.go @@ -40,6 +40,7 @@ type testLock struct{} var _ = Suite(&testLock{}) func TestLock(t *testing.T) { + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/shardddl/pessimism/info_test.go b/dm/pkg/shardddl/pessimism/info_test.go index cb21a3b1b73..f585d3fa0f7 100644 --- a/dm/pkg/shardddl/pessimism/info_test.go +++ b/dm/pkg/shardddl/pessimism/info_test.go @@ -32,6 +32,7 @@ import ( var etcdTestCli *clientv3.Client func TestInfo(t *testing.T) { + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/upgrade/upgrade_test.go b/dm/pkg/upgrade/upgrade_test.go index 7e0410a7a95..ec7dc1adf93 100644 --- a/dm/pkg/upgrade/upgrade_test.go +++ b/dm/pkg/upgrade/upgrade_test.go @@ -31,6 +31,7 @@ var ( ) func TestUpgrade(t *testing.T) { + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/syncer/safe_mode_test.go b/dm/syncer/safe_mode_test.go index 527a98a636f..4d1163424aa 100644 --- a/dm/syncer/safe_mode_test.go +++ b/dm/syncer/safe_mode_test.go @@ -39,6 +39,7 @@ func (c *mockCheckpointForSafeMode) SafeModeExitPoint() *binlog.Location { } func TestEnableSafeModeInitializationPhase(t *testing.T) { + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) etcdTestCli := mockCluster.RandClient() diff --git a/dm/syncer/shardddl/pessimist_test.go b/dm/syncer/shardddl/pessimist_test.go index 533524d3215..94ee9fba204 100644 --- a/dm/syncer/shardddl/pessimist_test.go +++ b/dm/syncer/shardddl/pessimist_test.go @@ -40,6 +40,7 @@ func TestShardDDL(t *testing.T) { t.Fatal(err) } + integration.BeforeTest(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/pkg/leakutil/leak_helper.go b/pkg/leakutil/leak_helper.go index accfde33667..622565554e0 100644 --- a/pkg/leakutil/leak_helper.go +++ b/pkg/leakutil/leak_helper.go @@ -23,7 +23,7 @@ import ( // options can be used to implement other ignore items func SetUpLeakTest(m *testing.M, options ...goleak.Option) { opts := []goleak.Option{ - goleak.IgnoreTopFunction("go.etcd.io/etcd/pkg/logutil.(*MergeLogger).outputLoop"), + goleak.IgnoreTopFunction("go.etcd.io/etcd/client/pkg/v3/logutil.(*MergeLogger).outputLoop"), goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"), } diff --git a/pkg/util/testleak/leaktest.go b/pkg/util/testleak/leaktest.go index 9bbb7a6122c..5b7ad55bae3 100644 --- a/pkg/util/testleak/leaktest.go +++ b/pkg/util/testleak/leaktest.go @@ -48,7 +48,7 @@ func interestingGoroutines() (gs []string) { // false positive leak failures "google.golang.org/grpc.(*addrConn).resetTransport", "google.golang.org/grpc.(*ccBalancerWrapper).watcher", - "go.etcd.io/etcd/pkg/logutil.(*MergeLogger).outputLoop", + "go.etcd.io/etcd/client/pkg/v3/logutil.(*MergeLogger).outputLoop", "go.etcd.io/etcd/v3/pkg/logutil.(*MergeLogger).outputLoop", // library used by sarama, ref: https://github.com/rcrowley/go-metrics/pull/266 "github.com/rcrowley/go-metrics.(*meterArbiter).tick", From 409d2072f122e1db37e3d779a6c347a9438c2452 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Thu, 3 Mar 2022 16:45:27 +0800 Subject: [PATCH 05/11] fix more test case Signed-off-by: lance6716 --- dm/dm/master/openapi_test.go | 1 - dm/dm/master/server_test.go | 2 +- dm/dm/worker/server_test.go | 1 - dm/tests/tls/run.sh | 3 ++- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dm/dm/master/openapi_test.go b/dm/dm/master/openapi_test.go index d808682da21..b686aac9505 100644 --- a/dm/dm/master/openapi_test.go +++ b/dm/dm/master/openapi_test.go @@ -60,7 +60,6 @@ type openAPISuite struct { } func (t *openAPISuite) SetUpSuite(c *check.C) { - integration.BeforeTest(t) checkAndAdjustSourceConfigFunc = checkAndNoAdjustSourceConfigMock } diff --git a/dm/dm/master/server_test.go b/dm/dm/master/server_test.go index 663de35f48c..48b6772b60f 100644 --- a/dm/dm/master/server_test.go +++ b/dm/dm/master/server_test.go @@ -175,6 +175,7 @@ func TestMaster(t *testing.T) { if err != nil { t.Fatal(err) } + integration.BeforeTest(t) // inject *testing.T to testMaster s := testSuite.(*testMaster) s.testT = t @@ -187,7 +188,6 @@ func TestMaster(t *testing.T) { } func (t *testMaster) SetUpSuite(c *check.C) { - integration.BeforeTest(t.testT) err := log.InitLogger(&log.Config{}) c.Assert(err, check.IsNil) t.workerClients = make(map[string]workerrpc.Client) diff --git a/dm/dm/worker/server_test.go b/dm/dm/worker/server_test.go index 7f7af93a1a9..5074dd60474 100644 --- a/dm/dm/worker/server_test.go +++ b/dm/dm/worker/server_test.go @@ -109,7 +109,6 @@ func (t *testServer) TestServer(c *C) { etcdDir := c.MkDir() ETCD, err := createMockETCD(etcdDir, "http://"+masterAddr) c.Assert(err, IsNil) - defer ETCD.Close() cfg := NewConfig() c.Assert(cfg.Parse([]string{"-config=./dm-worker.toml"}), IsNil) cfg.Join = masterAddr diff --git a/dm/tests/tls/run.sh b/dm/tests/tls/run.sh index 9e7f08f6fd7..f05f59cfb93 100644 --- a/dm/tests/tls/run.sh +++ b/dm/tests/tls/run.sh @@ -372,7 +372,8 @@ function test_master_ha_when_enable_tidb_tls() { check_sync_diff $WORK_DIR $cur/conf/diff_config.toml # https://github.com/pingcap/dm/issues/1458 - check_log_not_contains $WORK_DIR/master1/log/dm-master.log "remote error: tls: bad certificate" + # check the log is not repeatedly printed + check_log_contains $WORK_DIR/master1/log/dm-master.log "remote error: tls: bad certificate" 1 echo "============================== test_master_ha_when_enable_tidb_tls success ==================================" } From d9ccb611dc3de008f6460de59a9d27018135b846 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Thu, 3 Mar 2022 18:01:37 +0800 Subject: [PATCH 06/11] try fix unit tests Signed-off-by: lance6716 --- dm/dm/master/scheduler/scheduler_test.go | 2 +- dm/dm/master/server_test.go | 2 +- dm/dm/master/shardddl/pessimist_test.go | 2 +- dm/dm/worker/utils_test.go | 2 +- dm/pkg/etcdutil/etcdutil_test.go | 2 +- dm/pkg/ha/source_test.go | 2 +- dm/pkg/shardddl/optimism/info_test.go | 2 +- dm/pkg/shardddl/optimism/keeper_test.go | 2 +- dm/pkg/shardddl/optimism/lock_test.go | 2 +- dm/pkg/shardddl/pessimism/info_test.go | 2 +- dm/pkg/upgrade/upgrade_test.go | 2 +- dm/syncer/safe_mode_test.go | 2 +- dm/syncer/shardddl/pessimist_test.go | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dm/dm/master/scheduler/scheduler_test.go b/dm/dm/master/scheduler/scheduler_test.go index 1cbe35ac74b..923e13d3f07 100644 --- a/dm/dm/master/scheduler/scheduler_test.go +++ b/dm/dm/master/scheduler/scheduler_test.go @@ -60,7 +60,7 @@ func TestScheduler(t *testing.T) { t.Fatal(err) } - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/dm/master/server_test.go b/dm/dm/master/server_test.go index e831a10d5da..754b7fee5c0 100644 --- a/dm/dm/master/server_test.go +++ b/dm/dm/master/server_test.go @@ -175,7 +175,7 @@ func TestMaster(t *testing.T) { if err != nil { t.Fatal(err) } - integration.BeforeTest(t) + integration.BeforeTestExternal(t) // inject *testing.T to testMaster s := testSuite.(*testMaster) s.testT = t diff --git a/dm/dm/master/shardddl/pessimist_test.go b/dm/dm/master/shardddl/pessimist_test.go index 87f9a352f1c..a7fc3671f27 100644 --- a/dm/dm/master/shardddl/pessimist_test.go +++ b/dm/dm/master/shardddl/pessimist_test.go @@ -57,7 +57,7 @@ func TestShardDDL(t *testing.T) { } tt = t - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/dm/worker/utils_test.go b/dm/dm/worker/utils_test.go index 4310251a579..1bc5cdad969 100644 --- a/dm/dm/worker/utils_test.go +++ b/dm/dm/worker/utils_test.go @@ -25,7 +25,7 @@ import ( ) func TestGetExpectValidatorStage(t *testing.T) { - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/etcdutil/etcdutil_test.go b/dm/pkg/etcdutil/etcdutil_test.go index e2fc494de22..1f1a3c5ae80 100644 --- a/dm/pkg/etcdutil/etcdutil_test.go +++ b/dm/pkg/etcdutil/etcdutil_test.go @@ -50,7 +50,7 @@ func (t *testEtcdUtilSuite) SetUpSuite(c *C) { } func TestSuite(t *testing.T) { - integration.BeforeTest(t) + integration.BeforeTestExternal(t) // inject *testing.T to suite s := etcdTestSuite.(*testEtcdUtilSuite) s.testT = t diff --git a/dm/pkg/ha/source_test.go b/dm/pkg/ha/source_test.go index f0da34b69ad..7d7ea53f872 100644 --- a/dm/pkg/ha/source_test.go +++ b/dm/pkg/ha/source_test.go @@ -77,7 +77,7 @@ var ( ) func TestHA(t *testing.T) { - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/shardddl/optimism/info_test.go b/dm/pkg/shardddl/optimism/info_test.go index a221c393a64..0035932400f 100644 --- a/dm/pkg/shardddl/optimism/info_test.go +++ b/dm/pkg/shardddl/optimism/info_test.go @@ -37,7 +37,7 @@ import ( var etcdTestCli *clientv3.Client func TestInfo(t *testing.T) { - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/shardddl/optimism/keeper_test.go b/dm/pkg/shardddl/optimism/keeper_test.go index 1ab8e2ce915..d6d56fb4c39 100644 --- a/dm/pkg/shardddl/optimism/keeper_test.go +++ b/dm/pkg/shardddl/optimism/keeper_test.go @@ -32,7 +32,7 @@ type testKeeper struct{} var _ = Suite(&testKeeper{}) func TestKeeper(t *testing.T) { - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/shardddl/optimism/lock_test.go b/dm/pkg/shardddl/optimism/lock_test.go index a9c49e492a2..9335bebf993 100644 --- a/dm/pkg/shardddl/optimism/lock_test.go +++ b/dm/pkg/shardddl/optimism/lock_test.go @@ -40,7 +40,7 @@ type testLock struct{} var _ = Suite(&testLock{}) func TestLock(t *testing.T) { - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/shardddl/pessimism/info_test.go b/dm/pkg/shardddl/pessimism/info_test.go index f585d3fa0f7..8c7eaebc9f1 100644 --- a/dm/pkg/shardddl/pessimism/info_test.go +++ b/dm/pkg/shardddl/pessimism/info_test.go @@ -32,7 +32,7 @@ import ( var etcdTestCli *clientv3.Client func TestInfo(t *testing.T) { - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/pkg/upgrade/upgrade_test.go b/dm/pkg/upgrade/upgrade_test.go index ec7dc1adf93..4a732ea8dd4 100644 --- a/dm/pkg/upgrade/upgrade_test.go +++ b/dm/pkg/upgrade/upgrade_test.go @@ -31,7 +31,7 @@ var ( ) func TestUpgrade(t *testing.T) { - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) diff --git a/dm/syncer/safe_mode_test.go b/dm/syncer/safe_mode_test.go index 4d1163424aa..01814b7e0aa 100644 --- a/dm/syncer/safe_mode_test.go +++ b/dm/syncer/safe_mode_test.go @@ -39,7 +39,7 @@ func (c *mockCheckpointForSafeMode) SafeModeExitPoint() *binlog.Location { } func TestEnableSafeModeInitializationPhase(t *testing.T) { - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) etcdTestCli := mockCluster.RandClient() diff --git a/dm/syncer/shardddl/pessimist_test.go b/dm/syncer/shardddl/pessimist_test.go index 94ee9fba204..70b04d21207 100644 --- a/dm/syncer/shardddl/pessimist_test.go +++ b/dm/syncer/shardddl/pessimist_test.go @@ -40,7 +40,7 @@ func TestShardDDL(t *testing.T) { t.Fatal(err) } - integration.BeforeTest(t) + integration.BeforeTestExternal(t) mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) defer mockCluster.Terminate(t) From b524c6915b558dc7764f9349d803014d94ee7f9a Mon Sep 17 00:00:00 2001 From: lance6716 Date: Thu, 3 Mar 2022 20:01:59 +0800 Subject: [PATCH 07/11] exhausted... --- dm/dm/config/source_config.go | 4 +- dm/dm/config/source_config_test.go | 17 ++-- dm/dm/config/source_converter_test.go | 3 +- dm/dm/config/subtask.go | 5 + dm/dm/config/subtask.toml | 114 +++++++++++++++++++++++ dm/dm/config/task_converters_test.go | 12 +-- dm/dm/ctl/master/operate_source.go | 2 +- dm/dm/master/bootstrap_test.go | 11 +-- dm/dm/master/config.go | 23 ++++- dm/dm/master/config_test.go | 32 +------ dm/dm/master/election_test.go | 4 +- dm/dm/master/etcd_test.go | 2 +- dm/dm/master/openapi_view_test.go | 10 +- dm/dm/master/scheduler/scheduler_test.go | 27 ++---- dm/dm/master/server_test.go | 12 +-- dm/dm/worker/server_test.go | 8 +- dm/dm/worker/source_worker_test.go | 8 +- dm/dm/worker/utils_test.go | 2 +- dm/pkg/ha/ops_test.go | 2 +- dm/pkg/ha/stage_test.go | 2 +- dm/pkg/ha/subtask_test.go | 9 +- 21 files changed, 201 insertions(+), 108 deletions(-) create mode 100644 dm/dm/config/subtask.toml diff --git a/dm/dm/config/source_config.go b/dm/dm/config/source_config.go index f8cd9870375..d49309d173a 100644 --- a/dm/dm/config/source_config.go +++ b/dm/dm/config/source_config.go @@ -47,11 +47,11 @@ const ( var getAllServerIDFunc = utils.GetAllServerID -// SampleConfigFile is sample config file of source. +// SampleSourceConfig is sample config file of source. // The embed source.yaml is a copy of dm/master/source.yaml, because embed // can only match regular files in the current directory and subdirectories. //go:embed source.yaml -var SampleConfigFile string +var SampleSourceConfig string // PurgeConfig is the configuration for Purger. type PurgeConfig struct { diff --git a/dm/dm/config/source_config_test.go b/dm/dm/config/source_config_test.go index 248c51d04de..7ea1a641bb3 100644 --- a/dm/dm/config/source_config_test.go +++ b/dm/dm/config/source_config_test.go @@ -31,11 +31,8 @@ import ( "github.com/pingcap/tiflow/dm/pkg/utils" ) -// do not forget to update this path if the file removed/renamed. -const sourceSampleFile = "../worker/source.yaml" - func (t *testConfig) TestConfig(c *C) { - cfg, err := LoadFromFile(sourceSampleFile) + cfg, err := ParseYaml(SampleSourceConfig) c.Assert(err, IsNil) cfg.RelayDir = "./xx" c.Assert(cfg.RelayDir, Equals, "./xx") @@ -134,7 +131,7 @@ aaa: xxx func (t *testConfig) TestConfigVerify(c *C) { newConfig := func() *SourceConfig { - cfg, err := LoadFromFile(sourceSampleFile) + cfg, err := ParseYaml(SampleSourceConfig) c.Assert(err, IsNil) cfg.RelayDir = "./xx" return cfg @@ -240,7 +237,7 @@ func (t *testConfig) TestConfigVerify(c *C) { } func (t *testConfig) TestSourceConfigForDowngrade(c *C) { - cfg, err := LoadFromFile(sourceSampleFile) + cfg, err := ParseYaml(SampleSourceConfig) c.Assert(err, IsNil) // make sure all new field were added @@ -274,7 +271,7 @@ func subtestFlavor(c *C, cfg *SourceConfig, sqlInfo, expectedFlavor, expectedErr } func (t *testConfig) TestAdjustFlavor(c *C) { - cfg, err := LoadFromFile(sourceSampleFile) + cfg, err := ParseYaml(SampleSourceConfig) c.Assert(err, IsNil) cfg.RelayDir = "./xx" @@ -297,7 +294,7 @@ func (t *testConfig) TestAdjustServerID(c *C) { }() getAllServerIDFunc = getMockServerIDs - cfg, err := LoadFromFile(sourceSampleFile) + cfg, err := ParseYaml(SampleSourceConfig) c.Assert(err, IsNil) cfg.RelayDir = "./xx" @@ -317,7 +314,7 @@ func getMockServerIDs(ctx context.Context, db *sql.DB) (map[uint32]struct{}, err } func (t *testConfig) TestAdjustCaseSensitive(c *C) { - cfg, err := LoadFromFile(sourceSampleFile) + cfg, err := ParseYaml(SampleSourceConfig) c.Assert(err, IsNil) db, mock, err := sqlmock.New() @@ -339,5 +336,5 @@ func (t *testConfig) TestAdjustCaseSensitive(c *C) { func (t *testConfig) TestEmbedSampleFile(c *C) { data, err := os.ReadFile("./source.yaml") c.Assert(err, IsNil) - c.Assert(SampleConfigFile, Equals, string(data)) + c.Assert(SampleSourceConfig, Equals, string(data)) } diff --git a/dm/dm/config/source_converter_test.go b/dm/dm/config/source_converter_test.go index 013880269ae..ec4e36ddaaf 100644 --- a/dm/dm/config/source_converter_test.go +++ b/dm/dm/config/source_converter_test.go @@ -15,11 +15,12 @@ package config import ( "github.com/pingcap/check" + "github.com/pingcap/tiflow/dm/openapi/fixtures" ) func (t *testConfig) TestConverterWithSourceAndOpenAPISource(c *check.C) { - sourceCfg1, err := LoadFromFile(sourceSampleFile) + sourceCfg1, err := ParseYaml(SampleSourceConfig) c.Assert(err, check.IsNil) // 1. test user create source from dmctl, after convert to openapi.Source then convert back to source config diff --git a/dm/dm/config/subtask.go b/dm/dm/config/subtask.go index 23347cbc580..e57664c7b0d 100644 --- a/dm/dm/config/subtask.go +++ b/dm/dm/config/subtask.go @@ -15,6 +15,7 @@ package config import ( "bytes" + _ "embed" "encoding/json" "flag" "fmt" @@ -270,6 +271,10 @@ type SubTaskConfig struct { } `yaml:"experimental" toml:"experimental" json:"experimental"` } +// SampleSubtaskConfig is the content of subtask.toml in current folder. +//go:embed subtask.toml +var SampleSubtaskConfig string + // NewSubTaskConfig creates a new SubTaskConfig. func NewSubTaskConfig() *SubTaskConfig { cfg := &SubTaskConfig{} diff --git a/dm/dm/config/subtask.toml b/dm/dm/config/subtask.toml new file mode 100644 index 00000000000..b46f8f0aa4a --- /dev/null +++ b/dm/dm/config/subtask.toml @@ -0,0 +1,114 @@ +# Base Configuration. + +# sub task name as identifier, should be unique +name = "sub-task-name" + +# sub task mode, can be `all`, `full`, `increment` +mode = "all" + +# used for binlog replication +server-id = 101 +source-id = "mysql-replica-01" + +# which flavor mysql/mariadb +flavor = "mysql" + +# meta schema in downstreaming database to store meta informaton of dm +meta-schema = "dm_meta" +# whether to disable heartbeat for calculating lag between master and syncer +enable-heartbeat = false + +# replicate from relay log or remote binlog +binlog-type = "local" + +# Mydumper configuration + +# -t, --threads +#threads = 16 + +# -F, --chunk-filesize +#chunk-filesize = 64 + +# --skip-tz-utc +#skip-tz-utc = true + +# other extra args +#extra-args = "-B test -T t1,t2 --no-locks" + + +# Loader configuration + +# Number of threads restoring concurrently for loader worker pool. Each worker restore one file at a time, increase this as TiKV nodes increase +pool-size = 16 + +# Directory of the dump to import +dir = "./dumped_data" + + +# Syncer configuration + +# different sub task should have different meta +meta-file = "./syncer.subTaskA.meta" + +worker-count = 16 +batch = 1000 + +# filter + +# block allow list provides a library to filter replicate on schema/table by given rules +# support regular expression , start with '~' declare use regular expression. +# rules like replication rules in MySQL, ref document: +# https://dev.mysql.com/doc/refman/8.0/en/replication-rules-db-options.html +# https://dev.mysql.com/doc/refman/8.0/en/replication-rules-table-options.html +#[block-allow-list] +#do-dbs = ["~^b.*","s1"] +# +#ignore-dbs = ["~^b.*","s1"] +# +#[[block-allow-list.do-tables]] +#db-name = "your db" +#tbl-name = "your table" +# +#[[block-allow-list.ignore-tables]] +#db-name = "~^b.*" +#tbl-name = "~^a.*" + + +# filter-rules filter binlog events +#[[filter-rules]] +#schema-pattern = "shard_db_*" +#table-pattern = "shard_table_*" +# do all dml, ignore all ddl +#events = ["all dml"] +#action = "Do" + +#[[filter-rules]] +#schema-pattern = "shard_db_*" +#table-pattern = "shard_table_*" +# ignore delete sqls and drop table ddls +#events = ["delete", "drop table"] +# regular expression, ignore drop procedure queries +# sql-pattern = ["^DROP\\s+PROCEDURE"] +#action = "Ignore" + + +# route table + +# applied after filter +# our Selector is a two level selector (schemal level, and table level) +# [[route-rules]] +# schema-pattern = "shard_db_*" +# target-schema = "shard_db" +# [[route-rules]] +# schema-pattern = "shard_db_*" +# table-pattern = "shard_table_*" +# target-schema = "shard_db" +# target-table = "shard_table" + +# to: the target db +# from: the source db, not in this file, auto get it from worker's config +[to] +host = "127.0.0.1" +user = "root" +password = "" +port = 4000 diff --git a/dm/dm/config/task_converters_test.go b/dm/dm/config/task_converters_test.go index d8d402e0ff6..241c094e9ea 100644 --- a/dm/dm/config/task_converters_test.go +++ b/dm/dm/config/task_converters_test.go @@ -51,7 +51,7 @@ func (t *testConfig) TestOpenAPITaskToSubTaskConfigs(c *check.C) { func testNoShardTaskToSubTaskConfigs(c *check.C) { task, err := fixtures.GenNoShardOpenAPITaskForTest() c.Assert(err, check.IsNil) - sourceCfg1, err := LoadFromFile(sourceSampleFile) + sourceCfg1, err := ParseYaml(SampleSourceConfig) c.Assert(err, check.IsNil) source1Name := task.SourceConfig.SourceConf[0].SourceName sourceCfg1.SourceID = task.SourceConfig.SourceConf[0].SourceName @@ -115,11 +115,11 @@ func testNoShardTaskToSubTaskConfigs(c *check.C) { func testShardAndFilterTaskToSubTaskConfigs(c *check.C) { task, err := fixtures.GenShardAndFilterOpenAPITaskForTest() c.Assert(err, check.IsNil) - sourceCfg1, err := LoadFromFile(sourceSampleFile) + sourceCfg1, err := ParseYaml(SampleSourceConfig) c.Assert(err, check.IsNil) source1Name := task.SourceConfig.SourceConf[0].SourceName sourceCfg1.SourceID = source1Name - sourceCfg2, err := LoadFromFile(sourceSampleFile) + sourceCfg2, err := ParseYaml(SampleSourceConfig) c.Assert(err, check.IsNil) source2Name := task.SourceConfig.SourceConf[1].SourceName sourceCfg2.SourceID = source2Name @@ -256,7 +256,7 @@ func (t *testConfig) TestSubTaskConfigsToOpenAPITask(c *check.C) { func testNoShardSubTaskConfigsToOpenAPITask(c *check.C) { task, err := fixtures.GenNoShardOpenAPITaskForTest() c.Assert(err, check.IsNil) - sourceCfg1, err := LoadFromFile(sourceSampleFile) + sourceCfg1, err := ParseYaml(SampleSourceConfig) c.Assert(err, check.IsNil) source1Name := task.SourceConfig.SourceConf[0].SourceName sourceCfg1.SourceID = task.SourceConfig.SourceConf[0].SourceName @@ -286,11 +286,11 @@ func testNoShardSubTaskConfigsToOpenAPITask(c *check.C) { func testShardAndFilterSubTaskConfigsToOpenAPITask(c *check.C) { task, err := fixtures.GenShardAndFilterOpenAPITaskForTest() c.Assert(err, check.IsNil) - sourceCfg1, err := LoadFromFile(sourceSampleFile) + sourceCfg1, err := ParseYaml(SampleSourceConfig) c.Assert(err, check.IsNil) source1Name := task.SourceConfig.SourceConf[0].SourceName sourceCfg1.SourceID = source1Name - sourceCfg2, err := LoadFromFile(sourceSampleFile) + sourceCfg2, err := ParseYaml(SampleSourceConfig) c.Assert(err, check.IsNil) source2Name := task.SourceConfig.SourceConf[1].SourceName sourceCfg2.SourceID = source2Name diff --git a/dm/dm/ctl/master/operate_source.go b/dm/dm/ctl/master/operate_source.go index bba20d1c7b8..2841fec3e7a 100644 --- a/dm/dm/ctl/master/operate_source.go +++ b/dm/dm/ctl/master/operate_source.go @@ -65,7 +65,7 @@ func operateSourceFunc(cmd *cobra.Command, _ []string) error { } if printSampleConfig { - fmt.Println(config.SampleConfigFile) + fmt.Println(config.SampleSourceConfig) return nil } diff --git a/dm/dm/master/bootstrap_test.go b/dm/dm/master/bootstrap_test.go index d4daaec6bd5..fc1a93ee856 100644 --- a/dm/dm/master/bootstrap_test.go +++ b/dm/dm/master/bootstrap_test.go @@ -33,11 +33,6 @@ import ( "github.com/pingcap/tiflow/dm/pkg/terror" ) -const ( - // do not forget to update this path if the file removed/renamed. - subTaskSampleFile = "../worker/subtask.toml" -) - func (t *testMaster) TestCollectSourceConfigFilesV1Import(c *C) { s := testDefaultMasterServer(c) defer s.Close() @@ -67,7 +62,7 @@ func (t *testMaster) TestCollectSourceConfigFilesV1Import(c *C) { } password := os.Getenv("MYSQL_PSWD") - cfg1, err := config.LoadFromFile("./source.yaml") + cfg1, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) // fix empty map after marshal/unmarshal becomes nil cfg1.From.Adjust() @@ -124,7 +119,7 @@ func (t *testMaster) TestWaitWorkersReadyV1Import(c *C) { s.cfg.V1SourcesPath = c.MkDir() c.Assert(s.scheduler.Start(ctx, t.etcdTestCli), IsNil) - cfg1, err := config.LoadFromFile("./source.yaml") + cfg1, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) cfg2 := cfg1.Clone() cfg2.SourceID = "mysql-replica-02" @@ -179,7 +174,7 @@ func (t *testMaster) TestSubtaskCfgsStagesV1Import(c *C) { ) cfg11 := config.NewSubTaskConfig() - c.Assert(cfg11.DecodeFile(subTaskSampleFile, true), IsNil) + c.Assert(cfg11.Decode(config.SampleSubtaskConfig, true), IsNil) cfg11.Dir = "./dump_data" cfg11.ChunkFilesize = "64" cfg11.Name = taskName1 diff --git a/dm/dm/master/config.go b/dm/dm/master/config.go index f1315edba78..e2b70a9e184 100644 --- a/dm/dm/master/config.go +++ b/dm/dm/master/config.go @@ -48,9 +48,9 @@ const ( quotaBackendBytesLowerBound = 500 * 1024 * 1024 // 500MB ) -// SampleConfigFile is sample config file of dm-master. +// SampleConfig is sample config of dm-master. //go:embed dm-master.toml -var SampleConfigFile string +var SampleConfig string // NewConfig creates a config for dm-master. func NewConfig() *Config { @@ -178,7 +178,7 @@ func (c *Config) Parse(arguments []string) error { } if c.printSampleConfig { - fmt.Println(SampleConfigFile) + fmt.Println(SampleConfig) return flag.ErrHelp } @@ -220,6 +220,23 @@ func (c *Config) configFromFile(path string) error { return nil } +// FromContent loads config from TOML format content. +func (c *Config) FromContent(content string) error { + metaData, err := toml.Decode(content, c) + if err != nil { + return terror.ErrMasterConfigTomlTransform.Delegate(err) + } + undecoded := metaData.Undecoded() + if len(undecoded) > 0 { + var undecodedItems []string + for _, item := range undecoded { + undecodedItems = append(undecodedItems, item.String()) + } + return terror.ErrMasterConfigUnknownItem.Generate(strings.Join(undecodedItems, ",")) + } + return nil +} + // adjust adjusts configs. func (c *Config) adjust() error { c.MasterAddr = utils.UnwrapScheme(c.MasterAddr) diff --git a/dm/dm/master/config_test.go b/dm/dm/master/config_test.go index f3378f82d67..5e508e814d7 100644 --- a/dm/dm/master/config_test.go +++ b/dm/dm/master/config_test.go @@ -56,16 +56,10 @@ func (t *testConfigSuite) TestPrintSampleConfig(c *check.C) { func (t *testConfigSuite) TestConfig(c *check.C) { var ( - err error - cfg = &Config{} - masterAddr = ":8261" - advertiseAddr = "127.0.0.1:8261" - name = "dm-master" - dataDir = "default.dm-master" - peerURLs = "http://127.0.0.1:8291" - advertisePeerURLs = "http://127.0.0.1:8291" - initialCluster = "dm-master=http://127.0.0.1:8291" - cases = []struct { + err error + cfg = &Config{} + masterAddr = ":8261" + cases = []struct { args []string hasError bool errorReg string @@ -85,11 +79,6 @@ func (t *testConfigSuite) TestConfig(c *check.C) { true, ".*'invalid' is an invalid flag.*", }, - { - []string{"--config=./dm-master.toml"}, - false, - "", - }, } ) @@ -103,19 +92,6 @@ func (t *testConfigSuite) TestConfig(c *check.C) { err = cfg.Parse(tc.args) if tc.hasError { c.Assert(err, check.ErrorMatches, tc.errorReg) - } else { - c.Assert(cfg.MasterAddr, check.Equals, masterAddr) - c.Assert(cfg.AdvertiseAddr, check.Equals, advertiseAddr) - c.Assert(cfg.Name, check.Equals, name) - c.Assert(cfg.DataDir, check.Equals, dataDir) - c.Assert(cfg.PeerUrls, check.Equals, peerURLs) - c.Assert(cfg.AdvertisePeerUrls, check.Equals, advertisePeerURLs) - c.Assert(cfg.InitialCluster, check.Equals, initialCluster) - c.Assert(cfg.InitialClusterState, check.Equals, embed.ClusterStateFlagNew) - c.Assert(cfg.Join, check.Equals, "") - c.Assert(cfg.String(), check.Matches, fmt.Sprintf("{.*master-addr\":\"%s\".*}", masterAddr)) - c.Assert(cfg.ExperimentalFeatures.OpenAPI, check.Equals, false) - c.Assert(cfg.OpenAPI, check.Equals, false) } } } diff --git a/dm/dm/master/election_test.go b/dm/dm/master/election_test.go index a521611f0f5..8c52ddb4a0c 100644 --- a/dm/dm/master/election_test.go +++ b/dm/dm/master/election_test.go @@ -47,7 +47,7 @@ func (t *testElectionSuite) TestFailToStartLeader(c *check.C) { // create a new cluster cfg1 := NewConfig() - c.Assert(cfg1.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg1.FromContent(SampleConfig), check.IsNil) cfg1.Name = "dm-master-1" cfg1.DataDir = c.MkDir() cfg1.MasterAddr = tempurl.Alloc()[len("http://"):] @@ -65,7 +65,7 @@ func (t *testElectionSuite) TestFailToStartLeader(c *check.C) { // join to an existing cluster cfg2 := NewConfig() - c.Assert(cfg2.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg2.FromContent(SampleConfig), check.IsNil) cfg2.Name = "dm-master-2" cfg2.DataDir = c.MkDir() cfg2.MasterAddr = tempurl.Alloc()[len("http://"):] diff --git a/dm/dm/master/etcd_test.go b/dm/dm/master/etcd_test.go index e20ec8ed045..3d63c91fe6e 100644 --- a/dm/dm/master/etcd_test.go +++ b/dm/dm/master/etcd_test.go @@ -227,7 +227,7 @@ func (t *testEtcdSuite) TestIsDirExist(c *check.C) { func (t *testEtcdSuite) TestEtcdAutoCompaction(c *check.C) { cfg := NewConfig() - c.Assert(cfg.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg.FromContent(SampleConfig), check.IsNil) cfg.DataDir = c.MkDir() cfg.MasterAddr = tempurl.Alloc()[len("http://"):] diff --git a/dm/dm/master/openapi_view_test.go b/dm/dm/master/openapi_view_test.go index 824648653f2..3f77e73d061 100644 --- a/dm/dm/master/openapi_view_test.go +++ b/dm/dm/master/openapi_view_test.go @@ -82,7 +82,7 @@ func (t *openAPISuite) TestRedirectRequestToLeader(c *check.C) { // create a new cluster cfg1 := NewConfig() - c.Assert(cfg1.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg1.FromContent(SampleConfig), check.IsNil) cfg1.Name = "dm-master-1" cfg1.DataDir = c.MkDir() cfg1.MasterAddr = tempurl.Alloc()[len("http://"):] @@ -104,7 +104,7 @@ func (t *openAPISuite) TestRedirectRequestToLeader(c *check.C) { // join to an existing cluster cfg2 := NewConfig() - c.Assert(cfg2.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg2.FromContent(SampleConfig), check.IsNil) cfg2.Name = "dm-master-2" cfg2.DataDir = c.MkDir() cfg2.MasterAddr = tempurl.Alloc()[len("http://"):] @@ -143,7 +143,7 @@ func (t *openAPISuite) TestRedirectRequestToLeader(c *check.C) { func (t *openAPISuite) TestOpenAPIWillNotStartInDefaultConfig(c *check.C) { // create a new cluster cfg1 := NewConfig() - c.Assert(cfg1.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg1.FromContent(SampleConfig), check.IsNil) cfg1.Name = "dm-master-1" cfg1.DataDir = c.MkDir() cfg1.MasterAddr = tempurl.Alloc()[len("http://"):] @@ -627,7 +627,7 @@ func (t *openAPISuite) TestClusterAPI(c *check.C) { // join a new master node to an existing cluster cfg2 := NewConfig() - c.Assert(cfg2.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg2.FromContent(SampleConfig), check.IsNil) cfg2.Name = "dm-master-2" cfg2.DataDir = c.MkDir() cfg2.MasterAddr = tempurl.Alloc()[len("http://"):] @@ -823,7 +823,7 @@ func setupTestServer(ctx context.Context, t *testing.T) *Server { t.Helper() // create a new cluster cfg1 := NewConfig() - require.Nil(t, cfg1.Parse([]string{"-config=./dm-master.toml"})) + require.NoError(t, cfg1.FromContent(SampleConfig)) cfg1.Name = "dm-master-1" cfg1.DataDir = t.TempDir() cfg1.MasterAddr = tempurl.Alloc()[len("http://"):] diff --git a/dm/dm/master/scheduler/scheduler_test.go b/dm/dm/master/scheduler/scheduler_test.go index 923e13d3f07..75a4d5cfc9f 100644 --- a/dm/dm/master/scheduler/scheduler_test.go +++ b/dm/dm/master/scheduler/scheduler_test.go @@ -35,13 +35,6 @@ import ( "github.com/pingcap/tiflow/dm/pkg/utils" ) -const ( - // do not forget to update this path if the file removed/renamed. - sourceSampleFile = "../../worker/source.yaml" - // do not forget to update this path if the file removed/renamed. - subTaskSampleFile = "../../worker/subtask.toml" -) - const ( noRestart = iota // do nothing in rebuildPessimist, just keep testing restartOnly // restart without building new instance. mock leader role transfer @@ -117,13 +110,13 @@ func (t *testScheduler) testSchedulerProgress(c *C, restart int) { } } ) - sourceCfg1, err := config.LoadFromFile(sourceSampleFile) + sourceCfg1, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg1.SourceID = sourceID1 sourceCfg2 := *sourceCfg1 sourceCfg2.SourceID = sourceID2 - c.Assert(subtaskCfg1.DecodeFile(subTaskSampleFile, true), IsNil) + c.Assert(subtaskCfg1.Decode(config.SampleSubtaskConfig, true), IsNil) subtaskCfg1.SourceID = sourceID1 subtaskCfg1.Name = taskName1 c.Assert(subtaskCfg1.Adjust(true), IsNil) @@ -814,7 +807,7 @@ func (t *testScheduler) TestRestartScheduler(c *C) { wg sync.WaitGroup keepAliveTTL = int64(2) // NOTE: this should be >= minLeaseTTL, in second. ) - sourceCfg1, err := config.LoadFromFile(sourceSampleFile) + sourceCfg1, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg1.SourceID = sourceID1 @@ -975,7 +968,7 @@ func (t *testScheduler) TestWatchWorkerEventEtcdCompact(c *C) { workerAddr4 = "127.0.0.1:18462" keepAliveTTL = int64(2) // NOTE: this should be >= minLeaseTTL, in second. ) - sourceCfg1, err := config.LoadFromFile(sourceSampleFile) + sourceCfg1, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg1.SourceID = sourceID1 sourceCfg2 := *sourceCfg1 @@ -1115,7 +1108,7 @@ func (t *testScheduler) TestLastBound(c *C) { workerName4 = "dm-worker-4" ) - sourceCfg1, err := config.LoadFromFile(sourceSampleFile) + sourceCfg1, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg1.SourceID = sourceID1 sourceCfg2 := sourceCfg1 @@ -1188,7 +1181,7 @@ func (t *testScheduler) TestInvalidLastBound(c *C) { workerName1 = "dm-worker-1" ) - sourceCfg1, err := config.LoadFromFile(sourceSampleFile) + sourceCfg1, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg1.SourceID = sourceID1 sourceCfg2 := sourceCfg1 @@ -1871,7 +1864,7 @@ func (t *testScheduler) TestWorkerHasDiffRelayAndBound(c *C) { Worker: workerName1, } - sourceCfg, err := config.LoadFromFile("../source.yaml") + sourceCfg, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg.Checker.BackoffMax = config.Duration{Duration: 5 * time.Second} @@ -1930,7 +1923,7 @@ func (t *testScheduler) TestUpgradeCauseConflictRelayType(c *C) { Worker: workerName1, } - sourceCfg, err := config.LoadFromFile("../source.yaml") + sourceCfg, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg.Checker.BackoffMax = config.Duration{Duration: 5 * time.Second} @@ -1987,7 +1980,7 @@ func (t *testScheduler) TestOperateValidatorTask(c *C) { keepAlive = int64(2) subtaskCfg config.SubTaskConfig ) - c.Assert(subtaskCfg.DecodeFile(subTaskSampleFile, true), IsNil) + c.Assert(subtaskCfg.Decode(config.SampleSubtaskConfig, true), IsNil) subtaskCfg.SourceID = sourceID1 subtaskCfg.Name = taskName subtaskCfg.ValidatorCfg = config.ValidatorConfig{Mode: config.ValidationNone} @@ -1998,7 +1991,7 @@ func (t *testScheduler) TestOperateValidatorTask(c *C) { Source: sourceID1, Worker: workerName1, } - sourceCfg, err := config.LoadFromFile("../source.yaml") + sourceCfg, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) s.etcdCli = etcdTestCli sourceCfg.SourceID = sourceID1 diff --git a/dm/dm/master/server_test.go b/dm/dm/master/server_test.go index 754b7fee5c0..a44c10055a3 100644 --- a/dm/dm/master/server_test.go +++ b/dm/dm/master/server_test.go @@ -345,7 +345,7 @@ func makeWorkerClientsForHandle(ctrl *gomock.Controller, taskName string, source func testDefaultMasterServer(c *check.C) *Server { cfg := NewConfig() - err := cfg.Parse([]string{"-config=./dm-master.toml"}) + err := cfg.FromContent(SampleConfig) c.Assert(err, check.IsNil) cfg.DataDir = c.MkDir() server := NewServer(cfg) @@ -432,7 +432,7 @@ func (t *testMaster) testMockSchedulerForRelay(ctx context.Context, wg *sync.Wai func generateServerConfig(c *check.C, name string) *Config { // create a new cluster cfg1 := NewConfig() - c.Assert(cfg1.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg1.FromContent(SampleConfig), check.IsNil) cfg1.Name = name cfg1.DataDir = c.MkDir() cfg1.MasterAddr = tempurl.Alloc()[len("http://"):] @@ -1368,7 +1368,7 @@ func (t *testMaster) TestOperateWorkerRelayTask(c *check.C) { func (t *testMaster) TestServer(c *check.C) { var err error cfg := NewConfig() - c.Assert(cfg.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg.FromContent(SampleConfig), check.IsNil) cfg.PeerUrls = "http://127.0.0.1:8294" cfg.DataDir = c.MkDir() cfg.MasterAddr = tempurl.Alloc()[len("http://"):] @@ -1624,7 +1624,7 @@ func (t *testMaster) TestJoinMember(c *check.C) { // create a new cluster cfg1 := NewConfig() - c.Assert(cfg1.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg1.FromContent(SampleConfig), check.IsNil) cfg1.Name = "dm-master-1" cfg1.DataDir = c.MkDir() cfg1.MasterAddr = tempurl.Alloc()[len("http://"):] @@ -1644,7 +1644,7 @@ func (t *testMaster) TestJoinMember(c *check.C) { // join to an existing cluster cfg2 := NewConfig() - c.Assert(cfg2.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg2.FromContent(SampleConfig), check.IsNil) cfg2.Name = "dm-master-2" cfg2.DataDir = c.MkDir() cfg2.MasterAddr = tempurl.Alloc()[len("http://"):] @@ -1679,7 +1679,7 @@ func (t *testMaster) TestJoinMember(c *check.C) { c.Assert(leaderID, check.Equals, cfg1.Name) cfg3 := NewConfig() - c.Assert(cfg3.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg3.FromContent(SampleConfig), check.IsNil) cfg3.Name = "dm-master-3" cfg3.DataDir = c.MkDir() cfg3.MasterAddr = tempurl.Alloc()[len("http://"):] diff --git a/dm/dm/worker/server_test.go b/dm/dm/worker/server_test.go index 5074dd60474..fa00b4b2c8f 100644 --- a/dm/dm/worker/server_test.go +++ b/dm/dm/worker/server_test.go @@ -45,9 +45,7 @@ import ( // do not forget to update this path if the file removed/renamed. const ( - sourceSampleFile = "./source.yaml" - subtaskSampleFile = "./subtask.toml" - mydumperPath = "../../bin/mydumper" + mydumperPath = "../../bin/mydumper" ) var etcdErrCompacted = v3rpc.ErrCompacted @@ -165,7 +163,7 @@ func (t *testServer) TestServer(c *C) { // start task subtaskCfg := config.SubTaskConfig{} - err = subtaskCfg.DecodeFile(subtaskSampleFile, true) + err = subtaskCfg.Decode(config.SampleSubtaskConfig, true) c.Assert(err, IsNil) subtaskCfg.MydumperPath = mydumperPath @@ -637,7 +635,7 @@ func checkRelayStatus(cli pb.WorkerClient, expect pb.Stage) bool { } func loadSourceConfigWithoutPassword(c *C) *config.SourceConfig { - sourceCfg, err := config.LoadFromFile(sourceSampleFile) + sourceCfg, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg.From.Password = "" // no password set return sourceCfg diff --git a/dm/dm/worker/source_worker_test.go b/dm/dm/worker/source_worker_test.go index ea9115c8d37..288b3b8fd97 100644 --- a/dm/dm/worker/source_worker_test.go +++ b/dm/dm/worker/source_worker_test.go @@ -201,7 +201,7 @@ func (t *testServer2) TestTaskAutoResume(c *C) { }), IsTrue) // start task var subtaskCfg config.SubTaskConfig - c.Assert(subtaskCfg.DecodeFile("./subtask.toml", true), IsNil) + c.Assert(subtaskCfg.Decode(config.SampleSubtaskConfig, true), IsNil) c.Assert(err, IsNil) subtaskCfg.Mode = "full" subtaskCfg.Timezone = "UTC" @@ -296,7 +296,7 @@ func (t *testWorkerFunctionalities) TestWorkerFunctionalities(c *C) { sourceCfg.EnableRelay = false subtaskCfg := config.SubTaskConfig{} - err = subtaskCfg.DecodeFile(subtaskSampleFile, true) + err = subtaskCfg.Decode(config.SampleSubtaskConfig, true) c.Assert(err, IsNil) // start worker @@ -483,7 +483,7 @@ func (t *testWorkerEtcdCompact) TestWatchSubtaskStageEtcdCompact(c *C) { }), IsTrue) // step 2: Put a subtask config and subtask stage to this source, then delete it subtaskCfg := config.SubTaskConfig{} - err = subtaskCfg.DecodeFile(subtaskSampleFile, true) + err = subtaskCfg.Decode(config.SampleSubtaskConfig, true) c.Assert(err, IsNil) subtaskCfg.MydumperPath = mydumperPath @@ -603,7 +603,7 @@ func (t *testWorkerEtcdCompact) TestWatchValidatorStageEtcdCompact(c *C) { // // step 2: Put a subtask config and subtask stage to this source, then delete it subtaskCfg := config.SubTaskConfig{} - err = subtaskCfg.DecodeFile(subtaskSampleFile, true) + err = subtaskCfg.Decode(config.SampleSubtaskConfig, true) c.Assert(err, IsNil) subtaskCfg.MydumperPath = mydumperPath subtaskCfg.ValidatorCfg = config.ValidatorConfig{Mode: config.ValidationNone} diff --git a/dm/dm/worker/utils_test.go b/dm/dm/worker/utils_test.go index 1bc5cdad969..c77416d27c3 100644 --- a/dm/dm/worker/utils_test.go +++ b/dm/dm/worker/utils_test.go @@ -34,7 +34,7 @@ func TestGetExpectValidatorStage(t *testing.T) { require.Nil(t, ha.ClearTestInfoOperation(etcdTestCli)) }() cfg := config.SubTaskConfig{} - require.Nil(t, cfg.DecodeFile("subtask.toml", true)) + require.Nil(t, cfg.Decode(config.SampleSubtaskConfig, true)) source := cfg.SourceID task := cfg.Name stage := ha.NewSubTaskStage(pb.Stage_Running, source, task) diff --git a/dm/pkg/ha/ops_test.go b/dm/pkg/ha/ops_test.go index a4295a807a4..1818f6436f7 100644 --- a/dm/pkg/ha/ops_test.go +++ b/dm/pkg/ha/ops_test.go @@ -41,7 +41,7 @@ func (t *testForEtcd) TestOpsEtcd(c *C) { sourceCfg, err := config.LoadFromFile(sourceSampleFilePath) c.Assert(err, IsNil) sourceCfg.SourceID = source - c.Assert(subtaskCfg1.DecodeFile(subTaskSampleFile, true), IsNil) + c.Assert(subtaskCfg1.Decode(config.SampleSubtaskConfig, true), IsNil) subtaskCfg1.SourceID = source subtaskCfg1.Name = task1 c.Assert(subtaskCfg1.Adjust(true), IsNil) diff --git a/dm/pkg/ha/stage_test.go b/dm/pkg/ha/stage_test.go index 946dea993fb..1fe6d2ecabb 100644 --- a/dm/pkg/ha/stage_test.go +++ b/dm/pkg/ha/stage_test.go @@ -218,7 +218,7 @@ func (t *testForEtcd) TestGetSubTaskStageConfigEtcd(c *C) { defer clearTestInfoOperation(c) cfg := config.SubTaskConfig{} - c.Assert(cfg.DecodeFile(subTaskSampleFile, true), IsNil) + c.Assert(cfg.Decode(config.SampleSubtaskConfig, true), IsNil) source := cfg.SourceID task := cfg.Name stage := NewSubTaskStage(pb.Stage_Running, source, task) diff --git a/dm/pkg/ha/subtask_test.go b/dm/pkg/ha/subtask_test.go index 5dc537bc131..a2a8fd71042 100644 --- a/dm/pkg/ha/subtask_test.go +++ b/dm/pkg/ha/subtask_test.go @@ -15,22 +15,19 @@ package ha import ( "context" + "os" . "github.com/pingcap/check" "github.com/pingcap/tiflow/dm/dm/config" ) -const ( - // do not forget to update this path if the file removed/renamed. - subTaskSampleFile = "../../dm/worker/subtask.toml" -) - func (t *testForEtcd) TestSubTaskEtcd(c *C) { defer clearTestInfoOperation(c) + println(os.Getwd()) cfg1 := config.SubTaskConfig{} - c.Assert(cfg1.DecodeFile(subTaskSampleFile, true), IsNil) + c.Assert(cfg1.Decode(config.SampleSubtaskConfig, true), IsNil) source := cfg1.SourceID taskName1 := cfg1.Name From deb82264c57bbe40051b3bac91c4642a17eb0696 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Fri, 4 Mar 2022 10:51:21 +0800 Subject: [PATCH 08/11] fix many unit tests Signed-off-by: lance6716 --- dm/dm/config/source_config.go | 13 ++--- dm/dm/config/source_converter_test.go | 2 + dm/dm/master/config.go | 2 +- dm/dm/master/config_test.go | 19 +++---- dm/dm/master/election_test.go | 1 + dm/dm/master/server_test.go | 73 +++++++++++++++------------ dm/pkg/upgrade/upgrade_test.go | 47 +++++++++++++---- 7 files changed, 95 insertions(+), 62 deletions(-) diff --git a/dm/dm/config/source_config.go b/dm/dm/config/source_config.go index d49309d173a..a88e62270fb 100644 --- a/dm/dm/config/source_config.go +++ b/dm/dm/config/source_config.go @@ -167,6 +167,9 @@ func ParseYaml(content string) (*SourceConfig, error) { return nil, terror.ErrConfigYamlTransform.Delegate(err, "decode source config") } c.adjust() + if err := c.Verify(); err != nil { + return nil, err + } return c, nil } @@ -348,19 +351,11 @@ func (c *SourceConfig) AdjustServerID(ctx context.Context, db *sql.DB) error { // LoadFromFile loads config from file. func LoadFromFile(path string) (*SourceConfig, error) { - c := newSourceConfig() content, err := os.ReadFile(path) if err != nil { return nil, terror.ErrConfigReadCfgFromFile.Delegate(err, path) } - if err = yaml.UnmarshalStrict(content, c); err != nil { - return nil, terror.ErrConfigYamlTransform.Delegate(err, "decode source config") - } - c.adjust() - if err = c.Verify(); err != nil { - return nil, err - } - return c, nil + return ParseYaml(string(content)) } func (c *SourceConfig) check(metaData *toml.MetaData, err error) error { diff --git a/dm/dm/config/source_converter_test.go b/dm/dm/config/source_converter_test.go index ec4e36ddaaf..500ddfc3948 100644 --- a/dm/dm/config/source_converter_test.go +++ b/dm/dm/config/source_converter_test.go @@ -29,6 +29,8 @@ func (t *testConfig) TestConverterWithSourceAndOpenAPISource(c *check.C) { // we need set ServerID and MaxAllowedPacket manually, because user don't need to config those field in openapi sourceCfg2.ServerID = sourceCfg1.ServerID sourceCfg2.From.MaxAllowedPacket = sourceCfg1.From.MaxAllowedPacket + // TODO: OpenAPI source config will add flavor + sourceCfg1.Flavor = "" // we only need to make sure the source config that user can see is the same as the source config that user create c.Assert(sourceCfg1.String(), check.Equals, sourceCfg2.String()) diff --git a/dm/dm/master/config.go b/dm/dm/master/config.go index e2b70a9e184..479249e13e4 100644 --- a/dm/dm/master/config.go +++ b/dm/dm/master/config.go @@ -234,7 +234,7 @@ func (c *Config) FromContent(content string) error { } return terror.ErrMasterConfigUnknownItem.Generate(strings.Join(undecodedItems, ",")) } - return nil + return c.adjust() } // adjust adjusts configs. diff --git a/dm/dm/master/config_test.go b/dm/dm/master/config_test.go index 5e508e814d7..8df774d3f2c 100644 --- a/dm/dm/master/config_test.go +++ b/dm/dm/master/config_test.go @@ -30,8 +30,7 @@ import ( ) var ( - defaultConfigFile = "./dm-master.toml" - _ = check.Suite(&testConfigSuite{}) + _ = check.Suite(&testConfigSuite{}) ) type testConfigSuite struct{} @@ -42,16 +41,13 @@ func (t *testConfigSuite) SetUpSuite(c *check.C) { } func (t *testConfigSuite) TestPrintSampleConfig(c *check.C) { - buf, err := os.ReadFile(defaultConfigFile) - c.Assert(err, check.IsNil) - // test print sample config out := capturer.CaptureStdout(func() { cfg := NewConfig() - err = cfg.Parse([]string{"-print-sample-config"}) + err := cfg.Parse([]string{"-print-sample-config"}) c.Assert(err, check.ErrorMatches, flag.ErrHelp.Error()) }) - c.Assert(strings.TrimSpace(out), check.Equals, strings.TrimSpace(string(buf))) + c.Assert(strings.TrimSpace(out), check.Equals, strings.TrimSpace(SampleConfig)) } func (t *testConfigSuite) TestConfig(c *check.C) { @@ -82,7 +78,8 @@ func (t *testConfigSuite) TestConfig(c *check.C) { } ) - cfg.ConfigFile = defaultConfigFile + err = cfg.FromContent(SampleConfig) + c.Assert(err, check.IsNil) err = cfg.Reload() c.Assert(err, check.IsNil) c.Assert(cfg.MasterAddr, check.Equals, masterAddr) @@ -259,7 +256,7 @@ func (t *testConfigSuite) TestParseURLs(c *check.C) { func (t *testConfigSuite) TestAdjustAddr(c *check.C) { cfg := NewConfig() - c.Assert(cfg.configFromFile(defaultConfigFile), check.IsNil) + c.Assert(cfg.FromContent(SampleConfig), check.IsNil) c.Assert(cfg.adjust(), check.IsNil) // invalid `advertise-addr` @@ -279,14 +276,14 @@ func (t *testConfigSuite) TestAdjustAddr(c *check.C) { func (t *testConfigSuite) TestAdjustOpenAPI(c *check.C) { cfg := NewConfig() - c.Assert(cfg.configFromFile(defaultConfigFile), check.IsNil) + c.Assert(cfg.FromContent(SampleConfig), check.IsNil) c.Assert(cfg.adjust(), check.IsNil) // test default value c.Assert(cfg.OpenAPI, check.Equals, false) c.Assert(cfg.ExperimentalFeatures.OpenAPI, check.Equals, false) - // adjust openapi from experimental-features + // adjust openapi from experimental-features cfg.ExperimentalFeatures.OpenAPI = true c.Assert(cfg.adjust(), check.IsNil) c.Assert(cfg.OpenAPI, check.Equals, true) diff --git a/dm/dm/master/election_test.go b/dm/dm/master/election_test.go index 8c52ddb4a0c..a6f42148913 100644 --- a/dm/dm/master/election_test.go +++ b/dm/dm/master/election_test.go @@ -57,6 +57,7 @@ func (t *testElectionSuite) TestFailToStartLeader(c *check.C) { cfg1.InitialCluster = fmt.Sprintf("%s=%s", cfg1.Name, cfg1.AdvertisePeerUrls) s1 = NewServer(cfg1) + println(s1.cfg.InitialClusterState) c.Assert(s1.Start(ctx), check.IsNil) // wait the first one become the leader c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { diff --git a/dm/dm/master/server_test.go b/dm/dm/master/server_test.go index a44c10055a3..9eeeea2a998 100644 --- a/dm/dm/master/server_test.go +++ b/dm/dm/master/server_test.go @@ -168,13 +168,20 @@ type testMaster struct { etcdTestCli *clientv3.Client } -var testSuite = check.Suite(&testMaster{}) +var ( + testSuite = check.Suite(&testMaster{}) + pwd string +) func TestMaster(t *testing.T) { err := log.InitLogger(&log.Config{}) if err != nil { t.Fatal(err) } + pwd, err = os.Getwd() + if err != nil { + t.Fatal(err) + } integration.BeforeTestExternal(t) // inject *testing.T to testMaster s := testSuite.(*testMaster) @@ -1412,6 +1419,10 @@ func (t *testMaster) TestMasterTLS(c *check.C) { _, peerPort, err := net.SplitHostPort(peerAddr) c.Assert(err, check.IsNil) + caPath := pwd + "/tls_for_test/ca.pem" + certPath := pwd + "/tls_for_test/dm.pem" + keyPath := pwd + "/tls_for_test/dm.key" + // all with `https://` prefix cfg := NewConfig() c.Assert(cfg.Parse([]string{ @@ -1422,9 +1433,9 @@ func (t *testMaster) TestMasterTLS(c *check.C) { fmt.Sprintf("--peer-urls=https://%s", peerAddr), fmt.Sprintf("--advertise-peer-urls=https://%s", peerAddr), fmt.Sprintf("--initial-cluster=master-tls=https://%s", peerAddr), - "--ssl-ca=./tls_for_test/ca.pem", - "--ssl-cert=./tls_for_test/dm.pem", - "--ssl-key=./tls_for_test/dm.key", + "--ssl-ca=" + caPath, + "--ssl-cert=" + certPath, + "--ssl-key=" + keyPath, }), check.IsNil) t.testTLSPrefix(c, cfg) c.Assert(cfg.MasterAddr, check.Equals, masterAddr) @@ -1443,9 +1454,9 @@ func (t *testMaster) TestMasterTLS(c *check.C) { fmt.Sprintf("--peer-urls=https://%s", peerAddr), fmt.Sprintf("--advertise-peer-urls=https://%s", peerAddr), fmt.Sprintf("--initial-cluster=master-tls=https://%s", peerAddr), - "--ssl-ca=./tls_for_test/ca.pem", - "--ssl-cert=./tls_for_test/dm.pem", - "--ssl-key=./tls_for_test/dm.key", + "--ssl-ca=" + caPath, + "--ssl-cert=" + certPath, + "--ssl-key=" + keyPath, }), check.IsNil) t.testTLSPrefix(c, cfg) @@ -1459,9 +1470,9 @@ func (t *testMaster) TestMasterTLS(c *check.C) { fmt.Sprintf("--peer-urls=https://%s", peerAddr), fmt.Sprintf("--advertise-peer-urls=https://%s", peerAddr), fmt.Sprintf("--initial-cluster=master-tls=https://%s", peerAddr), - "--ssl-ca=./tls_for_test/ca.pem", - "--ssl-cert=./tls_for_test/dm.pem", - "--ssl-key=./tls_for_test/dm.key", + "--ssl-ca=" + caPath, + "--ssl-cert=" + certPath, + "--ssl-key=" + keyPath, }), check.IsNil) t.testTLSPrefix(c, cfg) @@ -1475,9 +1486,9 @@ func (t *testMaster) TestMasterTLS(c *check.C) { fmt.Sprintf("--peer-urls=%s", peerAddr), fmt.Sprintf("--advertise-peer-urls=https://%s", peerAddr), fmt.Sprintf("--initial-cluster=master-tls=https://%s", peerAddr), - "--ssl-ca=./tls_for_test/ca.pem", - "--ssl-cert=./tls_for_test/dm.pem", - "--ssl-key=./tls_for_test/dm.key", + "--ssl-ca=" + caPath, + "--ssl-cert=" + certPath, + "--ssl-key=" + keyPath, }), check.IsNil) t.testTLSPrefix(c, cfg) @@ -1491,9 +1502,9 @@ func (t *testMaster) TestMasterTLS(c *check.C) { fmt.Sprintf("--peer-urls=%s", peerAddr), fmt.Sprintf("--advertise-peer-urls=%s", peerAddr), fmt.Sprintf("--initial-cluster=master-tls=https://%s", peerAddr), - "--ssl-ca=./tls_for_test/ca.pem", - "--ssl-cert=./tls_for_test/dm.pem", - "--ssl-key=./tls_for_test/dm.key", + "--ssl-ca=" + caPath, + "--ssl-cert=" + certPath, + "--ssl-key=" + keyPath, }), check.IsNil) t.testTLSPrefix(c, cfg) @@ -1507,9 +1518,9 @@ func (t *testMaster) TestMasterTLS(c *check.C) { fmt.Sprintf("--peer-urls=%s", peerAddr), fmt.Sprintf("--advertise-peer-urls=%s", peerAddr), fmt.Sprintf("--initial-cluster=master-tls=%s", peerAddr), - "--ssl-ca=./tls_for_test/ca.pem", - "--ssl-cert=./tls_for_test/dm.pem", - "--ssl-key=./tls_for_test/dm.key", + "--ssl-ca=" + caPath, + "--ssl-cert=" + certPath, + "--ssl-key=" + keyPath, }), check.IsNil) t.testTLSPrefix(c, cfg) c.Assert(cfg.MasterAddr, check.Equals, masterAddr) @@ -1528,9 +1539,9 @@ func (t *testMaster) TestMasterTLS(c *check.C) { fmt.Sprintf("--peer-urls=http://%s", peerAddr), fmt.Sprintf("--advertise-peer-urls=http://%s", peerAddr), fmt.Sprintf("--initial-cluster=master-tls=http://%s", peerAddr), - "--ssl-ca=./tls_for_test/ca.pem", - "--ssl-cert=./tls_for_test/dm.pem", - "--ssl-key=./tls_for_test/dm.key", + "--ssl-ca=" + caPath, + "--ssl-cert=" + certPath, + "--ssl-key=" + keyPath, }), check.IsNil) c.Assert(cfg.MasterAddr, check.Equals, masterAddr) c.Assert(cfg.AdvertiseAddr, check.Equals, masterAddr) @@ -1548,9 +1559,9 @@ func (t *testMaster) TestMasterTLS(c *check.C) { fmt.Sprintf("--peer-urls=https://%s", peerAddr), fmt.Sprintf("--advertise-peer-urls=https://%s", peerAddr), fmt.Sprintf("--initial-cluster=master-tls=http://%s", peerAddr), - "--ssl-ca=./tls_for_test/ca.pem", - "--ssl-cert=./tls_for_test/dm.pem", - "--ssl-key=./tls_for_test/dm.key", + "--ssl-ca=" + caPath, + "--ssl-cert=" + certPath, + "--ssl-key=" + keyPath, }), check.IsNil) c.Assert(cfg.MasterAddr, check.Equals, masterAddr) c.Assert(cfg.AdvertiseAddr, check.Equals, masterAddr) @@ -1569,9 +1580,9 @@ func (t *testMaster) TestMasterTLS(c *check.C) { fmt.Sprintf("--peer-urls=0.0.0.0:%s", peerPort), fmt.Sprintf("--advertise-peer-urls=https://%s", peerAddr), fmt.Sprintf("--initial-cluster=master-tls=https://%s", peerAddr), - "--ssl-ca=./tls_for_test/ca.pem", - "--ssl-cert=./tls_for_test/dm.pem", - "--ssl-key=./tls_for_test/dm.key", + "--ssl-ca=" + caPath, + "--ssl-cert=" + certPath, + "--ssl-key=" + keyPath, }), check.IsNil) t.testTLSPrefix(c, cfg) } @@ -1604,7 +1615,7 @@ func (t *testMaster) testNormalServerLifecycle(c *check.C, cfg *Config, checkLog func (t *testMaster) testHTTPInterface(c *check.C, url string, contain []byte) { // we use HTTPS in some test cases. - tls, err := toolutils.NewTLS("./tls_for_test/ca.pem", "./tls_for_test/dm.pem", "./tls_for_test/dm.key", url, []string{}) + tls, err := toolutils.NewTLS(pwd+"/tls_for_test/ca.pem", pwd+"/tls_for_test/dm.pem", pwd+"/tls_for_test/dm.key", url, []string{}) c.Assert(err, check.IsNil) cli := toolutils.ClientWithTLS(tls.TLSConfig()) @@ -1722,7 +1733,7 @@ func (t *testMaster) TestOperateSource(c *check.C) { // create a new cluster cfg1 := NewConfig() - c.Assert(cfg1.Parse([]string{"-config=./dm-master.toml"}), check.IsNil) + c.Assert(cfg1.FromContent(SampleConfig), check.IsNil) cfg1.Name = "dm-master-1" cfg1.DataDir = c.MkDir() cfg1.MasterAddr = tempurl.Alloc()[len("http://"):] @@ -1735,7 +1746,7 @@ func (t *testMaster) TestOperateSource(c *check.C) { s1.leader.Store(oneselfLeader) c.Assert(s1.Start(ctx), check.IsNil) defer s1.Close() - mysqlCfg, err := config.LoadFromFile("./source.yaml") + mysqlCfg, err := config.ParseYaml(config.SampleSourceConfig) c.Assert(err, check.IsNil) mysqlCfg.From.Password = os.Getenv("MYSQL_PSWD") task, err := mysqlCfg.Yaml() diff --git a/dm/pkg/upgrade/upgrade_test.go b/dm/pkg/upgrade/upgrade_test.go index 4a732ea8dd4..45c37a57065 100644 --- a/dm/pkg/upgrade/upgrade_test.go +++ b/dm/pkg/upgrade/upgrade_test.go @@ -26,21 +26,17 @@ import ( ) var ( + mockCluster *integration.ClusterV3 + bigTxnCluster *integration.ClusterV3 etcdTestCli *clientv3.Client bigTxnTestCli *clientv3.Client ) func TestUpgrade(t *testing.T) { integration.BeforeTestExternal(t) - mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) - defer mockCluster.Terminate(t) - etcdTestCli = mockCluster.RandClient() - - bigCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1, MaxTxnOps: 2048}) - defer bigCluster.Terminate(t) - - bigTxnTestCli = bigCluster.RandClient() + suite.(*testForEtcd).testT = t + suiteForBigTxn.(*testForBigTxn).testT = t TestingT(t) } @@ -51,9 +47,33 @@ func clearTestData(c *C) { c.Assert(err, IsNil) } -type testForEtcd struct{} +type testForEtcd struct { + testT *testing.T +} +type testForBigTxn struct { + testT *testing.T +} + +var suite = SerialSuites(&testForEtcd{}) +var suiteForBigTxn = SerialSuites(&testForBigTxn{}) + +func (t *testForEtcd) SetUpSuite(c *C) { + mockCluster = integration.NewClusterV3(t.testT, &integration.ClusterConfig{Size: 1}) + etcdTestCli = mockCluster.RandClient() +} + +func (t *testForEtcd) TearDownSuite(c *C) { + mockCluster.Terminate(t.testT) +} -var _ = SerialSuites(&testForEtcd{}) +func (t *testForBigTxn) SetUpSuite(c *C) { + bigTxnCluster = integration.NewClusterV3(t.testT, &integration.ClusterConfig{Size: 1, MaxTxnOps: 2048}) + bigTxnTestCli = bigTxnCluster.RandClient() +} + +func (t *testForBigTxn) TearDownSuite(c *C) { + bigTxnCluster.Terminate(t.testT) +} func (t *testForEtcd) TestTryUpgrade(c *C) { defer clearTestData(c) @@ -155,6 +175,13 @@ func (t *testForEtcd) TestUpgradeToVer3(c *C) { } c.Assert(upgradeToVer3(ctx, etcdTestCli), ErrorMatches, ".*too many operations in txn request.*") +} + +func (t *testForBigTxn) TestUpgradeToVer3(c *C) { + source := "source-1" + oldVal := "test" + ctx := context.Background() + for i := 0; i < 1000; i++ { key := common.UpstreamConfigKeyAdapterV1.Encode(fmt.Sprintf("%s-%d", source, i)) val := fmt.Sprintf("%s-%d", oldVal, i) From 543fe97d09c1ec222945f4f9f83c23d02ad97f17 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Fri, 4 Mar 2022 11:57:58 +0800 Subject: [PATCH 09/11] fix again Signed-off-by: lance6716 --- dm/dm/config/source_config.go | 11 ++++++++++- dm/dm/config/task_converters_test.go | 12 ++++++------ dm/dm/master/config_test.go | 4 +--- dm/dm/master/scheduler/scheduler_test.go | 16 ++++++++-------- dm/dm/master/server_test.go | 4 ++-- dm/dm/worker/server_test.go | 2 +- dm/pkg/upgrade/upgrade_test.go | 8 +++++--- dm/tests/lightning_mode/run.sh | 2 +- 8 files changed, 34 insertions(+), 25 deletions(-) diff --git a/dm/dm/config/source_config.go b/dm/dm/config/source_config.go index a88e62270fb..27d60ae2bdf 100644 --- a/dm/dm/config/source_config.go +++ b/dm/dm/config/source_config.go @@ -167,7 +167,16 @@ func ParseYaml(content string) (*SourceConfig, error) { return nil, terror.ErrConfigYamlTransform.Delegate(err, "decode source config") } c.adjust() - if err := c.Verify(); err != nil { + return c, nil +} + +// ParseYamlAndVerify does ParseYaml and Verify. +func ParseYamlAndVerify(content string) (*SourceConfig, error) { + c, err := ParseYaml(content) + if err != nil { + return nil, err + } + if err = c.Verify(); err != nil { return nil, err } return c, nil diff --git a/dm/dm/config/task_converters_test.go b/dm/dm/config/task_converters_test.go index 241c094e9ea..56158f219c0 100644 --- a/dm/dm/config/task_converters_test.go +++ b/dm/dm/config/task_converters_test.go @@ -51,7 +51,7 @@ func (t *testConfig) TestOpenAPITaskToSubTaskConfigs(c *check.C) { func testNoShardTaskToSubTaskConfigs(c *check.C) { task, err := fixtures.GenNoShardOpenAPITaskForTest() c.Assert(err, check.IsNil) - sourceCfg1, err := ParseYaml(SampleSourceConfig) + sourceCfg1, err := ParseYamlAndVerify(SampleSourceConfig) c.Assert(err, check.IsNil) source1Name := task.SourceConfig.SourceConf[0].SourceName sourceCfg1.SourceID = task.SourceConfig.SourceConf[0].SourceName @@ -115,11 +115,11 @@ func testNoShardTaskToSubTaskConfigs(c *check.C) { func testShardAndFilterTaskToSubTaskConfigs(c *check.C) { task, err := fixtures.GenShardAndFilterOpenAPITaskForTest() c.Assert(err, check.IsNil) - sourceCfg1, err := ParseYaml(SampleSourceConfig) + sourceCfg1, err := ParseYamlAndVerify(SampleSourceConfig) c.Assert(err, check.IsNil) source1Name := task.SourceConfig.SourceConf[0].SourceName sourceCfg1.SourceID = source1Name - sourceCfg2, err := ParseYaml(SampleSourceConfig) + sourceCfg2, err := ParseYamlAndVerify(SampleSourceConfig) c.Assert(err, check.IsNil) source2Name := task.SourceConfig.SourceConf[1].SourceName sourceCfg2.SourceID = source2Name @@ -256,7 +256,7 @@ func (t *testConfig) TestSubTaskConfigsToOpenAPITask(c *check.C) { func testNoShardSubTaskConfigsToOpenAPITask(c *check.C) { task, err := fixtures.GenNoShardOpenAPITaskForTest() c.Assert(err, check.IsNil) - sourceCfg1, err := ParseYaml(SampleSourceConfig) + sourceCfg1, err := ParseYamlAndVerify(SampleSourceConfig) c.Assert(err, check.IsNil) source1Name := task.SourceConfig.SourceConf[0].SourceName sourceCfg1.SourceID = task.SourceConfig.SourceConf[0].SourceName @@ -286,11 +286,11 @@ func testNoShardSubTaskConfigsToOpenAPITask(c *check.C) { func testShardAndFilterSubTaskConfigsToOpenAPITask(c *check.C) { task, err := fixtures.GenShardAndFilterOpenAPITaskForTest() c.Assert(err, check.IsNil) - sourceCfg1, err := ParseYaml(SampleSourceConfig) + sourceCfg1, err := ParseYamlAndVerify(SampleSourceConfig) c.Assert(err, check.IsNil) source1Name := task.SourceConfig.SourceConf[0].SourceName sourceCfg1.SourceID = source1Name - sourceCfg2, err := ParseYaml(SampleSourceConfig) + sourceCfg2, err := ParseYamlAndVerify(SampleSourceConfig) c.Assert(err, check.IsNil) source2Name := task.SourceConfig.SourceConf[1].SourceName sourceCfg2.SourceID = source2Name diff --git a/dm/dm/master/config_test.go b/dm/dm/master/config_test.go index 8df774d3f2c..7425bd0edc5 100644 --- a/dm/dm/master/config_test.go +++ b/dm/dm/master/config_test.go @@ -29,9 +29,7 @@ import ( "github.com/pingcap/tiflow/dm/pkg/terror" ) -var ( - _ = check.Suite(&testConfigSuite{}) -) +var _ = check.Suite(&testConfigSuite{}) type testConfigSuite struct{} diff --git a/dm/dm/master/scheduler/scheduler_test.go b/dm/dm/master/scheduler/scheduler_test.go index 75a4d5cfc9f..3c2195fd2ec 100644 --- a/dm/dm/master/scheduler/scheduler_test.go +++ b/dm/dm/master/scheduler/scheduler_test.go @@ -110,7 +110,7 @@ func (t *testScheduler) testSchedulerProgress(c *C, restart int) { } } ) - sourceCfg1, err := config.ParseYaml(config.SampleSourceConfig) + sourceCfg1, err := config.ParseYamlAndVerify(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg1.SourceID = sourceID1 sourceCfg2 := *sourceCfg1 @@ -807,7 +807,7 @@ func (t *testScheduler) TestRestartScheduler(c *C) { wg sync.WaitGroup keepAliveTTL = int64(2) // NOTE: this should be >= minLeaseTTL, in second. ) - sourceCfg1, err := config.ParseYaml(config.SampleSourceConfig) + sourceCfg1, err := config.ParseYamlAndVerify(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg1.SourceID = sourceID1 @@ -968,7 +968,7 @@ func (t *testScheduler) TestWatchWorkerEventEtcdCompact(c *C) { workerAddr4 = "127.0.0.1:18462" keepAliveTTL = int64(2) // NOTE: this should be >= minLeaseTTL, in second. ) - sourceCfg1, err := config.ParseYaml(config.SampleSourceConfig) + sourceCfg1, err := config.ParseYamlAndVerify(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg1.SourceID = sourceID1 sourceCfg2 := *sourceCfg1 @@ -1108,7 +1108,7 @@ func (t *testScheduler) TestLastBound(c *C) { workerName4 = "dm-worker-4" ) - sourceCfg1, err := config.ParseYaml(config.SampleSourceConfig) + sourceCfg1, err := config.ParseYamlAndVerify(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg1.SourceID = sourceID1 sourceCfg2 := sourceCfg1 @@ -1181,7 +1181,7 @@ func (t *testScheduler) TestInvalidLastBound(c *C) { workerName1 = "dm-worker-1" ) - sourceCfg1, err := config.ParseYaml(config.SampleSourceConfig) + sourceCfg1, err := config.ParseYamlAndVerify(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg1.SourceID = sourceID1 sourceCfg2 := sourceCfg1 @@ -1864,7 +1864,7 @@ func (t *testScheduler) TestWorkerHasDiffRelayAndBound(c *C) { Worker: workerName1, } - sourceCfg, err := config.ParseYaml(config.SampleSourceConfig) + sourceCfg, err := config.ParseYamlAndVerify(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg.Checker.BackoffMax = config.Duration{Duration: 5 * time.Second} @@ -1923,7 +1923,7 @@ func (t *testScheduler) TestUpgradeCauseConflictRelayType(c *C) { Worker: workerName1, } - sourceCfg, err := config.ParseYaml(config.SampleSourceConfig) + sourceCfg, err := config.ParseYamlAndVerify(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg.Checker.BackoffMax = config.Duration{Duration: 5 * time.Second} @@ -1991,7 +1991,7 @@ func (t *testScheduler) TestOperateValidatorTask(c *C) { Source: sourceID1, Worker: workerName1, } - sourceCfg, err := config.ParseYaml(config.SampleSourceConfig) + sourceCfg, err := config.ParseYamlAndVerify(config.SampleSourceConfig) c.Assert(err, IsNil) s.etcdCli = etcdTestCli sourceCfg.SourceID = sourceID1 diff --git a/dm/dm/master/server_test.go b/dm/dm/master/server_test.go index 9eeeea2a998..b0abb3e200c 100644 --- a/dm/dm/master/server_test.go +++ b/dm/dm/master/server_test.go @@ -169,7 +169,7 @@ type testMaster struct { } var ( - testSuite = check.Suite(&testMaster{}) + testSuite = check.SerialSuites(&testMaster{}) pwd string ) @@ -1746,7 +1746,7 @@ func (t *testMaster) TestOperateSource(c *check.C) { s1.leader.Store(oneselfLeader) c.Assert(s1.Start(ctx), check.IsNil) defer s1.Close() - mysqlCfg, err := config.ParseYaml(config.SampleSourceConfig) + mysqlCfg, err := config.ParseYamlAndVerify(config.SampleSourceConfig) c.Assert(err, check.IsNil) mysqlCfg.From.Password = os.Getenv("MYSQL_PSWD") task, err := mysqlCfg.Yaml() diff --git a/dm/dm/worker/server_test.go b/dm/dm/worker/server_test.go index fa00b4b2c8f..da1a6e5f022 100644 --- a/dm/dm/worker/server_test.go +++ b/dm/dm/worker/server_test.go @@ -635,7 +635,7 @@ func checkRelayStatus(cli pb.WorkerClient, expect pb.Stage) bool { } func loadSourceConfigWithoutPassword(c *C) *config.SourceConfig { - sourceCfg, err := config.ParseYaml(config.SampleSourceConfig) + sourceCfg, err := config.ParseYamlAndVerify(config.SampleSourceConfig) c.Assert(err, IsNil) sourceCfg.From.Password = "" // no password set return sourceCfg diff --git a/dm/pkg/upgrade/upgrade_test.go b/dm/pkg/upgrade/upgrade_test.go index 45c37a57065..69828ead9f1 100644 --- a/dm/pkg/upgrade/upgrade_test.go +++ b/dm/pkg/upgrade/upgrade_test.go @@ -50,12 +50,15 @@ func clearTestData(c *C) { type testForEtcd struct { testT *testing.T } + type testForBigTxn struct { testT *testing.T } -var suite = SerialSuites(&testForEtcd{}) -var suiteForBigTxn = SerialSuites(&testForBigTxn{}) +var ( + suite = SerialSuites(&testForEtcd{}) + suiteForBigTxn = SerialSuites(&testForBigTxn{}) +) func (t *testForEtcd) SetUpSuite(c *C) { mockCluster = integration.NewClusterV3(t.testT, &integration.ClusterConfig{Size: 1}) @@ -174,7 +177,6 @@ func (t *testForEtcd) TestUpgradeToVer3(c *C) { c.Assert(err, IsNil) } c.Assert(upgradeToVer3(ctx, etcdTestCli), ErrorMatches, ".*too many operations in txn request.*") - } func (t *testForBigTxn) TestUpgradeToVer3(c *C) { diff --git a/dm/tests/lightning_mode/run.sh b/dm/tests/lightning_mode/run.sh index 5f49f3bfa1e..67dbd9c4193 100755 --- a/dm/tests/lightning_mode/run.sh +++ b/dm/tests/lightning_mode/run.sh @@ -23,7 +23,7 @@ function run() { check_contains 'Query OK, 3 rows affected' # start DM worker and master - run_dm_master $WORK_DIR/master $MASTER_PORT $cur/conf/dm-master.toml + run_dm_master_info_log $WORK_DIR/master $MASTER_PORT $cur/conf/dm-master.toml check_rpc_alive $cur/../bin/check_master_online 127.0.0.1:$MASTER_PORT check_metric $MASTER_PORT 'start_leader_counter' 3 0 2 run_dm_worker $WORK_DIR/worker1 $WORKER1_PORT $cur/conf/dm-worker1.toml From 561fe695d828fc60fcc4d1040eab9fda39316d08 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Fri, 4 Mar 2022 15:31:39 +0800 Subject: [PATCH 10/11] hope all unit tests are fixed Signed-off-by: lance6716 --- dm/dm/master/etcd.go | 8 ++ dm/dm/master/openapi_view_test.go | 9 +- dm/dm/master/server.go | 2 +- dm/dm/master/server_test.go | 8 ++ dm/dm/master/shardddl/optimist_test.go | 136 ++++++++++--------- dm/dm/master/shardddl/pessimist_test.go | 165 ++++++++++++------------ 6 files changed, 178 insertions(+), 150 deletions(-) diff --git a/dm/dm/master/etcd.go b/dm/dm/master/etcd.go index d0b4adfd3ab..c74033fbb3c 100644 --- a/dm/dm/master/etcd.go +++ b/dm/dm/master/etcd.go @@ -50,7 +50,15 @@ func startEtcd(etcdCfg *embed.Config, etcdCfg.UserHandlers = httpHandles } + println("123213123\n\n\n123123123\n\n\n") + + go func() { + http.ListenAndServe(":8080", nil) + }() + e, err := embed.StartEtcd(etcdCfg) + println("345345435\n\n\n345345\n\n\n") + if err != nil { return nil, terror.ErrMasterStartEmbedEtcdFail.Delegate(err) } diff --git a/dm/dm/master/openapi_view_test.go b/dm/dm/master/openapi_view_test.go index 3f77e73d061..73126859543 100644 --- a/dm/dm/master/openapi_view_test.go +++ b/dm/dm/master/openapi_view_test.go @@ -34,7 +34,6 @@ import ( "github.com/pingcap/tiflow/dm/checker" "github.com/pingcap/tiflow/dm/dm/config" - "github.com/pingcap/tiflow/dm/dm/master/workerrpc" "github.com/pingcap/tiflow/dm/dm/pb" "github.com/pingcap/tiflow/dm/dm/pbmock" "github.com/pingcap/tiflow/dm/openapi" @@ -57,22 +56,20 @@ type openAPISuite struct { etcdTestCli *clientv3.Client testEtcdCluster *integration.ClusterV3 - workerClients map[string]workerrpc.Client } func (t *openAPISuite) SetUpSuite(c *check.C) { checkAndAdjustSourceConfigFunc = checkAndNoAdjustSourceConfigMock + t.testEtcdCluster = integration.NewClusterV3(t.testT, &integration.ClusterConfig{Size: 1}) + t.etcdTestCli = t.testEtcdCluster.RandClient() } func (t *openAPISuite) TearDownSuite(c *check.C) { checkAndAdjustSourceConfigFunc = checkAndAdjustSourceConfig + t.testEtcdCluster.Terminate(t.testT) } func (t *openAPISuite) SetUpTest(c *check.C) { - t.testEtcdCluster = integration.NewClusterV3(t.testT, &integration.ClusterConfig{Size: 1}) - t.etcdTestCli = t.testEtcdCluster.RandClient() - t.workerClients = make(map[string]workerrpc.Client) - c.Assert(ha.ClearTestInfoOperation(t.etcdTestCli), check.IsNil) } diff --git a/dm/dm/master/server.go b/dm/dm/master/server.go index 7fe10235b9e..fb324ca56c9 100644 --- a/dm/dm/master/server.go +++ b/dm/dm/master/server.go @@ -210,7 +210,7 @@ func (s *Server) Start(ctx context.Context) (err error) { gRPCSvr := func(gs *grpc.Server) { pb.RegisterMasterServer(gs, s) } // start embed etcd server, gRPC API server and HTTP (API, status and debug) server. - s.etcd, err = startEtcd(etcdCfg, gRPCSvr, userHandles, etcdStartTimeout) + s.etcd, err = startEtcd(etcdCfg, gRPCSvr, userHandles, 10*time.Second) if err != nil { return } diff --git a/dm/dm/master/server_test.go b/dm/dm/master/server_test.go index b0abb3e200c..b730583fee6 100644 --- a/dm/dm/master/server_test.go +++ b/dm/dm/master/server_test.go @@ -41,6 +41,7 @@ import ( tidbmock "github.com/pingcap/tidb/util/mock" "github.com/tikv/pd/pkg/tempurl" clientv3 "go.etcd.io/etcd/client/v3" + "go.etcd.io/etcd/server/v3/verify" "go.etcd.io/etcd/tests/v3/integration" "google.golang.org/grpc" @@ -1391,12 +1392,19 @@ func (t *testMaster) TestServer(c *check.C) { basicServiceCheck(c, cfg) // try to start another server with the same address. Expect it to fail + // unset an etcd variable becuase it will cause checking on exit, and block forever + err = os.Unsetenv(verify.ENV_VERIFY) + c.Assert(err, check.IsNil) + dupServer := NewServer(cfg) ctx, cancel := context.WithCancel(context.Background()) defer cancel() err1 := dupServer.Start(ctx) c.Assert(terror.ErrMasterStartEmbedEtcdFail.Equal(err1), check.IsTrue) c.Assert(err1.Error(), check.Matches, ".*bind: address already in use.*") + + err = os.Setenv(verify.ENV_VERIFY, verify.ENV_VERIFY_ALL_VALUE) + c.Assert(err, check.IsNil) }) // test the listen address is 0.0.0.0 diff --git a/dm/dm/master/shardddl/optimist_test.go b/dm/dm/master/shardddl/optimist_test.go index 8296f0798bb..f10f5eaa06c 100644 --- a/dm/dm/master/shardddl/optimist_test.go +++ b/dm/dm/master/shardddl/optimist_test.go @@ -36,13 +36,25 @@ import ( "github.com/pingcap/tiflow/dm/pkg/utils" ) -type testOptimist struct{} +type testOptimist struct { + mockCluster *integration.ClusterV3 + etcdTestCli *clientv3.Client +} var _ = SerialSuites(&testOptimist{}) +func (t *testOptimist) SetUpSuite(c *C) { + t.mockCluster = integration.NewClusterV3(tt, &integration.ClusterConfig{Size: 1}) + t.etcdTestCli = t.mockCluster.RandClient() +} + +func (t *testOptimist) TearDownSuite(c *C) { + t.mockCluster.Terminate(tt) +} + // clear keys in etcd test cluster. -func clearOptimistTestSourceInfoOperation(c *C) { - c.Assert(optimism.ClearTestInfoOperationColumn(etcdTestCli), IsNil) +func (t *testOptimist) clearOptimistTestSourceInfoOperation(c *C) { + c.Assert(optimism.ClearTestInfoOperationColumn(t.etcdTestCli), IsNil) } func createTableInfo(c *C, p *parser.Parser, se sessionctx.Context, tableID int64, sql string) *model.TableInfo { @@ -99,7 +111,7 @@ func watchExactOneOperation( } func (t *testOptimist) TestOptimistSourceTables(c *C) { - defer clearOptimistTestSourceInfoOperation(c) + defer t.clearOptimistTestSourceInfoOperation(c) var ( logger = log.L() @@ -122,17 +134,17 @@ func (t *testOptimist) TestOptimistSourceTables(c *C) { defer cancel() // CASE 1: start without any previous kv and no etcd operation. - c.Assert(o.Start(ctx, etcdTestCli), IsNil) + c.Assert(o.Start(ctx, t.etcdTestCli), IsNil) c.Assert(o.tk.FindTables(task, downSchema, downTable), IsNil) o.Close() o.Close() // close multiple times. // CASE 2: start again without any previous kv. - c.Assert(o.Start(ctx, etcdTestCli), IsNil) + c.Assert(o.Start(ctx, t.etcdTestCli), IsNil) c.Assert(o.tk.FindTables(task, downSchema, downTable), IsNil) // PUT st1, should find tables. - _, err := optimism.PutSourceTables(etcdTestCli, st1) + _, err := optimism.PutSourceTables(t.etcdTestCli, st1) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { tts := o.tk.FindTables(task, downSchema, downTable) @@ -144,13 +156,13 @@ func (t *testOptimist) TestOptimistSourceTables(c *C) { o.Close() // CASE 3: start again with previous source tables. - c.Assert(o.Start(ctx, etcdTestCli), IsNil) + c.Assert(o.Start(ctx, t.etcdTestCli), IsNil) tts = o.tk.FindTables(task, downSchema, downTable) c.Assert(tts, HasLen, 1) c.Assert(tts[0], DeepEquals, st1.TargetTable(downSchema, downTable)) // PUT st2, should find more tables. - _, err = optimism.PutSourceTables(etcdTestCli, st2) + _, err = optimism.PutSourceTables(t.etcdTestCli, st2) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { tts = o.tk.FindTables(task, downSchema, downTable) @@ -164,14 +176,14 @@ func (t *testOptimist) TestOptimistSourceTables(c *C) { // CASE 4: create (not re-start) a new optimist with previous source tables. o = NewOptimist(&logger, getDownstreamMeta) - c.Assert(o.Start(ctx, etcdTestCli), IsNil) + c.Assert(o.Start(ctx, t.etcdTestCli), IsNil) tts = o.tk.FindTables(task, downSchema, downTable) c.Assert(tts, HasLen, 2) c.Assert(tts[0], DeepEquals, st1.TargetTable(downSchema, downTable)) c.Assert(tts[1], DeepEquals, st2.TargetTable(downSchema, downTable)) // DELETE st1, should find less tables. - _, err = optimism.DeleteSourceTables(etcdTestCli, st1) + _, err = optimism.DeleteSourceTables(t.etcdTestCli, st1) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { tts = o.tk.FindTables(task, downSchema, downTable) @@ -184,14 +196,10 @@ func (t *testOptimist) TestOptimistSourceTables(c *C) { } func (t *testOptimist) TestOptimist(c *C) { - cluster := integration.NewClusterV3(tt, &integration.ClusterConfig{Size: 1}) - defer cluster.Terminate(tt) - - cli := cluster.RandClient() - t.testOptimist(c, cli, noRestart) - t.testOptimist(c, cli, restartOnly) - t.testOptimist(c, cli, restartNewInstance) - t.testSortInfos(c, cli) + t.testOptimist(c, t.etcdTestCli, noRestart) + t.testOptimist(c, t.etcdTestCli, restartOnly) + t.testOptimist(c, t.etcdTestCli, restartNewInstance) + t.testSortInfos(c, t.etcdTestCli) } func (t *testOptimist) testOptimist(c *C, cli *clientv3.Client, restart int) { @@ -609,7 +617,7 @@ func (t *testOptimist) testOptimist(c *C, cli *clientv3.Client, restart int) { } func (t *testOptimist) TestOptimistLockConflict(c *C) { - defer clearOptimistTestSourceInfoOperation(c) + defer t.clearOptimistTestSourceInfoOperation(c) var ( watchTimeout = 5 * time.Second @@ -638,23 +646,23 @@ func (t *testOptimist) TestOptimistLockConflict(c *C) { st1.AddTable("foo", "bar-2", downSchema, downTable) // put source tables first. - _, err := optimism.PutSourceTables(etcdTestCli, st1) + _, err := optimism.PutSourceTables(t.etcdTestCli, st1) c.Assert(err, IsNil) ctx, cancel := context.WithCancel(context.Background()) defer cancel() - c.Assert(o.Start(ctx, etcdTestCli), IsNil) + c.Assert(o.Start(ctx, t.etcdTestCli), IsNil) c.Assert(o.Locks(), HasLen, 0) // PUT i1, will create a lock but not synced. - rev1, err := optimism.PutInfo(etcdTestCli, i1) + rev1, err := optimism.PutInfo(t.etcdTestCli, i1) c.Assert(err, IsNil) // wait operation for i1 become available. opCh := make(chan optimism.Operation, 10) errCh := make(chan error, 10) ctx2, cancel2 := context.WithCancel(ctx) - go optimism.WatchOperationPut(ctx2, etcdTestCli, i1.Task, i1.Source, i1.UpSchema, i1.UpTable, rev1, opCh, errCh) + go optimism.WatchOperationPut(ctx2, t.etcdTestCli, i1.Task, i1.Source, i1.UpSchema, i1.UpTable, rev1, opCh, errCh) select { case <-time.After(watchTimeout): c.Fatal("timeout") @@ -670,14 +678,14 @@ func (t *testOptimist) TestOptimistLockConflict(c *C) { c.Assert(len(errCh), Equals, 0) // PUT i2, conflict will be detected. - rev2, err := optimism.PutInfo(etcdTestCli, i2) + rev2, err := optimism.PutInfo(t.etcdTestCli, i2) c.Assert(err, IsNil) // wait operation for i2 become available. opCh = make(chan optimism.Operation, 10) errCh = make(chan error, 10) ctx2, cancel2 = context.WithCancel(ctx) - go optimism.WatchOperationPut(ctx2, etcdTestCli, i2.Task, i2.Source, i2.UpSchema, i2.UpTable, rev2, opCh, errCh) + go optimism.WatchOperationPut(ctx2, t.etcdTestCli, i2.Task, i2.Source, i2.UpSchema, i2.UpTable, rev2, opCh, errCh) select { case <-time.After(watchTimeout): c.Fatal("timeout") @@ -694,13 +702,13 @@ func (t *testOptimist) TestOptimistLockConflict(c *C) { // PUT i3, no conflict now. // case for handle-error replace - rev3, err := optimism.PutInfo(etcdTestCli, i3) + rev3, err := optimism.PutInfo(t.etcdTestCli, i3) c.Assert(err, IsNil) // wait operation for i3 become available. opCh = make(chan optimism.Operation, 10) errCh = make(chan error, 10) ctx2, cancel2 = context.WithCancel(ctx) - go optimism.WatchOperationPut(ctx2, etcdTestCli, i3.Task, i3.Source, i3.UpSchema, i3.UpTable, rev3, opCh, errCh) + go optimism.WatchOperationPut(ctx2, t.etcdTestCli, i3.Task, i3.Source, i3.UpSchema, i3.UpTable, rev3, opCh, errCh) select { case <-time.After(watchTimeout): c.Fatal("timeout") @@ -716,7 +724,7 @@ func (t *testOptimist) TestOptimistLockConflict(c *C) { } func (t *testOptimist) TestOptimistLockMultipleTarget(c *C) { - defer clearOptimistTestSourceInfoOperation(c) + defer t.clearOptimistTestSourceInfoOperation(c) var ( backOff = 30 @@ -752,19 +760,19 @@ func (t *testOptimist) TestOptimistLockMultipleTarget(c *C) { sts.AddTable(upSchema, upTables[3], downSchema, downTable2) // put source tables first. - _, err := optimism.PutSourceTables(etcdTestCli, sts) + _, err := optimism.PutSourceTables(t.etcdTestCli, sts) c.Assert(err, IsNil) ctx, cancel := context.WithCancel(context.Background()) defer cancel() - c.Assert(o.Start(ctx, etcdTestCli), IsNil) + c.Assert(o.Start(ctx, t.etcdTestCli), IsNil) c.Assert(o.Locks(), HasLen, 0) // PUT i11 and i21, will create two locks but no synced. - _, err = optimism.PutInfo(etcdTestCli, i11) + _, err = optimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) - _, err = optimism.PutInfo(etcdTestCli, i21) + _, err = optimism.PutInfo(t.etcdTestCli, i21) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(backOff, waitTime, func() bool { return len(o.Locks()) == 2 @@ -807,9 +815,9 @@ func (t *testOptimist) TestOptimistLockMultipleTarget(c *C) { c.Assert(locks[1], DeepEquals, expectedLock[locks[1].ID]) // put i12 and i22, both of locks will be synced. - rev1, err := optimism.PutInfo(etcdTestCli, i12) + rev1, err := optimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) - rev2, err := optimism.PutInfo(etcdTestCli, i22) + rev2, err := optimism.PutInfo(t.etcdTestCli, i22) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(backOff, waitTime, func() bool { synced1, _ := o.Locks()[lockID1].IsSynced() @@ -837,7 +845,7 @@ func (t *testOptimist) TestOptimistLockMultipleTarget(c *C) { errCh := make(chan error, 10) var op12 optimism.Operation ctx2, cancel2 := context.WithCancel(ctx) - go optimism.WatchOperationPut(ctx2, etcdTestCli, i12.Task, i12.Source, i12.UpSchema, i12.UpTable, rev1, opCh, errCh) + go optimism.WatchOperationPut(ctx2, t.etcdTestCli, i12.Task, i12.Source, i12.UpSchema, i12.UpTable, rev1, opCh, errCh) select { case <-time.After(watchTimeout): c.Fatal("timeout") @@ -855,12 +863,12 @@ func (t *testOptimist) TestOptimistLockMultipleTarget(c *C) { op11c := op12 op11c.Done = true op11c.UpTable = i11.UpTable // overwrite `UpTable`. - _, putted, err := optimism.PutOperation(etcdTestCli, false, op11c, 0) + _, putted, err := optimism.PutOperation(t.etcdTestCli, false, op11c, 0) c.Assert(err, IsNil) c.Assert(putted, IsTrue) op12c := op12 op12c.Done = true - _, putted, err = optimism.PutOperation(etcdTestCli, false, op12c, 0) + _, putted, err = optimism.PutOperation(t.etcdTestCli, false, op12c, 0) c.Assert(err, IsNil) c.Assert(putted, IsTrue) c.Assert(utils.WaitSomething(backOff, waitTime, func() bool { @@ -876,7 +884,7 @@ func (t *testOptimist) TestOptimistLockMultipleTarget(c *C) { errCh = make(chan error, 10) var op22 optimism.Operation ctx2, cancel2 = context.WithCancel(ctx) - go optimism.WatchOperationPut(ctx2, etcdTestCli, i22.Task, i22.Source, i22.UpSchema, i22.UpTable, rev2, opCh, errCh) + go optimism.WatchOperationPut(ctx2, t.etcdTestCli, i22.Task, i22.Source, i22.UpSchema, i22.UpTable, rev2, opCh, errCh) select { case <-time.After(watchTimeout): c.Fatal("timeout") @@ -894,12 +902,12 @@ func (t *testOptimist) TestOptimistLockMultipleTarget(c *C) { op21c := op22 op21c.Done = true op21c.UpTable = i21.UpTable // overwrite `UpTable`. - _, putted, err = optimism.PutOperation(etcdTestCli, false, op21c, 0) + _, putted, err = optimism.PutOperation(t.etcdTestCli, false, op21c, 0) c.Assert(err, IsNil) c.Assert(putted, IsTrue) op22c := op22 op22c.Done = true - _, putted, err = optimism.PutOperation(etcdTestCli, false, op22c, 0) + _, putted, err = optimism.PutOperation(t.etcdTestCli, false, op22c, 0) c.Assert(err, IsNil) c.Assert(putted, IsTrue) c.Assert(utils.WaitSomething(backOff, waitTime, func() bool { @@ -911,7 +919,7 @@ func (t *testOptimist) TestOptimistLockMultipleTarget(c *C) { } func (t *testOptimist) TestOptimistInitSchema(c *C) { - defer clearOptimistTestSourceInfoOperation(c) + defer t.clearOptimistTestSourceInfoOperation(c) var ( backOff = 30 @@ -944,17 +952,17 @@ func (t *testOptimist) TestOptimistInitSchema(c *C) { st.AddTable(upSchema, upTables[1], downSchema, downTable) // put source tables first. - _, err := optimism.PutSourceTables(etcdTestCli, st) + _, err := optimism.PutSourceTables(t.etcdTestCli, st) c.Assert(err, IsNil) ctx, cancel := context.WithCancel(context.Background()) defer cancel() - c.Assert(o.Start(ctx, etcdTestCli), IsNil) + c.Assert(o.Start(ctx, t.etcdTestCli), IsNil) c.Assert(o.Locks(), HasLen, 0) // PUT i11, will creat a lock. - _, err = optimism.PutInfo(etcdTestCli, i11) + _, err = optimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(backOff, waitTime, func() bool { return len(o.Locks()) == 1 @@ -962,7 +970,7 @@ func (t *testOptimist) TestOptimistInitSchema(c *C) { time.Sleep(waitTime) // sleep one more time to wait for update of init schema. // PUT i12, the lock will be synced. - rev1, err := optimism.PutInfo(etcdTestCli, i12) + rev1, err := optimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) // wait operation for i12 become available. @@ -970,7 +978,7 @@ func (t *testOptimist) TestOptimistInitSchema(c *C) { errCh := make(chan error, 10) var op12 optimism.Operation ctx2, cancel2 := context.WithCancel(ctx) - go optimism.WatchOperationPut(ctx2, etcdTestCli, i12.Task, i12.Source, i12.UpSchema, i12.UpTable, rev1, opCh, errCh) + go optimism.WatchOperationPut(ctx2, t.etcdTestCli, i12.Task, i12.Source, i12.UpSchema, i12.UpTable, rev1, opCh, errCh) select { case <-time.After(watchTimeout): c.Fatal("timeout") @@ -988,12 +996,12 @@ func (t *testOptimist) TestOptimistInitSchema(c *C) { op11c := op12 op11c.Done = true op11c.UpTable = i11.UpTable // overwrite `UpTable`. - _, putted, err := optimism.PutOperation(etcdTestCli, false, op11c, 0) + _, putted, err := optimism.PutOperation(t.etcdTestCli, false, op11c, 0) c.Assert(err, IsNil) c.Assert(putted, IsTrue) op12c := op12 op12c.Done = true - _, putted, err = optimism.PutOperation(etcdTestCli, false, op12c, 0) + _, putted, err = optimism.PutOperation(t.etcdTestCli, false, op12c, 0) c.Assert(err, IsNil) c.Assert(putted, IsTrue) c.Assert(utils.WaitSomething(backOff, waitTime, func() bool { @@ -1001,7 +1009,7 @@ func (t *testOptimist) TestOptimistInitSchema(c *C) { }), IsTrue) // PUT i21 to create the lock again. - _, err = optimism.PutInfo(etcdTestCli, i21) + _, err = optimism.PutInfo(t.etcdTestCli, i21) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(backOff, waitTime, func() bool { return len(o.Locks()) == 1 @@ -1079,7 +1087,7 @@ func (t *testOptimist) testSortInfos(c *C, cli *clientv3.Client) { } func (t *testOptimist) TestBuildLockJoinedAndTable(c *C) { - defer clearOptimistTestSourceInfoOperation(c) + defer t.clearOptimistTestSourceInfoOperation(c) var ( logger = log.L() @@ -1111,24 +1119,24 @@ func (t *testOptimist) TestBuildLockJoinedAndTable(c *C) { st1.AddTable("foo", "bar-1", downSchema, downTable) st2.AddTable("foo", "bar-1", downSchema, downTable) - c.Assert(o.Start(ctx, etcdTestCli), IsNil) - _, err := optimism.PutSourceTables(etcdTestCli, st1) + c.Assert(o.Start(ctx, t.etcdTestCli), IsNil) + _, err := optimism.PutSourceTables(t.etcdTestCli, st1) c.Assert(err, IsNil) - _, err = optimism.PutSourceTables(etcdTestCli, st2) + _, err = optimism.PutSourceTables(t.etcdTestCli, st2) c.Assert(err, IsNil) - _, err = optimism.PutInfo(etcdTestCli, i21) + _, err = optimism.PutInfo(t.etcdTestCli, i21) c.Assert(err, IsNil) - _, err = optimism.PutInfo(etcdTestCli, i11) + _, err = optimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) - stm, _, err := optimism.GetAllSourceTables(etcdTestCli) + stm, _, err := optimism.GetAllSourceTables(t.etcdTestCli) c.Assert(err, IsNil) o.tk.Init(stm) } func (t *testOptimist) TestBuildLockWithInitSchema(c *C) { - defer clearOptimistTestSourceInfoOperation(c) + defer t.clearOptimistTestSourceInfoOperation(c) var ( logger = log.L() @@ -1160,18 +1168,18 @@ func (t *testOptimist) TestBuildLockWithInitSchema(c *C) { st1.AddTable("foo", "bar-1", downSchema, downTable) st2.AddTable("foo", "bar-1", downSchema, downTable) - c.Assert(o.Start(ctx, etcdTestCli), IsNil) - _, err := optimism.PutSourceTables(etcdTestCli, st1) + c.Assert(o.Start(ctx, t.etcdTestCli), IsNil) + _, err := optimism.PutSourceTables(t.etcdTestCli, st1) c.Assert(err, IsNil) - _, err = optimism.PutSourceTables(etcdTestCli, st2) + _, err = optimism.PutSourceTables(t.etcdTestCli, st2) c.Assert(err, IsNil) - _, err = optimism.PutInfo(etcdTestCli, infoDropB) + _, err = optimism.PutInfo(t.etcdTestCli, infoDropB) c.Assert(err, IsNil) - _, err = optimism.PutInfo(etcdTestCli, infoDropC) + _, err = optimism.PutInfo(t.etcdTestCli, infoDropC) c.Assert(err, IsNil) - stm, _, err := optimism.GetAllSourceTables(etcdTestCli) + stm, _, err := optimism.GetAllSourceTables(t.etcdTestCli) c.Assert(err, IsNil) o.tk.Init(stm) } diff --git a/dm/dm/master/shardddl/pessimist_test.go b/dm/dm/master/shardddl/pessimist_test.go index a7fc3671f27..71b75634328 100644 --- a/dm/dm/master/shardddl/pessimist_test.go +++ b/dm/dm/master/shardddl/pessimist_test.go @@ -35,7 +35,6 @@ import ( ) var ( - etcdTestCli *clientv3.Client etcdErrCompacted = v3rpc.ErrCompacted tt *testing.T ) @@ -46,7 +45,10 @@ const ( restartNewInstance // restart with build a new instance. mock progress restore from failure ) -type testPessimist struct{} +type testPessimist struct { + mockCluster *integration.ClusterV3 + etcdTestCli *clientv3.Client +} var _ = Suite(&testPessimist{}) @@ -58,22 +60,27 @@ func TestShardDDL(t *testing.T) { tt = t integration.BeforeTestExternal(t) - mockCluster := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 1}) - defer mockCluster.Terminate(t) - - etcdTestCli = mockCluster.RandClient() TestingT(t) } // clear keys in etcd test cluster. -func clearTestInfoOperation(c *C) { +func (t *testPessimist) clearTestInfoOperation(c *C) { clearInfo := clientv3.OpDelete(common.ShardDDLPessimismInfoKeyAdapter.Path(), clientv3.WithPrefix()) clearOp := clientv3.OpDelete(common.ShardDDLPessimismOperationKeyAdapter.Path(), clientv3.WithPrefix()) - _, err := etcdTestCli.Txn(context.Background()).Then(clearInfo, clearOp).Commit() + _, err := t.etcdTestCli.Txn(context.Background()).Then(clearInfo, clearOp).Commit() c.Assert(err, IsNil) } +func (t *testPessimist) SetUpSuite(c *C) { + t.mockCluster = integration.NewClusterV3(tt, &integration.ClusterConfig{Size: 1}) + t.etcdTestCli = t.mockCluster.RandClient() +} + +func (t *testPessimist) TearDownSuite(c *C) { + t.mockCluster.Terminate(tt) +} + func (t *testPessimist) TestPessimist(c *C) { t.testPessimistProgress(c, noRestart) t.testPessimistProgress(c, restartOnly) @@ -81,7 +88,7 @@ func (t *testPessimist) TestPessimist(c *C) { } func (t *testPessimist) testPessimistProgress(c *C, restart int) { - defer clearTestInfoOperation(c) + defer t.clearTestInfoOperation(c) var ( watchTimeout = 3 * time.Second @@ -118,11 +125,11 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { switch restart { case restartOnly: p.Close() - c.Assert(p.Start(ctx, etcdTestCli), IsNil) + c.Assert(p.Start(ctx, t.etcdTestCli), IsNil) case restartNewInstance: p.Close() p = NewPessimist(&logger, sources) - c.Assert(p.Start(ctx, etcdTestCli), IsNil) + c.Assert(p.Start(ctx, t.etcdTestCli), IsNil) } } ) @@ -131,17 +138,17 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { defer cancel() // CASE 1: start without any previous kv and no etcd operation. - c.Assert(p.Start(ctx, etcdTestCli), IsNil) + c.Assert(p.Start(ctx, t.etcdTestCli), IsNil) c.Assert(p.Locks(), HasLen, 0) p.Close() p.Close() // close multiple times. // CASE 2: start again without any previous kv. - c.Assert(p.Start(ctx, etcdTestCli), IsNil) + c.Assert(p.Start(ctx, t.etcdTestCli), IsNil) c.Assert(p.Locks(), HasLen, 0) // PUT i11, will create a lock but not synced. - _, err := pessimism.PutInfo(etcdTestCli, i11) + _, err := pessimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { return len(p.Locks()) == 1 @@ -152,7 +159,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { c.Assert(remain, Equals, 1) // PUT i12, the lock will be synced, then an operation PUT for the owner will be triggered. - rev1, err := pessimism.PutInfo(etcdTestCli, i12) + rev1, err := pessimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { synced, _ = p.Locks()[ID1].IsSynced() @@ -163,7 +170,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { opCh := make(chan pessimism.Operation, 10) errCh := make(chan error, 10) ctx2, cancel2 := context.WithTimeout(ctx, watchTimeout) - pessimism.WatchOperationPut(ctx2, etcdTestCli, task1, source1, rev1+1, opCh, errCh) + pessimism.WatchOperationPut(ctx2, t.etcdTestCli, task1, source1, rev1+1, opCh, errCh) cancel2() close(opCh) close(errCh) @@ -176,7 +183,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { // mark exec operation for the owner as `done` (and delete the info). op11c := op11 op11c.Done = true - done, rev2, err := pessimism.PutOperationDeleteExistInfo(etcdTestCli, op11c, i11) + done, rev2, err := pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op11c, i11) c.Assert(err, IsNil) c.Assert(done, IsTrue) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { @@ -187,7 +194,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { opCh = make(chan pessimism.Operation, 10) errCh = make(chan error, 10) ctx2, cancel2 = context.WithTimeout(ctx, watchTimeout) - pessimism.WatchOperationPut(ctx2, etcdTestCli, task1, source2, rev2+1, opCh, errCh) + pessimism.WatchOperationPut(ctx2, t.etcdTestCli, task1, source2, rev2+1, opCh, errCh) cancel2() close(opCh) close(errCh) @@ -201,7 +208,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { // the lock should become resolved and deleted. op12c := op12 op12c.Done = true - done, _, err = pessimism.PutOperationDeleteExistInfo(etcdTestCli, op12c, i12) + done, _, err = pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op12c, i12) c.Assert(err, IsNil) c.Assert(done, IsTrue) c.Assert(utils.WaitSomething(50, 100*time.Millisecond, func() bool { @@ -212,9 +219,9 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { c.Assert(p.ShowLocks("", nil), HasLen, 0) // PUT i21, i22, this will create a lock. - _, err = pessimism.PutInfo(etcdTestCli, i21) + _, err = pessimism.PutInfo(t.etcdTestCli, i21) c.Assert(err, IsNil) - _, err = pessimism.PutInfo(etcdTestCli, i22) + _, err = pessimism.PutInfo(t.etcdTestCli, i22) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { lock := p.Locks()[ID2] @@ -255,7 +262,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { c.Assert(p.ShowLocks("", []string{"not-exist"}), HasLen, 0) // PUT i23, then the lock will become synced. - rev3, err := pessimism.PutInfo(etcdTestCli, i23) + rev3, err := pessimism.PutInfo(t.etcdTestCli, i23) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { synced, _ = p.Locks()[ID2].IsSynced() @@ -268,7 +275,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { ctx2, cancel2 = context.WithTimeout(ctx, watchTimeout) // both source1 and source2 have shard DDL info exist, and neither of them have operation exist. // we must ensure source1 always become the owner of the lock. - pessimism.WatchOperationPut(ctx2, etcdTestCli, task2, source1, rev3+1, opCh, errCh) + pessimism.WatchOperationPut(ctx2, t.etcdTestCli, task2, source1, rev3+1, opCh, errCh) cancel2() close(opCh) close(errCh) @@ -289,7 +296,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { // mark exec operation for the owner as `done` (and delete the info). op21c := op21 op21c.Done = true - done, _, err = pessimism.PutOperationDeleteExistInfo(etcdTestCli, op21c, i21) + done, _, err = pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op21c, i21) c.Assert(err, IsNil) c.Assert(done, IsTrue) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { @@ -307,7 +314,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { // mark exec operation for one non-owner as `done` (and delete the info). op22c := pessimism.NewOperation(ID2, task2, source2, DDLs, false, true) - done, _, err = pessimism.PutOperationDeleteExistInfo(etcdTestCli, op22c, i22) + done, _, err = pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op22c, i22) c.Assert(err, IsNil) c.Assert(done, IsTrue) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { @@ -327,7 +334,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { // mark skip operation for the non-owner as `done` (and delete the info). // the lock should become resolved and deleted. op23c := pessimism.NewOperation(ID2, task2, source3, DDLs, false, true) - done, _, err = pessimism.PutOperationDeleteExistInfo(etcdTestCli, op23c, i23) + done, _, err = pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op23c, i23) c.Assert(err, IsNil) c.Assert(done, IsTrue) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { @@ -344,7 +351,7 @@ func (t *testPessimist) testPessimistProgress(c *C, restart int) { func (t *testPessimist) TestSourceReEntrant(c *C) { // sources (owner or non-owner) may be interrupted and re-run the sequence again. - defer clearTestInfoOperation(c) + defer t.clearTestInfoOperation(c) var ( watchTimeout = 3 * time.Second @@ -376,14 +383,14 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { defer cancel() // 0. start the pessimist. - c.Assert(p.Start(ctx, etcdTestCli), IsNil) + c.Assert(p.Start(ctx, t.etcdTestCli), IsNil) c.Assert(p.Locks(), HasLen, 0) defer p.Close() // 1. PUT i11 and i12, will create a lock but not synced. - _, err := pessimism.PutInfo(etcdTestCli, i11) + _, err := pessimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) - _, err = pessimism.PutInfo(etcdTestCli, i12) + _, err = pessimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { lock := p.Locks()[ID] @@ -395,11 +402,11 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { }), IsTrue) // 2. re-PUT i11, to simulate the re-entrant of the owner before the lock become synced. - rev1, err := pessimism.PutInfo(etcdTestCli, i11) + rev1, err := pessimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) // 3. re-PUT i12, to simulate the re-entrant of the non-owner before the lock become synced. - rev2, err := pessimism.PutInfo(etcdTestCli, i12) + rev2, err := pessimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) // 4. wait exec operation for the owner become available. @@ -410,7 +417,7 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { opCh := make(chan pessimism.Operation, 10) errCh := make(chan error, 10) ctx2, cancel2 := context.WithTimeout(ctx, watchTimeout) - pessimism.WatchOperationPut(ctx2, etcdTestCli, task, source1, rev1+1, opCh, errCh) + pessimism.WatchOperationPut(ctx2, t.etcdTestCli, task, source1, rev1+1, opCh, errCh) cancel2() close(opCh) close(errCh) @@ -422,19 +429,19 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { }() // 5. put i13, the lock will become synced, then an operation PUT for the owner will be triggered. - _, err = pessimism.PutInfo(etcdTestCli, i13) + _, err = pessimism.PutInfo(t.etcdTestCli, i13) c.Assert(err, IsNil) wg.Wait() // 6. re-PUT i11, to simulate the re-entrant of the owner after the lock become synced. - rev1, err = pessimism.PutInfo(etcdTestCli, i11) + rev1, err = pessimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) // 8. wait exec operation for the owner become available again (with new revision). opCh := make(chan pessimism.Operation, 10) errCh := make(chan error, 10) ctx2, cancel2 := context.WithTimeout(ctx, watchTimeout) - pessimism.WatchOperationPut(ctx2, etcdTestCli, task, source1, rev1+1, opCh, errCh) + pessimism.WatchOperationPut(ctx2, t.etcdTestCli, task, source1, rev1+1, opCh, errCh) cancel2() close(opCh) close(errCh) @@ -451,7 +458,7 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { opCh = make(chan pessimism.Operation, 10) errCh = make(chan error, 10) ctx2, cancel2 = context.WithTimeout(ctx, watchTimeout) - pessimism.WatchOperationPut(ctx2, etcdTestCli, task, source2, rev2+1, opCh, errCh) + pessimism.WatchOperationPut(ctx2, t.etcdTestCli, task, source2, rev2+1, opCh, errCh) cancel2() close(opCh) close(errCh) @@ -465,7 +472,7 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { // 10. mark exec operation for the owner as `done` (and delete the info). op11c := op11 op11c.Done = true - done, _, err := pessimism.PutOperationDeleteExistInfo(etcdTestCli, op11c, i11) + done, _, err := pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op11c, i11) c.Assert(err, IsNil) c.Assert(done, IsTrue) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { @@ -474,14 +481,14 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { wg.Wait() // 11. re-PUT i12, to simulate the re-entrant of the non-owner after the lock become synced. - rev2, err = pessimism.PutInfo(etcdTestCli, i12) + rev2, err = pessimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) // 12. wait skip operation for the non-owner become available again (with new revision, without existing done). opCh = make(chan pessimism.Operation, 10) errCh = make(chan error, 10) ctx2, cancel2 = context.WithTimeout(ctx, watchTimeout) - pessimism.WatchOperationPut(ctx2, etcdTestCli, task, source2, rev2+1, opCh, errCh) + pessimism.WatchOperationPut(ctx2, t.etcdTestCli, task, source2, rev2+1, opCh, errCh) cancel2() close(opCh) close(errCh) @@ -494,7 +501,7 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { // 13. mark skip operation for the non-owner as `done` (and delete the info). op12c := op12 op12c.Done = true - done, _, err = pessimism.PutOperationDeleteExistInfo(etcdTestCli, op12c, i12) + done, _, err = pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op12c, i12) c.Assert(err, IsNil) c.Assert(done, IsTrue) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { @@ -502,14 +509,14 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { }), IsTrue) // 14. re-PUT i13, to simulate the re-entrant of the owner after the lock become synced. - rev3, err := pessimism.PutInfo(etcdTestCli, i13) + rev3, err := pessimism.PutInfo(t.etcdTestCli, i13) c.Assert(err, IsNil) // 15. wait skip operation for the non-owner become available again (with new revision, with existing done). opCh = make(chan pessimism.Operation, 10) errCh = make(chan error, 10) ctx2, cancel2 = context.WithTimeout(ctx, watchTimeout) - pessimism.WatchOperationPut(ctx2, etcdTestCli, task, source3, rev3+1, opCh, errCh) + pessimism.WatchOperationPut(ctx2, t.etcdTestCli, task, source3, rev3+1, opCh, errCh) cancel2() close(opCh) close(errCh) @@ -523,7 +530,7 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { // the lock should become resolved now. op13c := op13 op13c.Done = true - done, _, err = pessimism.PutOperationDeleteExistInfo(etcdTestCli, op13c, i13) + done, _, err = pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op13c, i13) c.Assert(err, IsNil) c.Assert(done, IsTrue) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { @@ -535,7 +542,7 @@ func (t *testPessimist) TestSourceReEntrant(c *C) { func (t *testPessimist) TestUnlockSourceMissBeforeSynced(c *C) { // some sources may be deleted (miss) before the lock become synced. - defer clearTestInfoOperation(c) + defer t.clearTestInfoOperation(c) oriUnlockWaitOwnerInterval := unlockWaitInterval unlockWaitInterval = 100 * time.Millisecond @@ -573,7 +580,7 @@ func (t *testPessimist) TestUnlockSourceMissBeforeSynced(c *C) { // 0. start the pessimist. c.Assert(terror.ErrMasterPessimistNotStarted.Equal(p.UnlockLock(ctx, ID, "", false)), IsTrue) - c.Assert(p.Start(ctx, etcdTestCli), IsNil) + c.Assert(p.Start(ctx, t.etcdTestCli), IsNil) c.Assert(p.Locks(), HasLen, 0) defer p.Close() @@ -582,9 +589,9 @@ func (t *testPessimist) TestUnlockSourceMissBeforeSynced(c *C) { // 1. PUT i11 & i12, will create a lock but now synced. // not PUT info for source3 to simulate the deletion of it. - _, err := pessimism.PutInfo(etcdTestCli, i11) + _, err := pessimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) - rev1, err := pessimism.PutInfo(etcdTestCli, i12) + rev1, err := pessimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { if len(p.Locks()) != 1 { @@ -628,7 +635,7 @@ func (t *testPessimist) TestUnlockSourceMissBeforeSynced(c *C) { func (t *testPessimist) TestUnlockSourceInterrupt(c *C) { // operations may be done but not be deleted, and then interrupted. - defer clearTestInfoOperation(c) + defer t.clearTestInfoOperation(c) oriUnlockWaitOwnerInterval := unlockWaitInterval unlockWaitInterval = 100 * time.Millisecond @@ -664,15 +671,15 @@ func (t *testPessimist) TestUnlockSourceInterrupt(c *C) { defer cancel() // 0. start the pessimist. - c.Assert(p.Start(ctx, etcdTestCli), IsNil) + c.Assert(p.Start(ctx, t.etcdTestCli), IsNil) c.Assert(p.Locks(), HasLen, 0) defer p.Close() // CASE 1: owner interrupted. // 1. PUT i11 & i12, will create a lock and synced. - rev1, err := pessimism.PutInfo(etcdTestCli, i11) + rev1, err := pessimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) - _, err = pessimism.PutInfo(etcdTestCli, i12) + _, err = pessimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { if len(p.Locks()) != 1 { @@ -691,7 +698,7 @@ func (t *testPessimist) TestUnlockSourceInterrupt(c *C) { opCh := make(chan pessimism.Operation, 10) errCh := make(chan error, 10) ctx2, cancel2 := context.WithTimeout(ctx, watchTimeout) - pessimism.WatchOperationPut(ctx2, etcdTestCli, task, "", rev1+1, opCh, errCh) + pessimism.WatchOperationPut(ctx2, t.etcdTestCli, task, "", rev1+1, opCh, errCh) cancel2() close(opCh) close(errCh) @@ -713,9 +720,9 @@ func (t *testPessimist) TestUnlockSourceInterrupt(c *C) { // CASE 2: non-owner interrupted. // 1. PUT i11 & i12, will create a lock and synced. - rev1, err = pessimism.PutInfo(etcdTestCli, i11) + rev1, err = pessimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) - _, err = pessimism.PutInfo(etcdTestCli, i12) + _, err = pessimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { if len(p.Locks()) != 1 { @@ -744,7 +751,7 @@ func (t *testPessimist) TestUnlockSourceInterrupt(c *C) { func (t *testPessimist) TestUnlockSourceOwnerRemoved(c *C) { // the owner may be deleted before the lock become synced. - defer clearTestInfoOperation(c) + defer t.clearTestInfoOperation(c) oriUnlockWaitOwnerInterval := unlockWaitInterval unlockWaitInterval = 100 * time.Millisecond @@ -781,7 +788,7 @@ func (t *testPessimist) TestUnlockSourceOwnerRemoved(c *C) { defer cancel() // 0. start the pessimist. - c.Assert(p.Start(ctx, etcdTestCli), IsNil) + c.Assert(p.Start(ctx, t.etcdTestCli), IsNil) c.Assert(p.Locks(), HasLen, 0) defer p.Close() @@ -789,9 +796,9 @@ func (t *testPessimist) TestUnlockSourceOwnerRemoved(c *C) { c.Assert(terror.ErrMasterLockNotFound.Equal(p.UnlockLock(ctx, ID, "", false)), IsTrue) // 1. PUT i11 & i12, will create a lock but now synced. - _, err := pessimism.PutInfo(etcdTestCli, i11) + _, err := pessimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) - rev1, err := pessimism.PutInfo(etcdTestCli, i12) + rev1, err := pessimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { if len(p.Locks()) != 1 { @@ -831,7 +838,7 @@ func (t *testPessimist) TestUnlockSourceOwnerRemoved(c *C) { } func (t *testPessimist) TestMeetEtcdCompactError(c *C) { - defer clearTestInfoOperation(c) + defer t.clearTestInfoOperation(c) var ( watchTimeout = 3 * time.Second @@ -870,37 +877,37 @@ func (t *testPessimist) TestMeetEtcdCompactError(c *C) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - p.cli = etcdTestCli + p.cli = t.etcdTestCli for i := 0; i <= 1; i++ { // i == 0, watch info is compacted; i == 1, watch operation is compacted // step 1: trigger an etcd compaction if i == 0 { - revCompacted, err = pessimism.PutInfo(etcdTestCli, i11) + revCompacted, err = pessimism.PutInfo(t.etcdTestCli, i11) } else { var putted bool - revCompacted, putted, err = pessimism.PutOperations(etcdTestCli, false, op) + revCompacted, putted, err = pessimism.PutOperations(t.etcdTestCli, false, op) c.Assert(putted, IsTrue) } c.Assert(err, IsNil) if i == 0 { - _, err = pessimism.DeleteInfosOperations(etcdTestCli, []pessimism.Info{i11}, []pessimism.Operation{}) + _, err = pessimism.DeleteInfosOperations(t.etcdTestCli, []pessimism.Info{i11}, []pessimism.Operation{}) } else { - _, err = pessimism.DeleteOperations(etcdTestCli, op) + _, err = pessimism.DeleteOperations(t.etcdTestCli, op) } c.Assert(err, IsNil) - revThreshold, err := pessimism.PutInfo(etcdTestCli, i11) + revThreshold, err := pessimism.PutInfo(t.etcdTestCli, i11) c.Assert(err, IsNil) - _, err = etcdTestCli.Compact(ctx, revThreshold) + _, err = t.etcdTestCli.Compact(ctx, revThreshold) c.Assert(err, IsNil) infoCh = make(chan pessimism.Info, 10) errCh = make(chan error, 10) ctx1, cancel1 := context.WithTimeout(ctx, time.Second) if i == 0 { - pessimism.WatchInfoPut(ctx1, etcdTestCli, revCompacted, infoCh, errCh) + pessimism.WatchInfoPut(ctx1, t.etcdTestCli, revCompacted, infoCh, errCh) } else { - pessimism.WatchOperationPut(ctx1, etcdTestCli, "", "", revCompacted, opCh, errCh) + pessimism.WatchOperationPut(ctx1, t.etcdTestCli, "", "", revCompacted, opCh, errCh) } cancel1() select { @@ -920,7 +927,7 @@ func (t *testPessimist) TestMeetEtcdCompactError(c *C) { if i == 1 { rev1, rev2 = rev2, rev1 } - c.Assert(p.run(ctx2, etcdTestCli, rev1, rev2), IsNil) + c.Assert(p.run(ctx2, t.etcdTestCli, rev1, rev2), IsNil) }() // PUT i11, will create a lock but not synced. c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { @@ -932,7 +939,7 @@ func (t *testPessimist) TestMeetEtcdCompactError(c *C) { c.Assert(remain, Equals, 1) // PUT i12, the lock will be synced, then an operation PUT for the owner will be triggered. - rev1, err := pessimism.PutInfo(etcdTestCli, i12) + rev1, err := pessimism.PutInfo(t.etcdTestCli, i12) c.Assert(err, IsNil) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { synced, _ = p.Locks()[ID1].IsSynced() @@ -943,7 +950,7 @@ func (t *testPessimist) TestMeetEtcdCompactError(c *C) { opCh = make(chan pessimism.Operation, 10) errCh = make(chan error, 10) ctx3, cancel3 := context.WithTimeout(ctx, watchTimeout) - pessimism.WatchOperationPut(ctx3, etcdTestCli, task1, source1, rev1+1, opCh, errCh) + pessimism.WatchOperationPut(ctx3, t.etcdTestCli, task1, source1, rev1+1, opCh, errCh) cancel3() close(opCh) close(errCh) @@ -956,7 +963,7 @@ func (t *testPessimist) TestMeetEtcdCompactError(c *C) { // mark exec operation for the owner as `done` (and delete the info). op11c := op11 op11c.Done = true - done, rev2, err := pessimism.PutOperationDeleteExistInfo(etcdTestCli, op11c, i11) + done, rev2, err := pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op11c, i11) c.Assert(err, IsNil) c.Assert(done, IsTrue) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { @@ -967,7 +974,7 @@ func (t *testPessimist) TestMeetEtcdCompactError(c *C) { opCh = make(chan pessimism.Operation, 10) errCh = make(chan error, 10) ctx3, cancel3 = context.WithTimeout(ctx, watchTimeout) - pessimism.WatchOperationPut(ctx3, etcdTestCli, task1, source2, rev2+1, opCh, errCh) + pessimism.WatchOperationPut(ctx3, t.etcdTestCli, task1, source2, rev2+1, opCh, errCh) cancel3() close(opCh) close(errCh) @@ -981,7 +988,7 @@ func (t *testPessimist) TestMeetEtcdCompactError(c *C) { // the lock should become resolved and deleted. op12c := op12 op12c.Done = true - done, _, err = pessimism.PutOperationDeleteExistInfo(etcdTestCli, op12c, i12) + done, _, err = pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op12c, i12) c.Assert(err, IsNil) c.Assert(done, IsTrue) c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { @@ -1008,7 +1015,7 @@ func (t *testPessimist) putDoneForSource( wg.Add(2) go func() { defer wg.Done() - pessimism.WatchOperationPut(ctx2, etcdTestCli, task, source, watchRev, opCh, errCh) + pessimism.WatchOperationPut(ctx2, t.etcdTestCli, task, source, watchRev, opCh, errCh) close(opCh) close(errCh) }() @@ -1025,7 +1032,7 @@ func (t *testPessimist) putDoneForSource( c.Assert(op.Exec, Equals, exec) c.Assert(op.Done, IsFalse) op.Done = true - done, _, err := pessimism.PutOperationDeleteExistInfo(etcdTestCli, op, info) + done, _, err := pessimism.PutOperationDeleteExistInfo(t.etcdTestCli, op, info) c.Assert(err, IsNil) c.Assert(done, IsTrue) case err := <-errCh: @@ -1037,10 +1044,10 @@ func (t *testPessimist) putDoneForSource( func (t *testPessimist) noLockExist(c *C, p *Pessimist) { c.Assert(p.Locks(), HasLen, 0) - ifm, _, err := pessimism.GetAllInfo(etcdTestCli) + ifm, _, err := pessimism.GetAllInfo(t.etcdTestCli) c.Assert(err, IsNil) c.Assert(ifm, HasLen, 0) - opm, _, err := pessimism.GetAllOperations(etcdTestCli) + opm, _, err := pessimism.GetAllOperations(t.etcdTestCli) c.Assert(err, IsNil) c.Assert(opm, HasLen, 0) } From f74cd61210acb0c84732ffe153befa228378ec77 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Fri, 4 Mar 2022 16:02:12 +0800 Subject: [PATCH 11/11] remove debug message --- dm/dm/master/election_test.go | 1 - dm/dm/master/etcd.go | 8 -------- dm/dm/master/server_test.go | 2 +- dm/pkg/ha/subtask_test.go | 2 -- 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/dm/dm/master/election_test.go b/dm/dm/master/election_test.go index a6f42148913..8c52ddb4a0c 100644 --- a/dm/dm/master/election_test.go +++ b/dm/dm/master/election_test.go @@ -57,7 +57,6 @@ func (t *testElectionSuite) TestFailToStartLeader(c *check.C) { cfg1.InitialCluster = fmt.Sprintf("%s=%s", cfg1.Name, cfg1.AdvertisePeerUrls) s1 = NewServer(cfg1) - println(s1.cfg.InitialClusterState) c.Assert(s1.Start(ctx), check.IsNil) // wait the first one become the leader c.Assert(utils.WaitSomething(30, 100*time.Millisecond, func() bool { diff --git a/dm/dm/master/etcd.go b/dm/dm/master/etcd.go index c74033fbb3c..d0b4adfd3ab 100644 --- a/dm/dm/master/etcd.go +++ b/dm/dm/master/etcd.go @@ -50,15 +50,7 @@ func startEtcd(etcdCfg *embed.Config, etcdCfg.UserHandlers = httpHandles } - println("123213123\n\n\n123123123\n\n\n") - - go func() { - http.ListenAndServe(":8080", nil) - }() - e, err := embed.StartEtcd(etcdCfg) - println("345345435\n\n\n345345\n\n\n") - if err != nil { return nil, terror.ErrMasterStartEmbedEtcdFail.Delegate(err) } diff --git a/dm/dm/master/server_test.go b/dm/dm/master/server_test.go index b730583fee6..5f6b1b8793f 100644 --- a/dm/dm/master/server_test.go +++ b/dm/dm/master/server_test.go @@ -1392,7 +1392,7 @@ func (t *testMaster) TestServer(c *check.C) { basicServiceCheck(c, cfg) // try to start another server with the same address. Expect it to fail - // unset an etcd variable becuase it will cause checking on exit, and block forever + // unset an etcd variable because it will cause checking on exit, and block forever err = os.Unsetenv(verify.ENV_VERIFY) c.Assert(err, check.IsNil) diff --git a/dm/pkg/ha/subtask_test.go b/dm/pkg/ha/subtask_test.go index a2a8fd71042..0ea6b62c1e0 100644 --- a/dm/pkg/ha/subtask_test.go +++ b/dm/pkg/ha/subtask_test.go @@ -15,7 +15,6 @@ package ha import ( "context" - "os" . "github.com/pingcap/check" @@ -25,7 +24,6 @@ import ( func (t *testForEtcd) TestSubTaskEtcd(c *C) { defer clearTestInfoOperation(c) - println(os.Getwd()) cfg1 := config.SubTaskConfig{} c.Assert(cfg1.Decode(config.SampleSubtaskConfig, true), IsNil) source := cfg1.SourceID