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, }) }