From 36609708b14f9cc010a090fbe4bc518a580ae0a4 Mon Sep 17 00:00:00 2001 From: dongmen <20351731+asddongmen@users.noreply.github.com> Date: Sat, 6 May 2023 23:54:56 +0800 Subject: [PATCH] This is an automated cherry-pick of #8813 Signed-off-by: ti-chi-bot --- cdc/server.go | 8 ++++++++ dm/pkg/etcdutil/etcdutil.go | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cdc/server.go b/cdc/server.go index 9d7320bd949..945632260ed 100644 --- a/cdc/server.go +++ b/cdc/server.go @@ -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(), diff --git a/dm/pkg/etcdutil/etcdutil.go b/dm/pkg/etcdutil/etcdutil.go index 6b23deb0a76..421a93549f8 100644 --- a/dm/pkg/etcdutil/etcdutil.go +++ b/dm/pkg/etcdutil/etcdutil.go @@ -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, }) }