[MXS-3756] KILL behavior is not well documented Created: 2021-09-03 Updated: 2021-09-10 Resolved: 2021-09-10 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | Documentation |
| Affects Version/s: | 2.4.17, 2.5.15 |
| Fix Version/s: | 2.5.16 |
| Type: | Bug | Priority: | Major |
| Reporter: | Jeff Smelser | Assignee: | markus makela |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
DISTRIB_ID=Ubuntu |
||
| Description |
|
Original title: Maxscale just keeps running killed queries Every time I try to kill a query, I go directly to the backend and type kill <pid>; It kills off the query but maxscale decides to re-run it on another host. It will just keep doing that so a bad query that gets run is now nearly impossible to get rid of. We run on MySQL 5.7 if that makes a difference. |
| Comments |
| Comment by markus makela [ 2021-09-05 ] |
|
I think this is sort of expected behavior: MaxScale might not receive the error that tells the connection was killed and thinks it is a broken network connection. You can kill queries via MaxScale with the MaxScale session ID to have it behave as intended. You can map the backend ID to the MaxScale ID with maxctrl show sessions. |
| Comment by Jeff Smelser [ 2021-09-06 ] |
|
Yeah, I try to kill from a maxscale session and it just swallows the command. IS there some documentation on how to kill sessions? This seems like something that should be well documented. Thanks for responding! |
| Comment by Jeff Smelser [ 2021-09-06 ] |
|
BTW, the reason I created this is I have searched high and low on how to kill queries and I have only found someone saying to you need to kill them on the backend server. I have not found any real documentation on killing queries anywhere.. |
| Comment by markus makela [ 2021-09-07 ] |
|
Just to be clear, you did a KILL <id> via MaxScale with <id> being the session ID listed in maxctrl list sessions? The documentation is clearly too vague on how to actually kill queries via MaxScale. This is definitely something that can be improved. |
| Comment by markus makela [ 2021-09-07 ] |
|
Based on my testing, detecting killed connections doesn't seem like something that's possible to detect. I tested this with MariaDB 10.5.12 with two direct connections to a database and used one to KILL the other connection. The server simply closed the socket and sent no error message before doing so. I'll continue investigating if there is some way to detect killed connections. An alternative is to use KILL QUERY to kill only the query instead of killing the whole connection. This should be gracefully handled by MaxScale and it won't attempt it again. |
| Comment by Jeff Smelser [ 2021-09-07 ] |
|
OMG, in all my years I did not even realize `kill query <id>;` was a thing. I just tested that and it worked. Not sure how I missed that. Thanks! Also, thanks for looking into regular kills. |
| Comment by markus makela [ 2021-09-09 ] |
|
Added the KILL behavior to the limitations document. |
| Comment by Jeff Smelser [ 2021-09-10 ] |
|
Thanks a lot, this helps a lot! |