Skip to content

Commit

Permalink
cherry pick pingcap#17885 to release-3.0
Browse files Browse the repository at this point in the history
Signed-off-by: sre-bot <[email protected]>
  • Loading branch information
lysu authored and sre-bot committed Jun 11, 2020
1 parent 5b7c596 commit 63bfd15
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
5 changes: 2 additions & 3 deletions domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,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(),
Expand Down
14 changes: 11 additions & 3 deletions store/tikv/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,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)
Expand Down Expand Up @@ -84,9 +93,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,
}),
))

Expand Down

0 comments on commit 63bfd15

Please sign in to comment.