summaryrefslogtreecommitdiff
path: root/sql/wsrep_thd.cc
diff options
context:
space:
mode:
authorJulius Goryavsky <julius.goryavsky@mariadb.com>2021-02-12 15:58:26 +0100
committerJulius Goryavsky <julius.goryavsky@mariadb.com>2021-02-12 15:58:26 +0100
commit1d27cb7393baf86c99bc0b7a37a80390a7d1c489 (patch)
treea76756082d391ce3b1338918d18e0bc75dbcdadf /sql/wsrep_thd.cc
parentda3211e48743d143224ddc2334ac8a01942ecae7 (diff)
downloadmariadb-git-10.2-MDEV-24853.tar.gz
MDEV-24853: Duplicate key generated during cluster configuration change10.2-MDEV-24853
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.
Diffstat (limited to 'sql/wsrep_thd.cc')
-rw-r--r--sql/wsrep_thd.cc21
1 files changed, 0 insertions, 21 deletions
diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc
index d8ca70d1cbe..ef8c0e132f7 100644
--- a/sql/wsrep_thd.cc
+++ b/sql/wsrep_thd.cc
@@ -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;