Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed Sep 13, 2024
1 parent 521f8a1 commit 2aa95a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -1348,12 +1348,14 @@ var defaultSysVars = []*SysVar{
EnableInstancePlanCache.Store(TiDBOptOn(val))
return nil
}},
{Scope: ScopeGlobal, Name: TiDBInstancePlanCacheReservedPercentage, Value: "0.1", Type: TypeFloat, MinValue: 0, MaxValue: 1,
{Scope: ScopeGlobal, Name: TiDBInstancePlanCacheReservedPercentage,
Value: strconv.FormatFloat(DefTiDBInstancePlanCacheReservedPercentage, 'f', -1, 64),
Type: TypeFloat, MinValue: 0, MaxValue: 1,
GetGlobal: func(_ context.Context, s *SessionVars) (string, error) {
return strconv.FormatFloat(InstancePlanCacheReservedPercentage.Load(), 'f', -1, 64), nil
},
SetGlobal: func(_ context.Context, s *SessionVars, val string) error {
v := tidbOptFloat64(val, 0.1)
v := tidbOptFloat64(val, DefTiDBInstancePlanCacheReservedPercentage)
InstancePlanCacheReservedPercentage.Store(v)
return nil
}},
Expand Down
1 change: 1 addition & 0 deletions pkg/sessionctx/variable/tidb_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,7 @@ const (
DefTiDBNonPreparedPlanCacheSize = 100
DefTiDBPlanCacheMaxPlanSize = 2 * size.MB
DefTiDBInstancePlanCacheMaxMemSize = 100 * size.MB
DefTiDBInstancePlanCacheReservedPercentage = 0.1
// MaxDDLReorgBatchSize is exported for testing.
MaxDDLReorgBatchSize int32 = 10240
MinDDLReorgBatchSize int32 = 32
Expand Down

0 comments on commit 2aa95a1

Please sign in to comment.