diff --git a/br/pkg/task/stream.go b/br/pkg/task/stream.go index 8596eb89d6974..ced88b27e3f3d 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