Skip to content

Commit 3381b90

Browse files
ti-chi-botiosmanthus
authored andcommitted
lightning: revert db timeout changes for analyze (pingcap#41012) (pingcap#41343)
close pingcap#40941
1 parent 53587a2 commit 3381b90

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

br/pkg/lightning/common/util.go

-4
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ const (
4444
retryTimeout = 3 * time.Second
4545

4646
defaultMaxRetry = 3
47-
48-
dbTimeout = 30 * time.Second
4947
)
5048

5149
// MySQLConnectParam records the parameters needed to connect to a MySQL database.
@@ -76,8 +74,6 @@ func (param *MySQLConnectParam) ToDriverConfig() *mysql.Config {
7674
cfg.Params["charset"] = "utf8mb4"
7775
cfg.Params["sql_mode"] = fmt.Sprintf("'%s'", param.SQLMode)
7876
cfg.MaxAllowedPacket = int(param.MaxAllowedPacket)
79-
cfg.ReadTimeout = dbTimeout
80-
cfg.WriteTimeout = dbTimeout
8177

8278
cfg.TLS = param.TLSConfig
8379
cfg.AllowFallbackToPlaintext = param.AllowFallbackToPlaintext

br/pkg/lightning/config/config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ func TestLoadConfig(t *testing.T) {
764764
err = taskCfg.Adjust(context.Background())
765765
require.NoError(t, err)
766766
equivalentDSN := taskCfg.Checkpoint.MySQLParam.ToDriverConfig().FormatDSN()
767-
expectedDSN := "guest:12345@tcp(172.16.30.11:4001)/?readTimeout=30s&writeTimeout=30s&maxAllowedPacket=67108864&charset=utf8mb4&sql_mode=%27ONLY_FULL_GROUP_BY%2CSTRICT_TRANS_TABLES%2CNO_ZERO_IN_DATE%2CNO_ZERO_DATE%2CERROR_FOR_DIVISION_BY_ZERO%2CNO_AUTO_CREATE_USER%2CNO_ENGINE_SUBSTITUTION%27"
767+
expectedDSN := "guest:12345@tcp(172.16.30.11:4001)/?maxAllowedPacket=67108864&charset=utf8mb4&sql_mode=%27ONLY_FULL_GROUP_BY%2CSTRICT_TRANS_TABLES%2CNO_ZERO_IN_DATE%2CNO_ZERO_DATE%2CERROR_FOR_DIVISION_BY_ZERO%2CNO_AUTO_CREATE_USER%2CNO_ENGINE_SUBSTITUTION%27"
768768
require.Equal(t, expectedDSN, equivalentDSN)
769769

770770
result := taskCfg.String()

br/pkg/lightning/config/const.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ const (
4141

4242
var (
4343
DefaultGrpcKeepaliveParams = grpc.WithKeepaliveParams(keepalive.ClientParameters{
44-
Time: 10 * time.Second,
45-
Timeout: 20 * time.Second,
44+
Time: 1 * time.Minute,
45+
Timeout: 2 * time.Minute,
4646
PermitWithoutStream: false,
4747
})
4848
)

0 commit comments

Comments
 (0)