From 9bbf7fe2ab87026ad91b2c238ad6945bd7c71c7d Mon Sep 17 00:00:00 2001 From: Morgan Tocker Date: Wed, 6 Jan 2021 12:38:05 -0700 Subject: [PATCH] Remove GC Mode since it is no longer effective --- session/session.go | 4 +--- sessionctx/variable/sysvar.go | 1 - sessionctx/variable/tidb_vars.go | 12 +++++------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/session/session.go b/session/session.go index 82d88151c9aac..964dec04e6257 100644 --- a/session/session.go +++ b/session/session.go @@ -103,7 +103,6 @@ var gcVariableComments = map[string]string{ variable.TiDBGCLifetime: "All versions within life time will not be collected by GC, at least 10m, in Go format.", variable.TiDBGCConcurrency: "How many goroutines used to do GC parallel, [1, 128], default 2", variable.TiDBGCEnable: "Current GC enable status", - variable.TiDBGCMode: "Mode of GC, \"central\" or \"distributed\"", tiKVGCAutoConcurrency: "Let TiDB pick the concurrency automatically. If set false, tikv_gc_concurrency will be used", variable.TiDBGCScanLockMode: "Mode of scanning locks, \"physical\" or \"legacy\"", } @@ -113,7 +112,6 @@ var gcVariableMap = map[string]string{ variable.TiDBGCLifetime: "tikv_gc_life_time", variable.TiDBGCConcurrency: "tikv_gc_concurrency", variable.TiDBGCEnable: "tikv_gc_enable", - variable.TiDBGCMode: "tikv_gc_mode", variable.TiDBGCScanLockMode: "tikv_gc_scan_lock_mode", } @@ -1011,7 +1009,7 @@ func (s *session) getExecRet(ctx sessionctx.Context, sql string) (string, error) func (s *session) varFromTiDBTable(name string) bool { switch name { - case variable.TiDBGCConcurrency, variable.TiDBGCEnable, variable.TiDBGCRunInterval, variable.TiDBGCLifetime, variable.TiDBGCMode, variable.TiDBGCScanLockMode: + case variable.TiDBGCConcurrency, variable.TiDBGCEnable, variable.TiDBGCRunInterval, variable.TiDBGCLifetime, variable.TiDBGCScanLockMode: return true } return false diff --git a/sessionctx/variable/sysvar.go b/sessionctx/variable/sysvar.go index a99f3e4757934..bbfd712fda3e4 100644 --- a/sessionctx/variable/sysvar.go +++ b/sessionctx/variable/sysvar.go @@ -1220,7 +1220,6 @@ var defaultSysVars = []*SysVar{ {Scope: ScopeGlobal, Name: TiDBGCRunInterval, Value: "10m0s", Type: TypeDuration, MinValue: int64(time.Minute * 10), MaxValue: math.MaxInt64}, {Scope: ScopeGlobal, Name: TiDBGCLifetime, Value: "10m0s", Type: TypeDuration, MinValue: int64(time.Minute * 10), MaxValue: math.MaxInt64}, {Scope: ScopeGlobal, Name: TiDBGCConcurrency, Value: "-1", Type: TypeInt, MinValue: 1, MaxValue: 128, AllowAutoValue: true}, - {Scope: ScopeGlobal, Name: TiDBGCMode, Value: "DISTRIBUTED", Type: TypeEnum, PossibleValues: []string{"DISTRIBUTED", "CENTRAL"}}, {Scope: ScopeGlobal, Name: TiDBGCScanLockMode, Value: "PHYSICAL", Type: TypeEnum, PossibleValues: []string{"PHYSICAL", "LEGACY"}}, } diff --git a/sessionctx/variable/tidb_vars.go b/sessionctx/variable/tidb_vars.go index 6f2c9cf48cf40..45139b4e8e46d 100644 --- a/sessionctx/variable/tidb_vars.go +++ b/sessionctx/variable/tidb_vars.go @@ -521,17 +521,15 @@ const ( // TiDB vars that have only global scope const ( - // TiDBGCEnable description + // TiDBGCEnable turns garbage collection on or OFF TiDBGCEnable = "tidb_gc_enable" - // TiDBGCRunInterval description + // TiDBGCRunInterval sets the interval that GC runs TiDBGCRunInterval = "tidb_gc_run_interval" - // TiDBGCLifetime description + // TiDBGCLifetime sets the retention window of older versions TiDBGCLifetime = "tidb_gc_life_time" - // TiDBGCConcurrency description + // TiDBGCConcurrency sets the concurrency of garbage collection. -1 = AUTO value TiDBGCConcurrency = "tidb_gc_concurrency" - // TiDBGCMode description - TiDBGCMode = "tidb_gc_mode" - // TiDBGCScanLockMode description + // TiDBGCScanLockMode enables the green GC feature (default) TiDBGCScanLockMode = "tidb_gc_scan_lock_mode" )