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

vtgate does not support killing queries #5497

Closed
aquarapid opened this issue Dec 4, 2019 · 3 comments · Fixed by #13371
Closed

vtgate does not support killing queries #5497

aquarapid opened this issue Dec 4, 2019 · 3 comments · Fixed by #13371
Assignees
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)

Comments

@aquarapid
Copy link
Contributor

This would be non-trivial to support, but adding here to track:

  • For long-running queries against vtgate, issuing a CTRL-C in the mysql client will generate a "KILL QUERY X" against vtgate, where "X" is the mysql process list id.
  • vtgate does not support this, and sends back an mysql ERR packet (0xff) with error code 1105 and SQL state HY000, and error message "vtgate: http://localhost:15001/: unrecognized statement: KILL QUERY 8"
  • This does not mean anything to the mysql client, which just continues waiting (hanging), besides printing something like " -- query aborted".

It would be ideal if we could somehow map the kill query to the running backend (vttablet) query and issue a (real) kill.

@aquarapid
Copy link
Contributor Author

As a generalization of this; this also means that JDBC Statement.cancel() will not work with Vitess (it does with MySQL with any recent MySQL Connector/J driver).

Note that since the MySQL Connector/J implementation of cancel() uses a second database connection to issue a KILL QUERY command for the query being canceled, this introduces an additional problem in that we can't necessarily guarantee that the initial connection and the second connection are to the same vtgate instance...

@derekperkins
Copy link
Member

This does work correctly with the gRPC client though, right?

@aquarapid
Copy link
Contributor Author

This does work correctly with the gRPC client though, right?

Yes it does; to clarify: I meant all of the above in the context of the MySQL protocol interface of vtgate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants