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

ccl/sqlproxyccl: enable a more graceful shutdown #82317

Merged
merged 1 commit into from
Jun 9, 2022

Conversation

pjtatlow
Copy link
Contributor

@pjtatlow pjtatlow commented Jun 1, 2022

When a drainSignal is received, the sql proxy now waits for all connections to
close within a certain time limit (59 minutes) before shutting down.

The next drainSignal will be ignored, but the third will forcefully shut down
the server by panicking. This is to resolve an issue with Kubernetes where
traffic could be lost during upgrades. See CC-5298 for more details.

Release notes: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@pjtatlow pjtatlow force-pushed the sqlproxy-graceful-shutdown branch 3 times, most recently from f5b24e8 to 22bab19 Compare June 6, 2022 19:41
@pjtatlow pjtatlow marked this pull request as ready for review June 6, 2022 20:27
@pjtatlow pjtatlow requested review from a team as code owners June 6, 2022 20:27
Copy link
Collaborator

@jeffswenson jeffswenson left a comment

Choose a reason for hiding this comment

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

LGTM

pkg/cli/mt_proxy.go Outdated Show resolved Hide resolved
pkg/ccl/sqlproxyccl/server.go Show resolved Hide resolved
@pjtatlow pjtatlow force-pushed the sqlproxy-graceful-shutdown branch from 22bab19 to 76d7ae1 Compare June 7, 2022 15:22
@pjtatlow pjtatlow force-pushed the sqlproxy-graceful-shutdown branch from 76d7ae1 to b393baa Compare June 7, 2022 15:51
When a drainSignal is received, the sql proxy now waits for all connections to
close within a certain time limit (59 minutes) before shutting down.

The next drainSignal will be ignored, but the third will forcefully shut down
the server by panicking. This is to resolve an issue with Kubernetes where
traffic could be lost during upgrades. See CC-5298 for more details.

Release notes: None
@pjtatlow pjtatlow force-pushed the sqlproxy-graceful-shutdown branch from b393baa to 628762b Compare June 7, 2022 21:23
Copy link
Contributor Author

@pjtatlow pjtatlow left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jeffswenson)


pkg/cli/mt_proxy.go line 168 at r1 (raw file):

Previously, pjtatlow (PJ Tatlow) wrote…

Yeah good idea, I'll do that now!

Done

@pjtatlow
Copy link
Contributor Author

pjtatlow commented Jun 9, 2022

Merging because TestBenchmarkExpectation/AlterRegions/alter_populated_database_add_region is unrelated

bors r+

@craig
Copy link
Contributor

craig bot commented Jun 9, 2022

Build succeeded:

@craig craig bot merged commit e09ce91 into cockroachdb:master Jun 9, 2022
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