From 2c8bcf70d31161530828bfd06fac3198f6b4a043 Mon Sep 17 00:00:00 2001 From: lysu Date: Thu, 11 Jun 2020 13:53:48 +0800 Subject: [PATCH 1/2] cherry pick #17885 to release-3.1 Signed-off-by: sre-bot --- domain/domain.go | 5 ++--- store/tikv/kv.go | 14 +++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/domain/domain.go b/domain/domain.go index 4810114cefc58..beaf9a9f25d54 100644 --- a/domain/domain.go +++ b/domain/domain.go @@ -619,9 +619,8 @@ func (do *Domain) Init(ddlLease time.Duration, sysFactory func(*Domain) (pools.R DialOptions: []grpc.DialOption{ grpc.WithBackoffMaxDelay(time.Second * 3), grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: time.Duration(cfg.TiKVClient.GrpcKeepAliveTime) * time.Second, - Timeout: time.Duration(cfg.TiKVClient.GrpcKeepAliveTimeout) * time.Second, - PermitWithoutStream: true, + Time: time.Duration(cfg.TiKVClient.GrpcKeepAliveTime) * time.Second, + Timeout: time.Duration(cfg.TiKVClient.GrpcKeepAliveTimeout) * time.Second, }), }, TLS: ebd.TLSConfig(), diff --git a/store/tikv/kv.go b/store/tikv/kv.go index 751c2d4d0028a..71300a461b909 100755 --- a/store/tikv/kv.go +++ b/store/tikv/kv.go @@ -54,10 +54,19 @@ type Driver struct { func createEtcdKV(addrs []string, tlsConfig *tls.Config) (*clientv3.Client, error) { cli, err := clientv3.New(clientv3.Config{ +<<<<<<< HEAD Endpoints: addrs, AutoSyncInterval: 30 * time.Second, DialTimeout: 5 * time.Second, TLS: tlsConfig, +======= + Endpoints: addrs, + AutoSyncInterval: 30 * time.Second, + DialTimeout: 5 * time.Second, + TLS: tlsConfig, + DialKeepAliveTime: time.Second * time.Duration(cfg.TiKVClient.GrpcKeepAliveTime), + DialKeepAliveTimeout: time.Second * time.Duration(cfg.TiKVClient.GrpcKeepAliveTimeout), +>>>>>>> bbeb4d0... tikv: fix "Got too many pings" GRPC error in PD-server follower (#17885) }) if err != nil { return nil, errors.Trace(err) @@ -85,9 +94,8 @@ func (d Driver) Open(path string) (kv.Storage, error) { KeyPath: security.ClusterSSLKey, }, pd.WithGRPCDialOptions( grpc.WithKeepaliveParams(keepalive.ClientParameters{ - Time: time.Duration(tikvConfig.GrpcKeepAliveTime) * time.Second, - Timeout: time.Duration(tikvConfig.GrpcKeepAliveTimeout) * time.Second, - PermitWithoutStream: true, + Time: time.Duration(tikvConfig.GrpcKeepAliveTime) * time.Second, + Timeout: time.Duration(tikvConfig.GrpcKeepAliveTimeout) * time.Second, }), )) From 6d6c55a7040aff5592bb5e2a968b3059ef30d964 Mon Sep 17 00:00:00 2001 From: lysu Date: Thu, 11 Jun 2020 14:00:59 +0800 Subject: [PATCH 2/2] address conflict --- store/tikv/kv.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/store/tikv/kv.go b/store/tikv/kv.go index 71300a461b909..07efb681dbd02 100755 --- a/store/tikv/kv.go +++ b/store/tikv/kv.go @@ -54,19 +54,10 @@ type Driver struct { func createEtcdKV(addrs []string, tlsConfig *tls.Config) (*clientv3.Client, error) { cli, err := clientv3.New(clientv3.Config{ -<<<<<<< HEAD Endpoints: addrs, AutoSyncInterval: 30 * time.Second, DialTimeout: 5 * time.Second, TLS: tlsConfig, -======= - Endpoints: addrs, - AutoSyncInterval: 30 * time.Second, - DialTimeout: 5 * time.Second, - TLS: tlsConfig, - DialKeepAliveTime: time.Second * time.Duration(cfg.TiKVClient.GrpcKeepAliveTime), - DialKeepAliveTimeout: time.Second * time.Duration(cfg.TiKVClient.GrpcKeepAliveTimeout), ->>>>>>> bbeb4d0... tikv: fix "Got too many pings" GRPC error in PD-server follower (#17885) }) if err != nil { return nil, errors.Trace(err)