Skip to content

Commit

Permalink
Unified way to disable resource group (pingcap#350) (pingcap#562)
Browse files Browse the repository at this point in the history
new way disable ru
---------

Signed-off-by: zeminzhou <[email protected]>
  • Loading branch information
zeminzhou committed Aug 11, 2023
1 parent 17c5a3c commit 88761e1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion executor/infoschema_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (e *memtableRetriever) retrieve(ctx context.Context, sctx sessionctx.Contex
case infoschema.ClusterTableMemoryUsageOpsHistory:
err = e.setDataForClusterMemoryUsageOpsHistory(sctx)
case infoschema.TableResourceGroups:
// err = e.setDataFromResourceGroups() // Serverless: hides resource groups from users.
err = e.setDataFromResourceGroups()
}
if err != nil {
return nil, err
Expand Down
4 changes: 0 additions & 4 deletions sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -2422,10 +2422,6 @@ var defaultSysVars = []*SysVar{
},
},
{Scope: ScopeGlobal, Name: TiDBEnableResourceControl, Value: BoolToOnOff(DefTiDBEnableResourceControl), Type: TypeBool, SetGlobal: func(ctx context.Context, vars *SessionVars, s string) error {
if TiDBOptOn(s) {
logutil.BgLogger().Info("refuse to enable resource control")
return errors.New("serverless clusters do not support resource control configurations")
}
if TiDBOptOn(s) != EnableResourceControl.Load() {
EnableResourceControl.Store(TiDBOptOn(s))
(*SetGlobalResourceControl.Load())(TiDBOptOn(s))
Expand Down
1 change: 1 addition & 0 deletions util/sem/sem.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ func IsInvisibleSysVar(varNameInLower string) bool {
variable.TiDBStmtSummaryFilename,
tidbAuditRetractLog,
variable.TiDBEnableAsyncCommit,
variable.TiDBEnableResourceControl,
variable.DataDir:
return true
}
Expand Down

0 comments on commit 88761e1

Please sign in to comment.