diff --git a/config/config.go b/config/config.go index 02467c1c3a8c4..8b4eab7703c48 100644 --- a/config/config.go +++ b/config/config.go @@ -257,8 +257,10 @@ type Config struct { // The following items are deprecated. We need to keep them here temporarily // to support the upgrade process. They can be removed in future. - // EnableBatchDML, unused since bootstrap v90 - EnableBatchDML bool `toml:"enable-batch-dml" json:"enable-batch-dml"` + // EnableBatchDML, MemQuotaQuery, OOMAction unused since bootstrap v90 + EnableBatchDML bool `toml:"enable-batch-dml" json:"enable-batch-dml"` + MemQuotaQuery int64 `toml:"mem-quota-query" json:"mem-quota-query"` + OOMAction string `toml:"oom-action" json:"oom-action"` } // UpdateTempStoragePath is to update the `TempStoragePath` if port/statusPort was changed @@ -428,6 +430,12 @@ type Log struct { SlowThreshold uint64 `toml:"slow-threshold" json:"slow-threshold"` ExpensiveThreshold uint `toml:"expensive-threshold" json:"expensive-threshold"` RecordPlanInSlowLog uint32 `toml:"record-plan-in-slow-log" json:"record-plan-in-slow-log"` + + // The following items are deprecated. We need to keep them here temporarily + // to support the upgrade process. They can be removed in future. + + // QueryLogMaxLen, unused since bootstrap v90 + QueryLogMaxLen uint64 `toml:"query-log-max-len" json:"query-log-max-len"` } // Instance is the section of instance scope system variables. @@ -616,11 +624,12 @@ type Performance struct { StatsLoadConcurrency uint `toml:"stats-load-concurrency" json:"stats-load-concurrency"` StatsLoadQueueSize uint `toml:"stats-load-queue-size" json:"stats-load-queue-size"` EnableStatsCacheMemQuota bool `toml:"enable-stats-cache-mem-quota" json:"enable-stats-cache-mem-quota"` - // The following items are deprecated. We need to keep them here temporarily // to support the upgrade process. They can be removed in future. - RunAutoAnalyze bool `toml:"run-auto-analyze" json:"run-auto-analyze"` + // CommitterConcurrency, RunAutoAnalyze unused since bootstrap v90 + CommitterConcurrency int `toml:"committer-concurrency" json:"committer-concurrency"` + RunAutoAnalyze bool `toml:"run-auto-analyze" json:"run-auto-analyze"` } // PlanCache is the PlanCache section of the config. diff --git a/session/bootstrap.go b/session/bootstrap.go index 372a879e262fe..3e9a46fe4e878 100644 --- a/session/bootstrap.go +++ b/session/bootstrap.go @@ -615,7 +615,7 @@ const ( version88 = 88 // version89 adds the tables mysql.advisory_locks version89 = 89 - // version90 converts enable-batch-dml to a sysvar + // version90 converts enable-batch-dml, mem-quota-query, query-log-max-len, committer-concurrency, run-auto-analyze, and oom-action to a sysvar version90 = 90 ) @@ -1846,6 +1846,16 @@ func upgradeToVer90(s Session, ver int64) { } valStr := variable.BoolToOnOff(config.GetGlobalConfig().EnableBatchDML) importConfigOption(s, "enable-batch-dml", variable.TiDBEnableBatchDML, valStr) + valStr = fmt.Sprint(config.GetGlobalConfig().MemQuotaQuery) + importConfigOption(s, "mem-quota-query", variable.TiDBMemQuotaQuery, valStr) + valStr = fmt.Sprint((config.GetGlobalConfig().Log.QueryLogMaxLen), 10) + importConfigOption(s, "query-log-max-len", variable.TiDBQueryLogMaxLen, valStr) + valStr = fmt.Sprint(config.GetGlobalConfig().Performance.CommitterConcurrency) + importConfigOption(s, "committer-concurrency", variable.TiDBCommitterConcurrency, valStr) + valStr = variable.BoolToOnOff(config.GetGlobalConfig().Performance.RunAutoAnalyze) + importConfigOption(s, "run-auto-analyze", variable.TiDBEnableAutoAnalyze, valStr) + valStr = config.GetGlobalConfig().OOMAction + importConfigOption(s, "oom-action", variable.TiDBMemOOMAction, valStr) } func writeOOMAction(s Session) {