From 8c70886eac833ec781a8d996b85cbea687be69e8 Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Thu, 18 Apr 2024 13:39:07 +0800 Subject: [PATCH] br: Change default check point lag limit (#51906) (#52570) ref pingcap/tidb#50803 --- br/pkg/streamhelper/config/advancer_conf.go | 9 ++++++++- br/pkg/task/stream.go | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/br/pkg/streamhelper/config/advancer_conf.go b/br/pkg/streamhelper/config/advancer_conf.go index b8fd1a03569a5..24b76741388fb 100644 --- a/br/pkg/streamhelper/config/advancer_conf.go +++ b/br/pkg/streamhelper/config/advancer_conf.go @@ -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 @@ -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 { @@ -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 } diff --git a/br/pkg/task/stream.go b/br/pkg/task/stream.go index d42156f618b04..f22250da09855 100644 --- a/br/pkg/task/stream.go +++ b/br/pkg/task/stream.go @@ -83,7 +83,7 @@ var ( StreamStatus = "log status" StreamTruncate = "log truncate" StreamMetadata = "log metadata" - StreamCtl = "log ctl" + StreamCtl = "log advancer" skipSummaryCommandList = map[string]struct{}{ StreamStatus: {},