-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Jan Lindström
committed
Mar 28, 2019
1 parent
21b2fad
commit 81d71ee
Showing
10 changed files
with
95 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
CREATE USER foo@localhost; | ||
GRANT SELECT on test.* TO foo@localhost; | ||
# Open connection to the 1st node using 'test_user1' user. | ||
Got one of the listed errors | ||
Got one of the listed errors | ||
Got one of the listed errors | ||
Got one of the listed errors | ||
DROP USER foo@localhost; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
!include ../galera_2nodes.cnf | ||
|
||
[mysqld.1] | ||
wsrep_provider_options='base_port=@mysqld.1.#galera_port;pc.ignore_sb=true' | ||
auto_increment_offset=1 | ||
|
||
[mysqld.2] | ||
wsrep_provider_options='base_port=@mysqld.2.#galera_port;pc.ignore_sb=true' | ||
auto_increment_offset=2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,74 @@ | ||
# | ||
# This test checks that applier threads are immune to KILL QUERY and KILL STATEMENT | ||
# when USER is not SUPER | ||
# | ||
|
||
--source include/galera_cluster.inc | ||
--source include/have_innodb.inc | ||
|
||
--connection node_1 | ||
|
||
CREATE USER foo@localhost; | ||
GRANT SELECT on test.* TO foo@localhost; | ||
|
||
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1` | ||
|
||
--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` | ||
|
||
--echo # Open connection to the 1st node using 'test_user1' user. | ||
--let $port_1= \$NODE_MYPORT_1 | ||
--connect(foo_node_1,localhost,foo,,test,$port_1,) | ||
|
||
--connection foo_node_1 | ||
|
||
--disable_query_log | ||
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR | ||
--eval KILL $applier_thread | ||
|
||
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR | ||
--eval KILL QUERY $applier_thread | ||
|
||
--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` | ||
|
||
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR | ||
--eval KILL $aborter_thread | ||
|
||
--error ER_KILL_DENIED_ERROR,ER_KILL_DENIED_ERROR | ||
--eval KILL QUERY $aborter_thread | ||
--enable_query_log | ||
|
||
# | ||
# SUPER can kill applier threads | ||
# | ||
--connection node_2 | ||
|
||
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1` | ||
|
||
--disable_query_log | ||
--eval KILL $applier_thread | ||
--enable_query_log | ||
|
||
--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` | ||
|
||
--disable_query_log | ||
--eval KILL $aborter_thread | ||
--enable_query_log | ||
|
||
--source include/restart_mysqld.inc | ||
|
||
--connection node_2 | ||
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE != 'wsrep aborter idle' OR STATE IS NULL LIMIT 1` | ||
|
||
--disable_query_log | ||
--eval KILL QUERY $applier_thread | ||
--enable_query_log | ||
|
||
--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1` | ||
|
||
--disable_query_log | ||
--eval KILL QUERY $aborter_thread | ||
--enable_query_log | ||
|
||
--source include/restart_mysqld.inc | ||
|
||
--connection node_1 | ||
--disconnect foo_node_1 | ||
DROP USER foo@localhost; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters