Skip to content

Commit

Permalink
Remove GC Mode since it is no longer effective
Browse files Browse the repository at this point in the history
  • Loading branch information
morgo committed Jan 6, 2021
1 parent b89cb9e commit 9bbf7fe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 1 addition & 3 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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\"",
}
Expand All @@ -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",
}

Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}},
}

Expand Down
12 changes: 5 additions & 7 deletions sessionctx/variable/tidb_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down

0 comments on commit 9bbf7fe

Please sign in to comment.