diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-04 18:57:55 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-04 18:57:55 +0300 |
commit | d467bb7e5e7902cf763c86cae71fde4f08e2ae3e (patch) | |
tree | 494dd192424f1fe4e6990f6cc717b7fb965f78c8 /storage | |
parent | 5a270e6acc915fa2741b99e7924fa078a971d083 (diff) | |
download | mariadb-git-d467bb7e5e7902cf763c86cae71fde4f08e2ae3e.tar.gz |
MDEV-7962 post-push fixes
This is a partial backport of
commit 5e7e7153b439ea1b12588f5830d66b3a0cf13414 from 10.4.
assert_trx_is_free(): Assert !is_wsrep().
trx_init(): Do not initialize trx->wsrep, because it must have been
initialized already.
trx_commit_in_memory(): Invoke wsrep_commit_ordered(). This call
was being skipped, because the transaction object had already been
freed to the pool.
trx_rollback_for_mysql(), innobase_commit_low(),
innobase_rollback_trx(): Always reset trx->wsrep.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 25 | ||||
-rw-r--r-- | storage/innobase/include/trx0trx.h | 1 | ||||
-rw-r--r-- | storage/innobase/trx/trx0roll.cc | 3 | ||||
-rw-r--r-- | storage/innobase/trx/trx0trx.cc | 6 |
4 files changed, 25 insertions, 10 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 619b8825527..98ce0d59923 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -4467,27 +4467,35 @@ innobase_commit_low( { #ifdef WITH_WSREP const char* tmp = 0; - if (trx->is_wsrep()) { + const bool is_wsrep = trx->is_wsrep(); + THD* thd = trx->mysql_thd; + if (is_wsrep) { #ifdef WSREP_PROC_INFO char info[64]; info[sizeof(info) - 1] = '\0'; snprintf(info, sizeof(info) - 1, "innobase_commit_low():trx_commit_for_mysql(%lld)", - (long long) wsrep_thd_trx_seqno(trx->mysql_thd)); - tmp = thd_proc_info(trx->mysql_thd, info); + (long long) wsrep_thd_trx_seqno(thd)); + tmp = thd_proc_info(thd, info); #else - tmp = thd_proc_info(trx->mysql_thd, "innobase_commit_low()"); + tmp = thd_proc_info(thd, "innobase_commit_low()"); #endif /* WSREP_PROC_INFO */ } #endif /* WITH_WSREP */ if (trx_is_started(trx)) { - trx_commit_for_mysql(trx); + } else { + trx->will_lock = 0; +#ifdef WITH_WSREP + trx->wsrep = false; +#endif /* WITH_WSREP */ } - trx->will_lock = 0; + #ifdef WITH_WSREP - if (trx->is_wsrep()) { thd_proc_info(trx->mysql_thd, tmp); } + if (is_wsrep) { + thd_proc_info(thd, tmp); #endif /* WITH_WSREP */ + } } /*****************************************************************//** @@ -4836,6 +4844,9 @@ innobase_rollback_trx( if (!trx->has_logged()) { trx->will_lock = 0; +#ifdef WITH_WSREP + trx->wsrep = false; +#endif DBUG_RETURN(0); } diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index 60e6fc58089..57ecf7717d1 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -553,6 +553,7 @@ Check transaction state */ ut_ad(!(t)->id); \ ut_ad(!(t)->has_logged()); \ ut_ad(!(t)->is_referenced()); \ + ut_ad(!(t)->is_wsrep()); \ ut_ad(!MVCC::is_view_active((t)->read_view)); \ ut_ad((t)->lock.wait_thr == NULL); \ ut_ad(UT_LIST_GET_LEN((t)->lock.trx_locks) == 0); \ diff --git a/storage/innobase/trx/trx0roll.cc b/storage/innobase/trx/trx0roll.cc index 20494133e8b..0e03346bb9d 100644 --- a/storage/innobase/trx/trx0roll.cc +++ b/storage/innobase/trx/trx0roll.cc @@ -189,6 +189,9 @@ dberr_t trx_rollback_for_mysql(trx_t* trx) case TRX_STATE_NOT_STARTED: trx->will_lock = 0; ut_ad(trx->in_mysql_trx_list); +#ifdef WITH_WSREP + trx->wsrep = false; +#endif return(DB_SUCCESS); case TRX_STATE_ACTIVE: diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 80de62b8b28..85667e91d13 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -102,9 +102,6 @@ trx_init( trx->state = TRX_STATE_NOT_STARTED; trx->is_recovered = false; -#ifdef WITH_WSREP - trx->wsrep = false; -#endif /* WITH_WSREP */ trx->op_info = ""; @@ -1821,6 +1818,9 @@ trx_commit_in_memory( DBUG_LOG("trx", "Commit in memory: " << trx); trx->state = TRX_STATE_NOT_STARTED; +#ifdef WITH_WSREP + trx->wsrep = false; +#endif /* trx->in_mysql_trx_list would hold between trx_allocate_for_mysql() and trx_free_for_mysql(). It does not |