Skip to content

Commit

Permalink
br: Change default check point lag limit (#51906)
Browse files Browse the repository at this point in the history
ref #50803
  • Loading branch information
BornChanger authored Mar 25, 2024
1 parent 490e17c commit 8492f75
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion br/pkg/streamhelper/config/advancer_conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ const (
flagFullScanDiffTick = "full-scan-tick"
flagAdvancingByCache = "advancing-by-cache"
flagTryAdvanceThreshold = "try-advance-threshold"
flagCheckPointLagLimit = "check-point-lag-limit"

DefaultConsistencyCheckTick = 5
DefaultTryAdvanceThreshold = 4 * time.Minute
DefaultCheckPointLagLimit = 0
DefaultCheckPointLagLimit = 48 * time.Hour
DefaultBackOffTime = 5 * time.Second
DefaultTickInterval = 12 * time.Second
DefaultFullScanTick = 4
Expand Down Expand Up @@ -46,6 +47,8 @@ func DefineFlagsForCheckpointAdvancerConfig(f *pflag.FlagSet) {
"From how long we trigger the tick (advancing the checkpoint).")
f.Duration(flagTryAdvanceThreshold, DefaultTryAdvanceThreshold,
"If the checkpoint lag is greater than how long, we would try to poll TiKV for checkpoints.")
f.Duration(flagCheckPointLagLimit, DefaultCheckPointLagLimit,
"The maximum lag could be tolerated for the checkpoint lag.")
}

func Default() Config {
Expand All @@ -71,6 +74,10 @@ func (conf *Config) GetFromFlags(f *pflag.FlagSet) error {
if err != nil {
return err
}
conf.CheckPointLagLimit, err = f.GetDuration(flagCheckPointLagLimit)
if err != nil {
return err
}
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion br/pkg/task/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ var (
StreamStatus = "log status"
StreamTruncate = "log truncate"
StreamMetadata = "log metadata"
StreamCtl = "log ctl"
StreamCtl = "log advancer"

skipSummaryCommandList = map[string]struct{}{
StreamStatus: {},
Expand Down

0 comments on commit 8492f75

Please sign in to comment.