Commit d8c0caad authored by Sergey Vojtovich's avatar Sergey Vojtovich

MDEV-14756 - Remove trx_sys_t::rw_trx_list

Removed trx_sys_validate_trx_list(): with rw_trx_hash elements are not
required to be ordered by transaction id. Transaction state is now guarded
by asserts in rw_trx_hash_t.
parent 900b0790
......@@ -242,15 +242,6 @@ ulint
trx_sys_any_active_transactions(void);
/*=================================*/
#ifdef UNIV_DEBUG
/*************************************************************//**
Validate the trx_sys_t::rw_trx_list.
@return true if the list is valid */
bool
trx_sys_validate_trx_list();
/*========================*/
#endif /* UNIV_DEBUG */
/** The automatically created system rollback segment has this id */
#define TRX_SYS_SYSTEM_RSEG_ID 0
......
......@@ -664,46 +664,3 @@ trx_sys_any_active_transactions(void)
return(total_trx);
}
#ifdef UNIV_DEBUG
/*************************************************************//**
Validate the trx_ut_list_t.
@return true if valid. */
static
bool
trx_sys_validate_trx_list_low(
/*===========================*/
trx_ut_list_t* trx_list) /*!< in: &trx_sys->rw_trx_list */
{
const trx_t* trx;
const trx_t* prev_trx = NULL;
ut_ad(trx_sys_mutex_own());
ut_ad(trx_list == &trx_sys->rw_trx_list);
for (trx = UT_LIST_GET_FIRST(*trx_list);
trx != NULL;
prev_trx = trx, trx = UT_LIST_GET_NEXT(trx_list, prev_trx)) {
check_trx_state(trx);
ut_a(prev_trx == NULL || prev_trx->id > trx->id);
}
return(true);
}
/*************************************************************//**
Validate the trx_sys_t::rw_trx_list.
@return true if the list is valid. */
bool
trx_sys_validate_trx_list()
/*=======================*/
{
ut_ad(trx_sys_mutex_own());
ut_a(trx_sys_validate_trx_list_low(&trx_sys->rw_trx_list));
return(true);
}
#endif /* UNIV_DEBUG */
......@@ -690,8 +690,6 @@ trx_disconnect_from_mysql(
trx_sys->mvcc->view_close(trx->read_view, true);
}
ut_ad(trx_sys_validate_trx_list());
if (prepared) {
ut_ad(trx_state_eq(trx, TRX_STATE_PREPARED));
......@@ -1249,8 +1247,6 @@ trx_start_low(
}
#endif /* UNIV_DEBUG */
ut_ad(trx_sys_validate_trx_list());
trx_sys_mutex_exit();
trx_sys->rw_trx_hash.insert(trx);
......@@ -1617,7 +1613,6 @@ trx_erase_lists(
trx_sys_mutex_enter();
UT_LIST_REMOVE(trx_sys->rw_trx_list, trx);
ut_d(trx->in_rw_trx_list = false);
ut_ad(trx_sys_validate_trx_list());
if (trx->read_view != NULL) {
trx_sys->mvcc->view_close(trx->read_view, true);
......
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