Skip to content

Commit

Permalink
br: optimize communication with tikv stores. (pingcap#31722)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaoming Zhang <zhanggaoming028@gmail.com>
  • Loading branch information
MoCuishle28 committed Jun 28, 2022
1 parent 6a9a6f1 commit 36b55d6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions br/pkg/restore/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1090,14 +1090,13 @@ func (rc *Client) switchTiKVMode(ctx context.Context, mode import_sstpb.SwitchMo
return errors.Trace(err)
}

opt := grpc.WithInsecure()
if rc.tlsConf != nil {
opt = grpc.WithTransportCredentials(credentials.NewTLS(rc.tlsConf))
}

finalStore := store
rc.workerPool.ApplyOnErrorGroup(eg,
func() error {
opt := grpc.WithInsecure()
if rc.tlsConf != nil {
opt = grpc.WithTransportCredentials(credentials.NewTLS(rc.tlsConf))
}
gctx, cancel := context.WithTimeout(ectx, time.Second*5)
connection, err := grpc.DialContext(
gctx,
Expand Down

0 comments on commit 36b55d6

Please sign in to comment.