Skip to content

Commit

Permalink
Unified way to disable resource group (pingcap#350)
Browse files Browse the repository at this point in the history
* Revert "disable resource group sql interface (pingcap#309)"

This reverts commit 1582986.

* new way to disable resource group

Signed-off-by: zeminzhou <[email protected]>

---------

Signed-off-by: zeminzhou <[email protected]>
  • Loading branch information
zeminzhou authored Apr 12, 2023
1 parent 21b0a17 commit e8fcf67
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 @@ -182,7 +182,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 @@ -2334,10 +2334,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 @@ -200,6 +200,7 @@ func IsInvisibleSysVar(varNameInLower string) bool {
variable.TiDBStmtSummaryFilename,
tidbAuditRetractLog,
variable.TiDBEnableAsyncCommit,
variable.TiDBEnableResourceControl,
variable.DataDir:
return true
}
Expand Down

0 comments on commit e8fcf67

Please sign in to comment.