Commit d467bb7e authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-7962 post-push fixes

This is a partial backport of
commit 5e7e7153 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.
parent 5a270e6a
......@@ -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);
}
......
......@@ -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); \
......
......@@ -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:
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment