summaryrefslogtreecommitdiff
path: root/storage/innobase/include/trx0trx.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-03-28 12:27:06 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-03-28 12:39:50 +0200
commitd0116e10a5da52503a89a413e481996ce3f65e63 (patch)
treee67bbdfa81ee11b205610c3b038e864f3206a0a6 /storage/innobase/include/trx0trx.h
parent81d71ee6b21870772c336bff15b71904914f146a (diff)
downloadmariadb-git-d0116e10a5da52503a89a413e481996ce3f65e63.tar.gz
Revert MDEV-18464 and MDEV-12009
This reverts commit 21b2fada7ab7f35c898c02d2f918461409cc9c8e and commit 81d71ee6b21870772c336bff15b71904914f146a. The MDEV-18464 change introduces a few data race issues. Contrary to the documentation, the field trx_t::victim is not always being protected by lock_sys_t::mutex and trx_t::mutex. Most importantly, it seems that KILL QUERY could wrongly avoid acquiring both mutexes when invoking lock_trx_handle_wait_low(), in case another thread had already set trx->victim=true. We also revert MDEV-12009, because it should depend on the MDEV-18464 fix being present.
Diffstat (limited to 'storage/innobase/include/trx0trx.h')
-rw-r--r--storage/innobase/include/trx0trx.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h
index b40c6ae4667..fe16b8272b8 100644
--- a/storage/innobase/include/trx0trx.h
+++ b/storage/innobase/include/trx0trx.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2015, 2019, MariaDB Corporation.
+Copyright (c) 2015, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -623,6 +623,7 @@ struct trx_lock_t {
lock_sys->mutex. Otherwise, this may
only be modified by the thread that is
serving the running transaction. */
+
mem_heap_t* lock_heap; /*!< memory heap for trx_locks;
protected by lock_sys->mutex */
@@ -694,6 +695,14 @@ lock_rec_convert_impl_to_expl()) will access transactions associated
to other connections. The locks of transactions are protected by
lock_sys->mutex and sometimes by trx->mutex. */
+enum trx_abort_t {
+ TRX_SERVER_ABORT = 0,
+#ifdef WITH_WSREP
+ TRX_WSREP_ABORT,
+#endif
+ TRX_REPLICATION_ABORT
+};
+
struct trx_t{
ulint magic_n;
@@ -871,12 +880,8 @@ struct trx_t{
/*------------------------------*/
THD* mysql_thd; /*!< MySQL thread handle corresponding
to this trx, or NULL */
- bool victim; /*!< This transaction is
- selected as victim for abort
- either by replication or
- high priority wsrep thread. This
- field is protected by trx and
- lock sys mutex. */
+ trx_abort_t abort_type; /*!< Transaction abort type*/
+
const char* mysql_log_file_name;
/*!< if MySQL binlog is used, this field
contains a pointer to the latest file