Skip to content

sql, server: add TokenBucket connector API and tenant resource limits configuration API#67508

Closed
RaduBerinde wants to merge 3 commits intocockroachdb:masterfrom
RaduBerinde:mt-4-configure
Closed

sql, server: add TokenBucket connector API and tenant resource limits configuration API#67508
RaduBerinde wants to merge 3 commits intocockroachdb:masterfrom
RaduBerinde:mt-4-configure

Conversation

@RaduBerinde
Copy link
Copy Markdown
Member

These commits introduce a skeleton implementation of the distributed token bucket APIs (RFC #66436).

I'm mainly looking for feedback on how things are broken up into modules/packages, on naming, and on the system table interaction code.

Note: the first commit is #67008.


server: add TokenBucket connector API

This change adds the TokenBucket API proposed in the RFC (#66436), a
stub implementation for it, and the corresponding KV connector
interface.

The client and server-side code lives in
ccl/multitenantccl/tenantcostclient and tenantcostserver.

Release note: None

sql: tenant resource limits configuration API

This commit adds a crdb_internal.update_tenant_resource_limits
internal SQL function (to be used by the system tenant) which updates
the token bucket configuration for a specific tenant.

Release note: None

@RaduBerinde RaduBerinde requested review from a team, ajwerner and andy-kimball July 12, 2021 19:47
@RaduBerinde RaduBerinde requested a review from a team as a code owner July 12, 2021 19:47
@RaduBerinde RaduBerinde requested review from nihalpednekar and removed request for a team July 12, 2021 19:47
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@RaduBerinde RaduBerinde requested a review from sumeerbhola July 13, 2021 19:04
Add the system table described in the RFC (cockroachdb#66436).

The table is only created for the system tenant.

Release note: None
@RaduBerinde RaduBerinde force-pushed the mt-4-configure branch 3 times, most recently from ecf359a to 9dedf5c Compare July 15, 2021 18:52
This change adds the TokenBucket API proposed in the RFC (cockroachdb#66436), a
stub implementation for it, and the corresponding KV connector
interface.

The client and server-side code lives in
ccl/multitenantccl/tenantcostclient and tenantcostserver.

Release note: None
This commit adds a `crdb_internal.update_tenant_resource_limits`
internal SQL function (to be used by the system tenant) which updates
the token bucket configuration for a specific tenant.

Release note: None
@RaduBerinde RaduBerinde requested a review from a team as a code owner July 15, 2021 21:57
@RaduBerinde
Copy link
Copy Markdown
Member Author

Closing this for now since there is ongoing discussion in the RFC about the system table details. I will post a smaller PR that's even more of a skeleton and doesn't depend on the system table.

craig bot pushed a commit that referenced this pull request Jul 22, 2021
67067: server: require admin role to access node status r=bdarnell a=knz

Release note (security update): The node status retrieval endpoints
over HTTP (`/_status/nodes`, `/_status/nodes/<N>` and the web UI
`/#/reports/nodes`) have been updated to require the `admin` role from
the requesting user. This ensures that operational details such as
network addresses and command-line flags do not leak to unprivileged
users.

67733: colexecbase: extend support of casts r=yuzefovich a=yuzefovich

Addresses: #48135

See individual commits for details. After this PR we only need to add
more casts between natively supported types.

67768: sql, server: add skeleton TokenBucket connector and tenant resource limits configuration APIs r=RaduBerinde a=RaduBerinde

This PR is a scaled back version of #67508 where we don't use the system table at all. It's meant to put some of the infrastructure pieces in place and provide a stub API for reconfiguration.

The plan is to add consumption metrics on top of this soon so that CC can develop in parallel.

---

#### server: add TokenBucket connector API

This change adds the TokenBucket API proposed in the RFC (#66436), a
stub implementation and client for it, and the corresponding KV
connector interface.

The client and server-side code lives in
ccl/multitenantccl/tenantcostclient and tenantcostserver.

Release note: None

#### sql: tenant resource limits configuration API

This commit adds a `crdb_internal.update_tenant_resource_limits`
internal SQL function (to be used by the system tenant) which updates
the token bucket configuration for a specific tenant.

Release note: None


67840: sql: add test for creating stats on tables with expression indexes r=mgartner a=mgartner

Release note: None

Co-authored-by: Raphael 'kena' Poss <knz@thaumogen.net>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Radu Berinde <radu@cockroachlabs.com>
Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
@RaduBerinde RaduBerinde deleted the mt-4-configure branch July 28, 2021 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants