Skip to content

sql: add TenantReadOnly cluster setting to restrict returned MigratableSession size #77302

@jaylim-crl

Description

@jaylim-crl

This is related to the on-going connection migration work.

Is your feature request related to a problem? Please describe.

We currently have the SHOW TRANSFER STATE statement returning data for serialized
session. However, we don't restrict the returned data size, which means that the user of
this (i.e. SQL Proxy) would need to manually guard the returned data to make sure that
we don't deserialize everything into the proxy's memory.

Describe the solution you'd like

We'd like a TenantReadOnly cluster setting that changes the behavior of serializeSessionState
to return an error whenever the total bytes for the MigratableSession proto exceeds this value.

Additional context
See discussion on Slack within the Serverless Engineering channel.

cc: @rafiss @jeffswenson

Jira issue: CRDB-13522
Epic CRDB-10457

Metadata

Metadata

Assignees

Labels

C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions