From 7ecf7932a0c639ae2effeffab27fde0d7d37c94e Mon Sep 17 00:00:00 2001 From: Ti Chi Robot Date: Tue, 14 Feb 2023 18:12:09 +0800 Subject: [PATCH] log-backup: should set default value `gc.ratio-threshold` after pitr finished (#40141) (#40366) close pingcap/tidb#40185 --- br/pkg/task/stream.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/br/pkg/task/stream.go b/br/pkg/task/stream.go index 6a0eaada78679..f8525dfae3fda 100644 --- a/br/pkg/task/stream.go +++ b/br/pkg/task/stream.go @@ -480,6 +480,12 @@ func KeepGcDisabled(g glue.Glue, store kv.Storage) (RestoreFunc, error) { return nil, errors.Trace(err) } + // If the oldRatio is negative, which is not normal status. + // It should set default value "1.1" after PiTR finished. + if strings.HasPrefix(oldRatio, "-") { + oldRatio = "1.1" + } + return func() error { return utils.SetGcRatio(execCtx, oldRatio) }, nil