diff options
author | unknown <marko@hundin.mysql.fi> | 2004-03-12 17:14:51 +0200 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2004-03-12 17:14:51 +0200 |
commit | e1cb1ca6fe25380edae06ded5e22e106761dcb46 (patch) | |
tree | 6a59a674bf740a7b4046a20e847ad2578a573d69 /innobase/trx/trx0undo.c | |
parent | 9a817bea5a369306dbb2113fbc599e63d5bb7d17 (diff) | |
download | mariadb-git-e1cb1ca6fe25380edae06ded5e22e106761dcb46.tar.gz |
Allow UNIV_SYNC_DEBUG to be disabled while UNIV_DEBUG is enabled
Diffstat (limited to 'innobase/trx/trx0undo.c')
-rw-r--r-- | innobase/trx/trx0undo.c | 40 |
1 files changed, 34 insertions, 6 deletions
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); |