cockroachdb / cockroachdb/cockroach

admission: default resource group (id=1) with configurable Weight_CPU

Open
#173,085 3 comments 0 reactions 0 assignees View on GitHub
A-admission-control O-agent T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

Seed `system.resource_groups` with `(id=1, name='default', weight_cpu=, max_cpu=false)` on migration (extend [pkg/upgrade/upgrades/v26_3_resource_groups.go:19](https://github.com/cockroachdb/cockroach/blob/master/pkg/upgrade/upgrades/v26_3_resource_groups.go#L19)), expose the default's `Weight_CPU` via a cluster setting so behavior is tunable without DDL, route all requests with `ResourceGroupID == 0` to id=1 in the AC granter, and refuse `DROP RESOURCE GROUP default`. Today [`builtinGroupConfigs`](https://github.com/cockroachdb/cockroach/blob/master/pkg/util/admission/resource_group_config_holder.go#L117) covers only the two built-ins (high/low) and there's no explicit default. This is what makes "zero behavior change until a DBA creates a second group" true in practice. Persistent user/role/database mappings are still M3.

Epic CRDB-66372

Jira issue: CRDB-66385

Contributor guide

Open the contributing guide

Research direction

Start with pkg/upgrade/upgrades/v26_3_resource_groups.go:19 and pkg/util/admission/resource_group_config_holder.go:117, then trace the AC granter and existing resource-group DDL handling. Done means migration seeds id=1, the default Weight_CPU is tunable by cluster setting, zero IDs route to id=1, and DROP RESOURCE GROUP default is refused without implementing the M3 mappings.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sql
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.