Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-22.2: tenant: add apiv2 support for sql-over-http #91994

Merged

Conversation

dhartunian
Copy link
Collaborator

@dhartunian dhartunian commented Nov 16, 2022

This commit adds partial support for the /api/v2 HTTP server on tenants.
Currently, we only support the SQL endpoint since this functionality is
needed by newer DB Console features.

The API V2 Server initialization no longer relies on the global Server
object, and only requires a SQLServer instead which makes it easier to play
nicely with tenants. However, we still have the problem of incompatible status
and admin servers which are in use on other endpoints. Future work will unify
the tenant scoped versions of these servers and allow them to be used here,
enabling full API V2 compatibility on tenants.

Release note (ops change): sql tenants now support the HTTP endpoint under
/api/v2/sql which allows the caller to execute an HTTP request containing SQL
statements to execute. The JSON response contains the results. This endpoints
works identically as on a non-tenant server, except that it naturally scopes to
the target tenant for SQL execution.

Epic: CRDB-17356

Backport:

Please see individual PRs for details.

/cc @cockroachdb/release


Release Justification: Low-risk high-impact additive feature to support more SQL Obs features for tenants

This commit adds partial support for the `/api/v2` HTTP server on tenants.
Currently, we *only* support the SQL endpoint since this functionality is
needed by newer DB Console features.

The API V2 Server initialization no longer relies on the global `Server`
object, and only requires a `SQLServer` instead which makes it easier to play
nicely with tenants. However, we still have the problem of incompatible status
and admin servers which are in use on other endpoints. Future work will unify
the tenant scoped versions of these servers and allow them to be used here,
enabling full API V2 compatibility on tenants.

Release note (ops change): sql tenants now support the HTTP endpoint under
`/api/v2/sql` which allows the caller to execute an HTTP request containing SQL
statements to execute. The JSON response contains the results. This endpoints
works identically as on a non-tenant server, except that it naturally scopes to
the target tenant for SQL execution.

Epic: CRDB-17356
Epic: None
Resolves: cockroachdb#91829
Release note: None
@dhartunian dhartunian requested review from a team November 16, 2022 16:34
@dhartunian dhartunian requested review from a team as code owners November 16, 2022 16:34
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@dhartunian dhartunian changed the title tenant: add apiv2 support for sql-over-http release-22.2: tenant: add apiv2 support for sql-over-http Nov 17, 2022
@dhartunian dhartunian merged commit 14718c5 into cockroachdb:release-22.2 Nov 21, 2022
@dhartunian dhartunian deleted the backport22.2-91323-91840 branch November 21, 2022 20:03
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.

3 participants