Skip to content

Commit

Permalink
br: Change default check point lag limit (#51906) (#52115)
Browse files Browse the repository at this point in the history
ref #50803
  • Loading branch information
ti-chi-bot authored Mar 28, 2024
1 parent 9f59322 commit 0cc48c8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions 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 All @@ -40,9 +41,14 @@ type Config struct {
}

func DefineFlagsForCheckpointAdvancerConfig(f *pflag.FlagSet) {
f.Duration(flagBackoffTime, DefaultBackOffTime, "The gap between two retries.")
f.Duration(flagTickInterval, DefaultTickInterval, "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(flagBackoffTime, DefaultBackOffTime,
"The gap between two retries.")
f.Duration(flagTickInterval, DefaultTickInterval,
"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 @@ -68,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 @@ -80,7 +80,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 0cc48c8

Please sign in to comment.