Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#8813
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
  • Loading branch information
asddongmen authored and ti-chi-bot committed May 6, 2023
1 parent 95b5db3 commit 3660970
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 8 additions & 0 deletions cdc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,19 @@ func (s *Server) Run(ctx context.Context) error {
logConfig.Level = zap.NewAtomicLevelAt(zapcore.ErrorLevel)

etcdCli, err := clientv3.New(clientv3.Config{
<<<<<<< HEAD:cdc/server.go
Endpoints: s.pdEndpoints,
TLS: tlsConfig,
Context: ctx,
LogConfig: &logConfig,
DialTimeout: 5 * time.Second,
=======
Endpoints: s.pdEndpoints,
TLS: tlsConfig,
LogConfig: &logConfig,
DialTimeout: 5 * time.Second,
AutoSyncInterval: 30 * time.Second,
>>>>>>> 58b465a9d0 (Etcd (ticdc, dm):add AutoSyncInterval for Etcd client (#8813)):cdc/server/server.go
DialOptions: []grpc.DialOption{
grpcTLSOption,
grpc.WithBlock(),
Expand Down
7 changes: 4 additions & 3 deletions dm/pkg/etcdutil/etcdutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ var etcdDefaultTxnStrategy = retry.FiniteRetryStrategy{}
// CreateClient creates an etcd client with some default config items.
func CreateClient(endpoints []string, tlsCfg *tls.Config) (*clientv3.Client, error) {
return clientv3.New(clientv3.Config{
Endpoints: endpoints,
DialTimeout: DefaultDialTimeout,
TLS: tlsCfg,
Endpoints: endpoints,
DialTimeout: DefaultDialTimeout,
AutoSyncInterval: 30 * time.Second,
TLS: tlsCfg,
})
}

Expand Down

0 comments on commit 3660970

Please sign in to comment.