Skip to content

[DNM] ccl/sqlproxyccl: wip#77419

Closed
jaylim-crl wants to merge 4 commits intocockroachdb:masterfrom
jaylim-crl:jay/wip-take2-connection-migration
Closed

[DNM] ccl/sqlproxyccl: wip#77419
jaylim-crl wants to merge 4 commits intocockroachdb:masterfrom
jaylim-crl:jay/wip-take2-connection-migration

Conversation

@jaylim-crl
Copy link
Copy Markdown
Contributor

No intention to merge this. Follow up for #76805.

Informs cockroachdb#76000. Extracted from cockroachdb#76805.

This commit adds helpers related to connection migration. This includes support
for retrieving the transfer state through SHOW TRANSFER STATE, as well as
deserializing the session through crdb_internal.deserialize_session.

Release note: None

Release justification: Helpers added in this commit are needed for the
connection migration work. Connection migration is currently not being used
in production, and CockroachCloud is the only user of sqlproxy.
Previously, we incorrectly defined defaultBufferSize as 16K bytes. Note that
2 << 13 is 16K bytes. This commit fixes that behavior to match the original
intention of 8K bytes.

Release note: None

Release justification: This fixes an unintentional buglet within the sqlproxy
code that was introduced with the interceptors back then. Not having this in
means we're using double the memory for each connection within the sqlproxy.
Informs cockroachdb#76000.

This commit completes the connection migration feature in the the forwarder
within sqlproxy. The idea is as described in the RFC.

A couple of new sqlproxy metrics have been added as well:
- proxy.conn_migration.requested
- proxy.conn_migration.success
- proxy.conn_migration.error_fatal
- proxy.conn_migration.error_recoverable
- proxy.conn_migration.attempted
- proxy.conn_migration.protocol_error

For more details, see metrics.go in the sqlproxyccl package.

Release note: none

Release justification: This completes the first half of the connection
migration feature. This is low risk as part of the code is guarded behind the
connection migration feature, which is currently not being used in production.
To add on, CockroachCloud is the only user of sqlproxy.
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@jaylim-crl
Copy link
Copy Markdown
Contributor Author

jaylim-crl commented Mar 7, 2022

See last commit. This is just a PR to demonstrate the idea, and there are no intentions of merging this.

@jaylim-crl jaylim-crl closed this Mar 13, 2022
@jaylim-crl jaylim-crl deleted the jay/wip-take2-connection-migration branch March 13, 2022 19:24
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