summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2020-12-17 14:20:23 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2020-12-29 14:29:31 +0200
commit5b25f651a961e06d377f2f8ff78ac38dc40f3fb3 (patch)
tree308717d150bc68c364404917228b2eda388dbe1a /sql/sql_class.h
parent9118fd360a3da0bba521caf2a35c424968235ac4 (diff)
downloadmariadb-git-5b25f651a961e06d377f2f8ff78ac38dc40f3fb3.tar.gz
MDEV-23536 : Race condition between KILL and transaction commitbb-10.6-MDEV-23536
A race condition may occur between the execution of transaction commit, and an execution of a KILL statement that would attempt to abort that transaction. MDEV-17092 worked around this race condition by modifying InnoDB code. After that issue was closed, Sergey Vojtovich pointed out that this race condition would better be fixed above the storage engine layer: If you look carefully into the above, you can conclude that thd->free_connection() can be called concurrently with KILL/thd->awake(). Which is the bug. And it is partially fixed in THD::~THD(), that is destructor waits for KILL completion: Fix: Add necessary mutex operations to THD::free_connection() and move WSREP specific code also there. This ensures that no one is using THD while we do free_connection(). These mutexes will also ensures that there can't be concurrent KILL/THD::awake(). innobase_kill_query We can now remove usage of trx_sys_mutex introduced on MDEV-17092. trx_t::free() Poison trx->state and trx->mysql_thd This patch is validated with an RQG run similar to the one that reproduced MDEV-17092.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 6bd08343c9e..3e8211389ce 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3462,7 +3462,7 @@ public:
void update_all_stats();
void update_stats(void);
void change_user(void);
- void cleanup(void);
+ void cleanup(bool have_mutex=false);
void cleanup_after_query();
void free_connection();
void reset_for_reuse();