Skip to content

Commit 8506cf9

Browse files
authored
br: ensure schemaLease is the normal (45s) instead of test value (1s) (#66092)
close #66110
1 parent 84c32c3 commit 8506cf9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

br/pkg/gluetidb/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ go_library(
2525
"//pkg/session",
2626
"//pkg/session/sessionapi",
2727
"//pkg/sessionctx",
28+
"//pkg/sessionctx/vardef",
2829
"@com_github_pingcap_errors//:errors",
2930
"@com_github_pingcap_log//:log",
3031
"@com_github_tikv_pd_client//:client",

br/pkg/gluetidb/glue.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"github.com/pingcap/tidb/pkg/session"
2626
"github.com/pingcap/tidb/pkg/session/sessionapi"
2727
"github.com/pingcap/tidb/pkg/sessionctx"
28+
"github.com/pingcap/tidb/pkg/sessionctx/vardef"
2829
pd "github.com/tikv/pd/client"
2930
"go.uber.org/zap"
3031
)
@@ -40,6 +41,9 @@ const brComment = `/*from(br)*/`
4041
// New makes a new tidb glue.
4142
func New() Glue {
4243
log.Debug("enabling no register config")
44+
// Set schema lease to production value (45s) instead of test default (1s)
45+
// to prevent BR from getting stuck when PD TSO slightly lags wall clock.
46+
vardef.SetSchemaLease(config.DefSchemaLease)
4347
config.UpdateGlobal(func(conf *config.Config) {
4448
conf.SkipRegisterToDashboard = true
4549
conf.Log.EnableSlowLog.Store(false)

0 commit comments

Comments
 (0)