summaryrefslogtreecommitdiff
path: root/innobase/trx
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-03-12 17:14:51 +0200
committerunknown <marko@hundin.mysql.fi>2004-03-12 17:14:51 +0200
commite1cb1ca6fe25380edae06ded5e22e106761dcb46 (patch)
tree6a59a674bf740a7b4046a20e847ad2578a573d69 /innobase/trx
parent9a817bea5a369306dbb2113fbc599e63d5bb7d17 (diff)
downloadmariadb-git-e1cb1ca6fe25380edae06ded5e22e106761dcb46.tar.gz
Allow UNIV_SYNC_DEBUG to be disabled while UNIV_DEBUG is enabled
Diffstat (limited to 'innobase/trx')
-rw-r--r--innobase/trx/trx0purge.c20
-rw-r--r--innobase/trx/trx0rec.c6
-rw-r--r--innobase/trx/trx0roll.c14
-rw-r--r--innobase/trx/trx0rseg.c8
-rw-r--r--innobase/trx/trx0sys.c16
-rw-r--r--innobase/trx/trx0trx.c34
-rw-r--r--innobase/trx/trx0undo.c40
7 files changed, 131 insertions, 7 deletions
diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c
index 222ca6debbd..c5984c5dea4 100644
--- a/innobase/trx/trx0purge.c
+++ b/innobase/trx/trx0purge.c
@@ -45,7 +45,9 @@ trx_purge_update_undo_must_exist(
the undo log still exists in the system */
dulint trx_id) /* in: transaction id */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
if (!read_view_sees_trx_id(purge_sys->view, trx_id)) {
@@ -195,7 +197,9 @@ void
trx_purge_sys_create(void)
/*======================*/
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
purge_sys = mem_alloc(sizeof(trx_purge_t));
@@ -258,7 +262,9 @@ trx_purge_add_update_undo_to_history(
ut_ad(undo);
rseg = undo->rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
@@ -334,7 +340,9 @@ trx_purge_free_segment(
/* printf("Freeing an update undo log segment\n"); */
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
loop:
mtr_start(&mtr);
mutex_enter(&(rseg->mutex));
@@ -430,7 +438,9 @@ trx_purge_truncate_rseg_history(
ulint n_removed_logs = 0;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
mtr_start(&mtr);
mutex_enter(&(rseg->mutex));
@@ -516,7 +526,9 @@ trx_purge_truncate_history(void)
dulint limit_trx_no;
dulint limit_undo_no;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
trx_purge_arr_get_biggest(purge_sys->arr, &limit_trx_no,
&limit_undo_no);
@@ -556,7 +568,9 @@ trx_purge_truncate_if_arr_empty(void)
/*=================================*/
/* out: TRUE if array empty */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (purge_sys->arr->n_used == 0) {
@@ -585,7 +599,9 @@ trx_purge_rseg_get_next_history_log(
ibool del_marks;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(rseg->mutex));
@@ -665,7 +681,9 @@ trx_purge_choose_next_log(void)
ulint offset = 0; /* remove warning (??? bug ???) */
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(purge_sys->next_stored == FALSE);
rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
@@ -766,7 +784,9 @@ trx_purge_get_next_rec(
ulint cmpl_info;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(purge_sys->next_stored);
space = purge_sys->rseg->space;
diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c
index c62f311d6a4..9d944e16a1e 100644
--- a/innobase/trx/trx0rec.c
+++ b/innobase/trx/trx0rec.c
@@ -1069,7 +1069,9 @@ trx_undo_report_row_operation(
IB__FILE__, __LINE__,
&mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(undo_page, SYNC_TRX_UNDO_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
if (op_type == TRX_UNDO_INSERT_OP) {
offset = trx_undo_page_report_insert(undo_page, trx,
@@ -1196,7 +1198,9 @@ trx_undo_get_undo_rec(
trx_undo_rec_t** undo_rec, /* out, own: copy of the record */
mem_heap_t* heap) /* in: memory heap where copied */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
if (!trx_purge_update_undo_must_exist(trx_id)) {
@@ -1256,7 +1260,9 @@ trx_undo_prev_version_build(
ulint i;
char err_buf[1000];
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(mtr_memo_contains(index_mtr, buf_block_align(index_rec),
MTR_MEMO_PAGE_S_FIX) ||
mtr_memo_contains(index_mtr, buf_block_align(index_rec),
diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c
index 206aeb1d2ce..c00c6f0c862 100644
--- a/innobase/trx/trx0roll.c
+++ b/innobase/trx/trx0roll.c
@@ -676,8 +676,10 @@ trx_roll_try_truncate(
dulint limit;
dulint biggest;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
ut_ad(mutex_own(&((trx->rseg)->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
trx->pages_undone = 0;
@@ -720,7 +722,9 @@ trx_roll_pop_top_rec(
trx_undo_rec_t* prev_rec;
page_t* prev_rec_page;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
undo_page = trx_undo_page_get_s_latched(undo->space,
undo->top_page_no, mtr);
@@ -944,7 +948,9 @@ trx_rollback(
que_thr_t* thr;
/* que_thr_t* thr2; */
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad((trx->undo_no_arr == NULL) || ((trx->undo_no_arr)->n_used == 0));
/* Initialize the rollback field in the transaction */
@@ -1013,7 +1019,9 @@ trx_roll_graph_build(
que_thr_t* thr;
/* que_thr_t* thr2; */
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
heap = mem_heap_create(512);
fork = que_fork_create(NULL, NULL, QUE_FORK_ROLLBACK, heap);
@@ -1040,7 +1048,9 @@ trx_finish_error_processing(
trx_sig_t* sig;
trx_sig_t* next_sig;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
sig = UT_LIST_GET_FIRST(trx->signals);
@@ -1073,7 +1083,9 @@ trx_finish_partial_rollback_off_kernel(
{
trx_sig_t* sig;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
sig = UT_LIST_GET_FIRST(trx->signals);
@@ -1104,7 +1116,9 @@ trx_finish_rollback_off_kernel(
trx_sig_t* sig;
trx_sig_t* next_sig;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(trx->undo_no_arr == NULL || trx->undo_no_arr->n_used == 0);
diff --git a/innobase/trx/trx0rseg.c b/innobase/trx/trx0rseg.c
index b1fb8a9539c..d50bc9d8ba4 100644
--- a/innobase/trx/trx0rseg.c
+++ b/innobase/trx/trx0rseg.c
@@ -60,7 +60,9 @@ trx_rseg_header_create(
page_t* page;
ut_ad(mtr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(mtr_memo_contains(mtr, fil_space_get_latch(space),
MTR_MEMO_X_LOCK));
sys_header = trx_sysf_get(mtr);
@@ -81,7 +83,9 @@ trx_rseg_header_create(
return(FIL_NULL);
}
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_RSEG_HEADER_NEW);
+#endif /* UNIV_SYNC_DEBUG */
page_no = buf_frame_get_page_no(page);
@@ -132,7 +136,9 @@ trx_rseg_mem_create(
fil_addr_t node_addr;
ulint sum_of_undo_sizes;
- ut_ad(mutex_own(&kernel_mutex));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
rseg = mem_alloc(sizeof(trx_rseg_t));
diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c
index 3b5f024d39e..f7b1f9bb085 100644
--- a/innobase/trx/trx0sys.c
+++ b/innobase/trx/trx0sys.c
@@ -56,7 +56,9 @@ trx_sys_mark_downgraded_from_4_1_1(void)
mtr_start(&mtr);
page = buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO, RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
doublewrite = page + TRX_SYS_DOUBLEWRITE;
@@ -169,7 +171,9 @@ start_again:
mtr_start(&mtr);
page = buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO, RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
doublewrite = page + TRX_SYS_DOUBLEWRITE;
@@ -228,7 +232,9 @@ start_again:
/* fseg_create acquires a second latch on the page,
therefore we must declare it: */
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page2, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
if (page2 == NULL) {
fprintf(stderr,
@@ -271,7 +277,9 @@ start_again:
new_page = buf_page_get(TRX_SYS_SPACE, page_no,
RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(new_page, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
/* Make a dummy change to the page to ensure it will
be written to disk in a flush */
@@ -490,7 +498,9 @@ trx_in_trx_list(
{
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
@@ -517,7 +527,9 @@ trx_sys_flush_max_trx_id(void)
trx_sysf_t* sys_header;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
mtr_start(&mtr);
@@ -716,7 +728,9 @@ trx_sysf_rseg_find_free(
ulint page_no;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
sys_header = trx_sysf_get(mtr);
@@ -762,7 +776,9 @@ trx_sysf_create(
mtr);
ut_a(buf_frame_get_page_no(page) == TRX_SYS_PAGE_NO);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TRX_SYS_HEADER);
+#endif /* UNIV_SYNC_DEBUG */
sys_header = trx_sysf_get(mtr);
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index 78a7e277657..793a3421742 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -73,7 +73,9 @@ trx_create(
{
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
trx = mem_alloc(sizeof(trx_t));
@@ -239,7 +241,9 @@ trx_free(
{
char err_buf[1000];
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (trx->declared_to_be_inside_innodb) {
ut_print_timestamp(stderr);
@@ -345,7 +349,9 @@ trx_list_insert_ordered(
{
trx_t* trx2;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
trx2 = UT_LIST_GET_FIRST(trx_sys->trx_list);
@@ -507,7 +513,9 @@ trx_assign_rseg(void)
{
trx_rseg_t* rseg = trx_sys->latest_rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
loop:
/* Get next rseg in a round-robin fashion */
@@ -544,7 +552,9 @@ trx_start_low(
{
trx_rseg_t* rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->rseg == NULL);
if (trx->type == TRX_PURGE) {
@@ -619,7 +629,9 @@ trx_commit_off_kernel(
ibool must_flush_log = FALSE;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
rseg = trx->rseg;
@@ -713,7 +725,9 @@ trx_commit_off_kernel(
}
ut_ad(trx->conc_state == TRX_ACTIVE);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
/* The following assignment makes the transaction committed in memory
and makes its changes to data visible to other transactions.
@@ -893,7 +907,9 @@ trx_handle_commit_sig_off_kernel(
trx_sig_t* sig;
trx_sig_t* next_sig;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
trx->que_state = TRX_QUE_COMMITTING;
@@ -933,7 +949,9 @@ trx_end_lock_wait(
{
que_thr_t* thr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT);
thr = UT_LIST_GET_FIRST(trx->wait_thrs);
@@ -960,7 +978,9 @@ trx_lock_wait_to_suspended(
{
que_thr_t* thr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT);
thr = UT_LIST_GET_FIRST(trx->wait_thrs);
@@ -988,7 +1008,9 @@ trx_sig_reply_wait_to_suspended(
trx_sig_t* sig;
que_thr_t* thr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
sig = UT_LIST_GET_FIRST(trx->reply_signals);
@@ -1021,7 +1043,9 @@ trx_sig_is_compatible(
{
trx_sig_t* sig;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (UT_LIST_GET_LEN(trx->signals) == 0) {
@@ -1109,7 +1133,9 @@ trx_sig_send(
trx_t* receiver_trx;
ut_ad(trx);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (!trx_sig_is_compatible(trx, type, sender)) {
/* The signal is not compatible with the other signals in
@@ -1188,7 +1214,9 @@ trx_end_signal_handling(
/*====================*/
trx_t* trx) /* in: trx */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->handling_signals == TRUE);
trx->handling_signals = FALSE;
@@ -1222,7 +1250,9 @@ loop:
we can process immediately */
ut_ad(trx);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (trx->handling_signals && (UT_LIST_GET_LEN(trx->signals) == 0)) {
@@ -1323,7 +1353,9 @@ trx_sig_reply(
trx_t* receiver_trx;
ut_ad(sig);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (sig->receiver != NULL) {
ut_ad((sig->receiver)->state == QUE_THR_SIG_REPLY_WAIT);
@@ -1351,7 +1383,9 @@ trx_sig_remove(
trx_sig_t* sig) /* in, own: signal */
{
ut_ad(trx && sig);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(sig->receiver == NULL);
diff --git a/innobase/trx/trx0undo.c b/innobase/trx/trx0undo.c
index 0b82a929878..7f7967477eb 100644
--- a/innobase/trx/trx0undo.c
+++ b/innobase/trx/trx0undo.c
@@ -390,7 +390,9 @@ trx_undo_seg_create(
ibool success;
ut_ad(mtr && id && rseg_hdr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
/*
if (type == TRX_UNDO_INSERT) {
printf("Creating insert undo log segment\n");
@@ -430,7 +432,9 @@ trx_undo_seg_create(
return(NULL);
}
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(undo_page, SYNC_TRX_UNDO_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
@@ -735,13 +739,14 @@ trx_undo_add_page(
ulint page_no;
ibool success;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
ut_ad(!mutex_own(&kernel_mutex));
+ ut_ad(mutex_own(&(trx->rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
rseg = trx->rseg;
- ut_ad(mutex_own(&(rseg->mutex)));
-
if (rseg->curr_size == rseg->max_size) {
return(FIL_NULL);
@@ -811,8 +816,10 @@ trx_undo_free_page(
UT_NOT_USED(hdr_offset);
ut_a(hdr_page_no != page_no);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
undo_page = trx_undo_page_get(space, page_no, mtr);
@@ -859,7 +866,9 @@ trx_undo_free_page_in_rollback(
ulint last_page_no;
ut_ad(undo->hdr_page_no != page_no);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
last_page_no = trx_undo_free_page(undo->rseg, FALSE, undo->space,
undo->hdr_page_no, undo->hdr_offset,
@@ -913,12 +922,13 @@ trx_undo_truncate_end(
trx_rseg_t* rseg;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
+ ut_ad(mutex_own(&(trx->rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
rseg = trx->rseg;
- ut_ad(mutex_own(&(rseg->mutex)));
-
for (;;) {
mtr_start(&mtr);
@@ -992,7 +1002,9 @@ trx_undo_truncate_start(
ulint page_no;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (0 == ut_dulint_cmp(limit, ut_dulint_zero)) {
@@ -1058,8 +1070,9 @@ trx_undo_seg_free(
while (!finished) {
mtr_start(&mtr);
-
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(rseg->mutex));
seg_header = trx_undo_page_get(undo->space, undo->hdr_page_no,
@@ -1268,7 +1281,9 @@ trx_undo_mem_create(
{
trx_undo_t* undo;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
@@ -1312,7 +1327,9 @@ trx_undo_mem_init_for_reuse(
is created */
ulint offset) /* in: undo log header byte offset on page */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&((undo->rseg)->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (undo->id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n", undo->id);
@@ -1370,7 +1387,9 @@ trx_undo_create(
trx_undo_t* undo;
page_t* undo_page;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (rseg->curr_size == rseg->max_size) {
@@ -1421,7 +1440,9 @@ trx_undo_reuse_cached(
page_t* undo_page;
ulint offset;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (type == TRX_UNDO_INSERT) {
@@ -1517,11 +1538,15 @@ trx_undo_assign_undo(
rseg = trx->rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
mtr_start(&mtr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(rseg->mutex));
undo = trx_undo_reuse_cached(rseg, type, trx->id, &mtr);
@@ -1626,8 +1651,9 @@ trx_undo_update_cleanup(
undo = trx->update_undo;
rseg = trx->rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
trx_purge_add_update_undo_to_history(trx, undo_page, mtr);
UT_LIST_REMOVE(undo_list, rseg->update_undo_list, undo);
@@ -1666,8 +1692,10 @@ trx_undo_update_cleanup_by_discard(
undo = trx->update_undo;
rseg = trx->rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(undo->size == 1);
ut_ad(undo->del_marks == FALSE);
ut_ad(UT_LIST_GET_LEN(trx_sys->view_list) == 1);