[MDEV-12009] Allow to force kill user threads/query which are flagged as high priority by Galera Created: 2017-02-07 Updated: 2020-12-30 Resolved: 2020-12-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Galera |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Claudio Nanni | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | galera | ||
| Issue Links: |
|
||||||||
| Description |
|
See also: https://github.com/codership/galera/issues/448 In some cases Galera can mark a user thread as high priority(TOI DDLs) making it unkillable (with misleading message at |
| Comments |
| Comment by Jan Lindström (Inactive) [ 2018-07-19 ] | ||||||||||
|
This is a feature request. bar How hard it would be to add this new FORCE keyword for kill and does it require change on storage engine API or can it be added to current structures as a additional info ? | ||||||||||
| Comment by Alexander Barkov [ 2018-07-19 ] | ||||||||||
|
jplindst From a glance it looks like something not hard to do. If I understand the code correctly, the change should be done in kill_one_thread() in this code:
Most likely it is wsrep_thd_is_BF() who decides if the thread is kill-able. I suggest you discuss with psergey and serg. When adding a new FORCE flag, please consider introducing a new class Sql_cmd_kill instead of adding this flag directly to LEX, as well ass moving LEX::kill_type and LEX::kill_signal into this new class Sql_cmd_kill. I can help with this refactoring. | ||||||||||
| Comment by Sergei Golubchik [ 2018-07-19 ] | ||||||||||
|
Why is this check wsrep_thd_is_BF there in the first place? It directly contradicts the comment above it, that says
| ||||||||||
| Comment by Alexander Barkov [ 2018-07-25 ] | ||||||||||
|
ralf.gebhardt@mariadb.com, it's probably a bug. See Sergei's comment. Perhaps a super user should be able to kill such threads even without this new FORCE flag. In such case it's just 5 minutes. | ||||||||||
| Comment by Jan Lindström (Inactive) [ 2018-09-13 ] | ||||||||||
|
serg Does thd->security_ctx->user_matches(tmp->security_ctx)) match with current user or superuser ? | ||||||||||
| Comment by Sergei Golubchik [ 2018-09-19 ] | ||||||||||
|
thd->security_ctx->user_matches(tmp->security_ctx)) means that thd->security_ctx has the same user as tmp->security_ctx. | ||||||||||
| Comment by Jan Lindström (Inactive) [ 2019-02-04 ] | ||||||||||
|
I will allow SUPER to kill both high priority transactions as well as wsrep applier threads as it should be. | ||||||||||
| Comment by Marko Mäkelä [ 2019-03-28 ] | ||||||||||
|
I reverted this change, because I think that it depends on a correct fix of | ||||||||||
| Comment by Jan Lindström (Inactive) [ 2020-12-30 ] | ||||||||||
|
Killing wsrep high priority threads is dangerous and could lead to cluster inconsistent state. Thus it should not be allowed. |