Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TiDBLogFileMaxDays and TiDBConfig should be ScopeInstance #35190

Closed
morgo opened this issue Jun 6, 2022 · 1 comment · Fixed by #35733
Closed

TiDBLogFileMaxDays and TiDBConfig should be ScopeInstance #35190

morgo opened this issue Jun 6, 2022 · 1 comment · Fixed by #35733
Labels
sig/sql-infra SIG: SQL Infra type/enhancement The issue or PR belongs to an enhancement.

Comments

@morgo
Copy link
Contributor

morgo commented Jun 6, 2022

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

From manual inspection of code:

{Scope: ScopeSession, Name: TiDBLogFileMaxDays, Value: strconv.Itoa(config.GetGlobalConfig().Log.File.MaxDays), Type: TypeInt, MinValue: 0, MaxValue: math.MaxInt32, skipInit: true, SetSession: func(s *SessionVars, val string) error {
maxAge, err := strconv.ParseInt(val, 10, 32)
if err != nil {
return err
}
GlobalLogMaxDays.Store(int32(maxAge))
cfg := config.GetGlobalConfig().Log.ToLogConfig()
cfg.Config.File.MaxDays = int(maxAge)
err = logutil.ReplaceLogger(cfg)
if err != nil {
return err
}
return nil
}, GetSession: func(s *SessionVars) (string, error) {
return strconv.FormatInt(int64(GlobalLogMaxDays.Load()), 10), nil
}},
{Scope: ScopeSession, Name: TiDBConfig, Value: "", ReadOnly: true, skipInit: true, GetSession: func(s *SessionVars) (string, error) {
return config.GetJSONConfig()
}},

2. What did you expect to see? (Required)

These sysvars should be instance scoped. They have no relation to the current session.

3. What did you see instead (Required)

See above

4. What is your TiDB version? (Required)

master

@morgo morgo added the type/bug The issue is confirmed as a bug. label Jun 6, 2022
@bb7133 bb7133 added type/enhancement The issue or PR belongs to an enhancement. and removed type/bug The issue is confirmed as a bug. severity/moderate labels Jun 7, 2022
@bb7133
Copy link
Member

bb7133 commented Jun 7, 2022

There was no instance scoped variables at the time tidb_log_file_max_days was introduced, so I would treat this issue as 'enhancement'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/sql-infra SIG: SQL Infra type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants