mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-12009: Allow to force kill user threads/query which are flagged as high priority by Galera
As noted on kill_one_thread SUPER should be able to kill even system threads i.e. threads/query flagged as high priority or wsrep applier thread. Normal user, should not able to kill threads/query flagged as high priority (BF) or wsrep applier thread.
This commit is contained in:
@ -8292,11 +8292,19 @@ kill_one_thread(THD *thd, longlong id, killed_state kill_signal, killed_type typ
|
||||
It's ok to also kill DELAYED threads with KILL_CONNECTION instead of
|
||||
KILL_SYSTEM_THREAD; The difference is that KILL_CONNECTION may be
|
||||
faster and do a harder kill than KILL_SYSTEM_THREAD;
|
||||
|
||||
Note that if thread is wsrep Brute Force or applier thread we
|
||||
allow killing it only when we're SUPER.
|
||||
*/
|
||||
|
||||
if (((thd->security_ctx->master_access & SUPER_ACL) ||
|
||||
thd->security_ctx->user_matches(tmp->security_ctx)) &&
|
||||
!wsrep_thd_is_BF(tmp, false))
|
||||
if ((thd->security_ctx->master_access & SUPER_ACL) ||
|
||||
(thd->security_ctx->user_matches(tmp->security_ctx)
|
||||
#ifdef WITH_WSREP
|
||||
&&
|
||||
!tmp->wsrep_applier &&
|
||||
!wsrep_thd_is_BF(tmp, false)
|
||||
#endif
|
||||
))
|
||||
{
|
||||
tmp->awake(kill_signal);
|
||||
error=0;
|
||||
|
Reference in New Issue
Block a user