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

Support SHUTDOWN SQL command (and protocol cmd) #5046

Closed
liubo0127 opened this issue Nov 8, 2017 · 7 comments
Closed

Support SHUTDOWN SQL command (and protocol cmd) #5046

liubo0127 opened this issue Nov 8, 2017 · 7 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility type/usability

Comments

@liubo0127
Copy link
Contributor

There is no smooth way to stop tidb and must stop the process by kill

@shenli
Copy link
Member

shenli commented Nov 8, 2017

OK, we will provide a way to shutdown tidb-server gracefully.

@morgo morgo changed the title Elegant disconnect tidb connection Support SHUTDOWN SQL command (and protocol cmd) Nov 24, 2018
@morgo
Copy link
Contributor

morgo commented Nov 24, 2018

I suggest supporting the MySQL way: a shutdown api command (that mysqladmin can call) and an sql statement used in newer versions (shutdown). MySQL 8.0 also has a restart command.

@shenli
Copy link
Member

shenli commented Dec 29, 2018

It is hard for tidb-server to stop all the cluster instances.

@morgo
Copy link
Contributor

morgo commented Dec 29, 2018

I think the semantic expected is just for a single instance shutdown. I looked into this the other day, and the logical way seemed to do it was for SHUTDOWN or the protocol cmd ComShutdown to send an interrupt signal to the process.

The signal will then be caught by the main package, and start shutdown (not-withstanding a current issue that garbage collection doesn't like to be interrupted).

Thus, SHUTDOWN is just a nicer version of a Control+c to the window running tidb-server.

@shenli shenli added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Feb 13, 2019
@ekalinin
Copy link
Contributor

@morgo

Both PRs were merged (parser + tidb).

@morgo
Copy link
Contributor

morgo commented Oct 21, 2019

/cc @SunRunAway ^^

@SunRunAway
Copy link
Contributor

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility type/usability
Projects
None yet
Development

No branches or pull requests

5 participants