diff --git a/domain/domain.go b/domain/domain.go index be3224a67e167..5d70dd57cfb51 100644 --- a/domain/domain.go +++ b/domain/domain.go @@ -605,8 +605,9 @@ func (do *Domain) Init(ddlLease time.Duration, sysFactory func(*Domain) (pools.R if addrs := ebd.EtcdAddrs(); addrs != nil { cfg := config.GetGlobalConfig() cli, err := clientv3.New(clientv3.Config{ - Endpoints: addrs, - DialTimeout: 5 * time.Second, + Endpoints: addrs, + AutoSyncInterval: 30 * time.Second, + DialTimeout: 5 * time.Second, DialOptions: []grpc.DialOption{ grpc.WithUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor), grpc.WithStreamInterceptor(grpc_prometheus.StreamClientInterceptor), diff --git a/store/tikv/kv.go b/store/tikv/kv.go index 6fe75d2850a60..466c3b6f1564e 100644 --- a/store/tikv/kv.go +++ b/store/tikv/kv.go @@ -51,8 +51,9 @@ type Driver struct { func createEtcdKV(addrs []string, tlsConfig *tls.Config) (*clientv3.Client, error) { cli, err := clientv3.New(clientv3.Config{ - Endpoints: addrs, - DialTimeout: 5 * time.Second, + Endpoints: addrs, + AutoSyncInterval: 30 * time.Second, + DialTimeout: 5 * time.Second, DialOptions: []grpc.DialOption{ grpc.WithUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor), grpc.WithStreamInterceptor(grpc_prometheus.StreamClientInterceptor),