Skip to content

Commit 8492f75

Browse files
authored
br: Change default check point lag limit (#51906)
ref #50803
1 parent 490e17c commit 8492f75

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

br/pkg/streamhelper/config/advancer_conf.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ const (
1414
flagFullScanDiffTick = "full-scan-tick"
1515
flagAdvancingByCache = "advancing-by-cache"
1616
flagTryAdvanceThreshold = "try-advance-threshold"
17+
flagCheckPointLagLimit = "check-point-lag-limit"
1718

1819
DefaultConsistencyCheckTick = 5
1920
DefaultTryAdvanceThreshold = 4 * time.Minute
20-
DefaultCheckPointLagLimit = 0
21+
DefaultCheckPointLagLimit = 48 * time.Hour
2122
DefaultBackOffTime = 5 * time.Second
2223
DefaultTickInterval = 12 * time.Second
2324
DefaultFullScanTick = 4
@@ -46,6 +47,8 @@ func DefineFlagsForCheckpointAdvancerConfig(f *pflag.FlagSet) {
4647
"From how long we trigger the tick (advancing the checkpoint).")
4748
f.Duration(flagTryAdvanceThreshold, DefaultTryAdvanceThreshold,
4849
"If the checkpoint lag is greater than how long, we would try to poll TiKV for checkpoints.")
50+
f.Duration(flagCheckPointLagLimit, DefaultCheckPointLagLimit,
51+
"The maximum lag could be tolerated for the checkpoint lag.")
4952
}
5053

5154
func Default() Config {
@@ -71,6 +74,10 @@ func (conf *Config) GetFromFlags(f *pflag.FlagSet) error {
7174
if err != nil {
7275
return err
7376
}
77+
conf.CheckPointLagLimit, err = f.GetDuration(flagCheckPointLagLimit)
78+
if err != nil {
79+
return err
80+
}
7481
return nil
7582
}
7683

br/pkg/task/stream.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var (
8282
StreamStatus = "log status"
8383
StreamTruncate = "log truncate"
8484
StreamMetadata = "log metadata"
85-
StreamCtl = "log ctl"
85+
StreamCtl = "log advancer"
8686

8787
skipSummaryCommandList = map[string]struct{}{
8888
StreamStatus: {},

0 commit comments

Comments
 (0)