mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
MDEV-24853: Duplicate key generated during cluster configuration change
Incorrect processing of an auto-incrementing field in the WSREP-related code during applying transactions results in a duplicate key being created. This is due to the fact that at the beginning of the write_row() and update_row() functions, the values of the auto-increment parameters are used, which are read from the parameters of the current thread, but further along the code other values are used, which are read from global variables (when applying a transaction). This can happen when the cluster configuration has changed while applying a transaction (for example in the high_priority_service mode for Galera 4). Further during IST processing duplicating key is detected, and processing of the DB_DUPLICATE_KEY return code (inside innodb, in the write_row() handler) results in a call to the wsrep_thd_self_abort() function.
This commit is contained in:
parent
545cba13eb
commit
7345d37141
6 changed files with 178 additions and 165 deletions
|
|
@ -851,27 +851,6 @@ bool wsrep_thd_has_explicit_locks(THD *thd)
|
|||
return thd->mdl_context.has_explicit_locks();
|
||||
}
|
||||
|
||||
/*
|
||||
Get auto increment variables for THD. Use global settings for
|
||||
applier threads.
|
||||
*/
|
||||
void wsrep_thd_auto_increment_variables(THD* thd,
|
||||
unsigned long long* offset,
|
||||
unsigned long long* increment)
|
||||
{
|
||||
if (thd->wsrep_exec_mode == REPL_RECV &&
|
||||
thd->wsrep_conflict_state != REPLAYING)
|
||||
{
|
||||
*offset= global_system_variables.auto_increment_offset;
|
||||
*increment= global_system_variables.auto_increment_increment;
|
||||
}
|
||||
else
|
||||
{
|
||||
*offset= thd->variables.auto_increment_offset;
|
||||
*increment= thd->variables.auto_increment_increment;
|
||||
}
|
||||
}
|
||||
|
||||
my_bool wsrep_thd_is_applier(MYSQL_THD thd)
|
||||
{
|
||||
my_bool is_applier= false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue