mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
MDEV-12008 fixup: Do not add a new error code
New error codes can only be added in the latest major version.
Adding ER_KILL_DENIED_HIGH_PRIORITY would shift by one all
error codes that were added in MariaDB Server 10.6 or later.
This amends commit 1001dae186
Suggested by: Sergei Golubchik
This commit is contained in:
@@ -6,13 +6,13 @@ SELECT @@wsrep_slave_threads;
|
|||||||
1
|
1
|
||||||
SET GLOBAL wsrep_slave_threads=2;
|
SET GLOBAL wsrep_slave_threads=2;
|
||||||
KILL ID;
|
KILL ID;
|
||||||
ERROR HY000: This is a high-priority thread/query and cannot be killed without compromising the consistency of the cluster
|
ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster
|
||||||
KILL QUERY ID;
|
KILL QUERY ID;
|
||||||
ERROR HY000: This is a high-priority thread/query and cannot be killed without compromising the consistency of the cluster
|
ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster
|
||||||
KILL ID;
|
KILL ID;
|
||||||
ERROR HY000: This is a high-priority thread/query and cannot be killed without compromising the consistency of the cluster
|
ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster
|
||||||
KILL QUERY ID;
|
KILL QUERY ID;
|
||||||
ERROR HY000: This is a high-priority thread/query and cannot be killed without compromising the consistency of the cluster
|
ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster
|
||||||
SET GLOBAL wsrep_slave_threads=DEFAULT;
|
SET GLOBAL wsrep_slave_threads=DEFAULT;
|
||||||
connection node_1;
|
connection node_1;
|
||||||
create table t1(a int not null primary key) engine=innodb;
|
create table t1(a int not null primary key) engine=innodb;
|
||||||
|
@@ -10,9 +10,9 @@ connection node_1;
|
|||||||
SET SESSION wsrep_sync_wait = 0;
|
SET SESSION wsrep_sync_wait = 0;
|
||||||
SET DEBUG_SYNC = 'now WAIT_FOR bf_started';
|
SET DEBUG_SYNC = 'now WAIT_FOR bf_started';
|
||||||
KILL ID;
|
KILL ID;
|
||||||
ERROR HY000: This is a high-priority thread/query and cannot be killed without compromising the consistency of the cluster
|
ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster
|
||||||
KILL QUERY ID;
|
KILL QUERY ID;
|
||||||
ERROR HY000: This is a high-priority thread/query and cannot be killed without compromising the consistency of the cluster
|
ERROR HY000: This is a high priority thread/query and cannot be killed without compromising the consistency of the cluster
|
||||||
connection node_1;
|
connection node_1;
|
||||||
SET DEBUG_SYNC = 'now SIGNAL bf_continue';
|
SET DEBUG_SYNC = 'now SIGNAL bf_continue';
|
||||||
connection con1;
|
connection con1;
|
||||||
|
@@ -17,21 +17,21 @@ SET GLOBAL wsrep_slave_threads=2;
|
|||||||
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle' LIMIT 1`
|
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep applier idle' LIMIT 1`
|
||||||
|
|
||||||
--replace_result $applier_thread ID
|
--replace_result $applier_thread ID
|
||||||
--error ER_KILL_DENIED_HIGH_PRIORITY
|
--error ER_KILL_DENIED_ERROR
|
||||||
--eval KILL $applier_thread
|
--eval KILL $applier_thread
|
||||||
|
|
||||||
--replace_result $applier_thread ID
|
--replace_result $applier_thread ID
|
||||||
--error ER_KILL_DENIED_HIGH_PRIORITY
|
--error ER_KILL_DENIED_ERROR
|
||||||
--eval KILL QUERY $applier_thread
|
--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`
|
--let $aborter_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE = 'wsrep aborter idle' LIMIT 1`
|
||||||
|
|
||||||
--replace_result $aborter_thread ID
|
--replace_result $aborter_thread ID
|
||||||
--error ER_KILL_DENIED_HIGH_PRIORITY
|
--error ER_KILL_DENIED_ERROR
|
||||||
--eval KILL $aborter_thread
|
--eval KILL $aborter_thread
|
||||||
|
|
||||||
--replace_result $aborter_thread ID
|
--replace_result $aborter_thread ID
|
||||||
--error ER_KILL_DENIED_HIGH_PRIORITY
|
--error ER_KILL_DENIED_ERROR
|
||||||
--eval KILL QUERY $aborter_thread
|
--eval KILL QUERY $aborter_thread
|
||||||
|
|
||||||
SET GLOBAL wsrep_slave_threads=DEFAULT;
|
SET GLOBAL wsrep_slave_threads=DEFAULT;
|
||||||
|
@@ -21,11 +21,11 @@ SET DEBUG_SYNC = 'now WAIT_FOR bf_started';
|
|||||||
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'debug sync point:%' LIMIT 1`
|
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE 'debug sync point:%' LIMIT 1`
|
||||||
|
|
||||||
--replace_result $applier_thread ID
|
--replace_result $applier_thread ID
|
||||||
--error ER_KILL_DENIED_HIGH_PRIORITY
|
--error ER_KILL_DENIED_ERROR
|
||||||
--eval KILL $applier_thread
|
--eval KILL $applier_thread
|
||||||
|
|
||||||
--replace_result $applier_thread ID
|
--replace_result $applier_thread ID
|
||||||
--error ER_KILL_DENIED_HIGH_PRIORITY
|
--error ER_KILL_DENIED_ERROR
|
||||||
--eval KILL QUERY $applier_thread
|
--eval KILL QUERY $applier_thread
|
||||||
|
|
||||||
--connection node_1
|
--connection node_1
|
||||||
|
@@ -9111,5 +9111,3 @@ ER_NOT_ALLOWED_IN_THIS_CONTEXT
|
|||||||
eng "'%-.128s' is not allowed in this context"
|
eng "'%-.128s' is not allowed in this context"
|
||||||
ER_DATA_WAS_COMMITED_UNDER_ROLLBACK
|
ER_DATA_WAS_COMMITED_UNDER_ROLLBACK
|
||||||
eng "Engine %s does not support rollback. Changes were committed during rollback call"
|
eng "Engine %s does not support rollback. Changes were committed during rollback call"
|
||||||
ER_KILL_DENIED_HIGH_PRIORITY
|
|
||||||
eng "This is a high-priority thread/query and cannot be killed without compromising the consistency of the cluster"
|
|
||||||
|
@@ -9379,8 +9379,12 @@ THD *find_thread_by_id(longlong id, bool query_id)
|
|||||||
@param type Type of id: thread id or query id
|
@param type Type of id: thread id or query id
|
||||||
*/
|
*/
|
||||||
|
|
||||||
uint
|
static uint
|
||||||
kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type type)
|
kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type type
|
||||||
|
#ifdef WITH_WSREP
|
||||||
|
, bool &wsrep_high_priority
|
||||||
|
#endif
|
||||||
|
)
|
||||||
{
|
{
|
||||||
THD *tmp;
|
THD *tmp;
|
||||||
uint error= (type == KILL_TYPE_QUERY ? ER_NO_SUCH_QUERY : ER_NO_SUCH_THREAD);
|
uint error= (type == KILL_TYPE_QUERY ? ER_NO_SUCH_QUERY : ER_NO_SUCH_THREAD);
|
||||||
@@ -9421,9 +9425,10 @@ kill_one_thread(THD *thd, my_thread_id id, killed_state kill_signal, killed_type
|
|||||||
#ifdef WITH_WSREP
|
#ifdef WITH_WSREP
|
||||||
if (wsrep_thd_is_BF(tmp, false) || tmp->wsrep_applier)
|
if (wsrep_thd_is_BF(tmp, false) || tmp->wsrep_applier)
|
||||||
{
|
{
|
||||||
error= ER_KILL_DENIED_HIGH_PRIORITY;
|
error= ER_KILL_DENIED_ERROR;
|
||||||
|
wsrep_high_priority= true;
|
||||||
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
|
push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
|
||||||
ER_KILL_DENIED_HIGH_PRIORITY,
|
ER_KILL_DENIED_ERROR,
|
||||||
"Thread %lld is %s and cannot be killed",
|
"Thread %lld is %s and cannot be killed",
|
||||||
tmp->thread_id,
|
tmp->thread_id,
|
||||||
(tmp->wsrep_applier ? "wsrep applier" : "high priority"));
|
(tmp->wsrep_applier ? "wsrep applier" : "high priority"));
|
||||||
@@ -9562,14 +9567,28 @@ static uint kill_threads_for_user(THD *thd, LEX_USER *user,
|
|||||||
static
|
static
|
||||||
void sql_kill(THD *thd, my_thread_id id, killed_state state, killed_type type)
|
void sql_kill(THD *thd, my_thread_id id, killed_state state, killed_type type)
|
||||||
{
|
{
|
||||||
uint error;
|
#ifdef WITH_WSREP
|
||||||
if (likely(!(error= kill_one_thread(thd, id, state, type))))
|
bool wsrep_high_priority= false;
|
||||||
|
#endif
|
||||||
|
uint error= kill_one_thread(thd, id, state, type
|
||||||
|
#ifdef WITH_WSREP
|
||||||
|
, wsrep_high_priority
|
||||||
|
#endif
|
||||||
|
);
|
||||||
|
|
||||||
|
if (likely(!error))
|
||||||
{
|
{
|
||||||
if (!thd->killed)
|
if (!thd->killed)
|
||||||
my_ok(thd);
|
my_ok(thd);
|
||||||
else
|
else
|
||||||
thd->send_kill_message();
|
thd->send_kill_message();
|
||||||
}
|
}
|
||||||
|
#ifdef WITH_WSREP
|
||||||
|
else if (wsrep_high_priority)
|
||||||
|
my_printf_error(error, "This is a high priority thread/query and"
|
||||||
|
" cannot be killed without compromising"
|
||||||
|
" the consistency of the cluster", MYF(0));
|
||||||
|
#endif
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
my_error(error, MYF(0), id);
|
my_error(error, MYF(0), id);
|
||||||
|
Reference in New Issue
Block a user