diff options
Diffstat (limited to 'storage/innobase/include/trx0trx.h')
-rw-r--r-- | storage/innobase/include/trx0trx.h | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index d6a8b8c771b..8bf64c28441 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -27,15 +27,8 @@ Created 3/26/1996 Heikki Tuuri #ifndef trx0trx_h #define trx0trx_h -#include <set> - -#include "ha_prototypes.h" - -#include "dict0types.h" #include "trx0types.h" - #include "lock0types.h" -#include "log0log.h" #include "que0types.h" #include "mem0mem.h" #include "trx0xa.h" @@ -43,6 +36,9 @@ Created 3/26/1996 Heikki Tuuri #include "fts0fts.h" #include "read0types.h" +#include <vector> +#include <set> + // Forward declaration struct mtr_t; @@ -482,6 +478,7 @@ Check transaction state */ ut_ad(!(t)->read_view.is_open()); \ ut_ad((t)->lock.wait_thr == NULL); \ ut_ad(UT_LIST_GET_LEN((t)->lock.trx_locks) == 0); \ + ut_ad(UT_LIST_GET_LEN((t)->lock.evicted_tables) == 0); \ ut_ad((t)->dict_operation == TRX_DICT_OP_NONE); \ } while(0) @@ -580,6 +577,11 @@ struct trx_lock_t { lock_sys.mutex. Otherwise, this may only be modified by the thread that is serving the running transaction. */ +#ifdef WITH_WSREP + bool was_chosen_as_wsrep_victim; + /*!< high priority wsrep thread has + marked this trx to abort */ +#endif /* WITH_WSREP */ /** Pre-allocated record locks */ struct { @@ -606,6 +608,9 @@ struct trx_lock_t { lock_list table_locks; /*!< All table locks requested by this transaction, including AUTOINC locks */ + /** List of pending trx_t::evict_table() */ + UT_LIST_BASE_NODE_T(dict_table_t) evicted_tables; + bool cancel; /*!< true if the transaction is being rolled back either via deadlock detection or due to lock timeout. The @@ -773,7 +778,7 @@ private: that it is no longer "active". */ - int32_t n_ref; + Atomic_counter<int32_t> n_ref; public: @@ -1112,19 +1117,23 @@ public: return(assign_temp_rseg()); } + /** Evict a table definition due to the rollback of ALTER TABLE. + @param[in] table_id table identifier */ + void evict_table(table_id_t table_id); + bool is_referenced() { - return my_atomic_load32_explicit(&n_ref, MY_MEMORY_ORDER_RELAXED) > 0; + return n_ref > 0; } void reference() { #ifdef UNIV_DEBUG - int32_t old_n_ref= + auto old_n_ref= #endif - my_atomic_add32_explicit(&n_ref, 1, MY_MEMORY_ORDER_RELAXED); + n_ref++; ut_ad(old_n_ref >= 0); } @@ -1132,9 +1141,9 @@ public: void release_reference() { #ifdef UNIV_DEBUG - int32_t old_n_ref= + auto old_n_ref= #endif - my_atomic_add32_explicit(&n_ref, -1, MY_MEMORY_ORDER_RELAXED); + n_ref--; ut_ad(old_n_ref > 0); } |