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

Hard-code innodb_page_size as the undo log page size.

InnoDB undo logs currently always use the innodb_page_size,
whether they are stored in the system tablespace, in a
dedicated undo tablespace, or in the temporary tablespace.
Remove redundant page_size parameters.

TrxUndoRsegsIterator::set_next(): return bool instead of page_size.
parent 0ef91c89
...@@ -210,11 +210,8 @@ struct TrxUndoRsegsIterator { ...@@ -210,11 +210,8 @@ struct TrxUndoRsegsIterator {
TrxUndoRsegsIterator(); TrxUndoRsegsIterator();
/** Sets the next rseg to purge in purge_sys. /** Sets the next rseg to purge in purge_sys.
@return page size of the table for which the log is. @return whether anything is to be purged */
NOTE: if rseg is NULL when this function returns this means that bool set_next();
there are no rollback segments to purge and then the returned page
size object should not be used. */
const page_size_t set_next();
private: private:
// Disable copying // Disable copying
......
...@@ -35,7 +35,6 @@ Created 3/26/1996 Heikki Tuuri ...@@ -35,7 +35,6 @@ Created 3/26/1996 Heikki Tuuri
/** Gets a rollback segment header. /** Gets a rollback segment header.
@param[in] space space where placed @param[in] space space where placed
@param[in] page_no page number of the header @param[in] page_no page number of the header
@param[in] page_size page size
@param[in,out] mtr mini-transaction @param[in,out] mtr mini-transaction
@return rollback segment header, page x-latched */ @return rollback segment header, page x-latched */
UNIV_INLINE UNIV_INLINE
...@@ -43,13 +42,11 @@ trx_rsegf_t* ...@@ -43,13 +42,11 @@ trx_rsegf_t*
trx_rsegf_get( trx_rsegf_get(
ulint space, ulint space,
ulint page_no, ulint page_no,
const page_size_t& page_size,
mtr_t* mtr); mtr_t* mtr);
/** Gets a newly created rollback segment header. /** Gets a newly created rollback segment header.
@param[in] space space where placed @param[in] space space where placed
@param[in] page_no page number of the header @param[in] page_no page number of the header
@param[in] page_size page size
@param[in,out] mtr mini-transaction @param[in,out] mtr mini-transaction
@return rollback segment header, page x-latched */ @return rollback segment header, page x-latched */
UNIV_INLINE UNIV_INLINE
...@@ -57,7 +54,6 @@ trx_rsegf_t* ...@@ -57,7 +54,6 @@ trx_rsegf_t*
trx_rsegf_get_new( trx_rsegf_get_new(
ulint space, ulint space,
ulint page_no, ulint page_no,
const page_size_t& page_size,
mtr_t* mtr); mtr_t* mtr);
/***************************************************************//** /***************************************************************//**
...@@ -104,7 +100,6 @@ trx_rseg_get_on_id(ulint id) ...@@ -104,7 +100,6 @@ trx_rseg_get_on_id(ulint id)
This function is called only when a new rollback segment is created in This function is called only when a new rollback segment is created in
the database. the database.
@param[in] space space id @param[in] space space id
@param[in] page_size page size
@param[in] max_size max size in pages @param[in] max_size max size in pages
@param[in] rseg_slot_no rseg id == slot number in trx sys @param[in] rseg_slot_no rseg id == slot number in trx sys
@param[in,out] mtr mini-transaction @param[in,out] mtr mini-transaction
...@@ -112,7 +107,6 @@ the database. ...@@ -112,7 +107,6 @@ the database.
ulint ulint
trx_rseg_header_create( trx_rseg_header_create(
ulint space, ulint space,
const page_size_t& page_size,
ulint max_size, ulint max_size,
ulint rseg_slot_no, ulint rseg_slot_no,
mtr_t* mtr); mtr_t* mtr);
...@@ -168,9 +162,6 @@ struct trx_rseg_t { ...@@ -168,9 +162,6 @@ struct trx_rseg_t {
/** page number of the rollback segment header */ /** page number of the rollback segment header */
ulint page_no; ulint page_no;
/** page size of the relevant tablespace */
page_size_t page_size;
/** maximum allowed size in pages */ /** maximum allowed size in pages */
ulint max_size; ulint max_size;
......
...@@ -30,7 +30,6 @@ Created 3/26/1996 Heikki Tuuri ...@@ -30,7 +30,6 @@ Created 3/26/1996 Heikki Tuuri
/** Gets a rollback segment header. /** Gets a rollback segment header.
@param[in] space space where placed @param[in] space space where placed
@param[in] page_no page number of the header @param[in] page_no page number of the header
@param[in] page_size page size
@param[in,out] mtr mini-transaction @param[in,out] mtr mini-transaction
@return rollback segment header, page x-latched */ @return rollback segment header, page x-latched */
UNIV_INLINE UNIV_INLINE
...@@ -38,14 +37,15 @@ trx_rsegf_t* ...@@ -38,14 +37,15 @@ trx_rsegf_t*
trx_rsegf_get( trx_rsegf_get(
ulint space, ulint space,
ulint page_no, ulint page_no,
const page_size_t& page_size,
mtr_t* mtr) mtr_t* mtr)
{ {
buf_block_t* block; buf_block_t* block;
trx_rsegf_t* header; trx_rsegf_t* header;
ut_ad(space <= srv_undo_tablespaces || space == SRV_TMP_SPACE_ID);
block = buf_page_get( block = buf_page_get(
page_id_t(space, page_no), page_size, RW_X_LATCH, mtr); page_id_t(space, page_no), univ_page_size, RW_X_LATCH, mtr);
buf_block_dbg_add_level(block, SYNC_RSEG_HEADER); buf_block_dbg_add_level(block, SYNC_RSEG_HEADER);
...@@ -57,7 +57,6 @@ trx_rsegf_get( ...@@ -57,7 +57,6 @@ trx_rsegf_get(
/** Gets a newly created rollback segment header. /** Gets a newly created rollback segment header.
@param[in] space space where placed @param[in] space space where placed
@param[in] page_no page number of the header @param[in] page_no page number of the header
@param[in] page_size page size
@param[in,out] mtr mini-transaction @param[in,out] mtr mini-transaction
@return rollback segment header, page x-latched */ @return rollback segment header, page x-latched */
UNIV_INLINE UNIV_INLINE
...@@ -65,14 +64,15 @@ trx_rsegf_t* ...@@ -65,14 +64,15 @@ trx_rsegf_t*
trx_rsegf_get_new( trx_rsegf_get_new(
ulint space, ulint space,
ulint page_no, ulint page_no,
const page_size_t& page_size,
mtr_t* mtr) mtr_t* mtr)
{ {
buf_block_t* block; buf_block_t* block;
trx_rsegf_t* header; trx_rsegf_t* header;
ut_ad(space <= srv_undo_tablespaces || space == SRV_TMP_SPACE_ID);
block = buf_page_get( block = buf_page_get(
page_id_t(space, page_no), page_size, RW_X_LATCH, mtr); page_id_t(space, page_no), univ_page_size, RW_X_LATCH, mtr);
buf_block_dbg_add_level(block, SYNC_RSEG_HEADER_NEW); buf_block_dbg_add_level(block, SYNC_RSEG_HEADER_NEW);
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -98,27 +99,19 @@ trx_read_roll_ptr( ...@@ -98,27 +99,19 @@ trx_read_roll_ptr(
/** Gets an undo log page and x-latches it. /** Gets an undo log page and x-latches it.
@param[in] page_id page id @param[in] page_id page id
@param[in] page_size page size
@param[in,out] mtr mini-transaction @param[in,out] mtr mini-transaction
@return pointer to page x-latched */ @return pointer to page x-latched */
UNIV_INLINE UNIV_INLINE
page_t* page_t*
trx_undo_page_get( trx_undo_page_get(const page_id_t& page_id, mtr_t* mtr);
const page_id_t& page_id,
const page_size_t& page_size,
mtr_t* mtr);
/** Gets an undo log page and s-latches it. /** Gets an undo log page and s-latches it.
@param[in] page_id page id @param[in] page_id page id
@param[in] page_size page size
@param[in,out] mtr mini-transaction @param[in,out] mtr mini-transaction
@return pointer to page s-latched */ @return pointer to page s-latched */
UNIV_INLINE UNIV_INLINE
page_t* page_t*
trx_undo_page_get_s_latched( trx_undo_page_get_s_latched(const page_id_t& page_id, mtr_t* mtr);
const page_id_t& page_id,
const page_size_t& page_size,
mtr_t* mtr);
/******************************************************************//** /******************************************************************//**
Returns the previous undo record on the page in the specified log, or Returns the previous undo record on the page in the specified log, or
...@@ -188,7 +181,6 @@ trx_undo_get_next_rec( ...@@ -188,7 +181,6 @@ trx_undo_get_next_rec(
/** Gets the first record in an undo log. /** Gets the first record in an undo log.
@param[in] space undo log header space @param[in] space undo log header space
@param[in] page_size page size
@param[in] page_no undo log header page number @param[in] page_no undo log header page number
@param[in] offset undo log header offset on page @param[in] offset undo log header offset on page
@param[in] mode latching mode: RW_S_LATCH or RW_X_LATCH @param[in] mode latching mode: RW_S_LATCH or RW_X_LATCH
...@@ -197,7 +189,6 @@ trx_undo_get_next_rec( ...@@ -197,7 +189,6 @@ trx_undo_get_next_rec(
trx_undo_rec_t* trx_undo_rec_t*
trx_undo_get_first_rec( trx_undo_get_first_rec(
ulint space, ulint space,
const page_size_t& page_size,
ulint page_no, ulint page_no,
ulint offset, ulint offset,
ulint mode, ulint mode,
...@@ -455,7 +446,6 @@ struct trx_undo_t { ...@@ -455,7 +446,6 @@ struct trx_undo_t {
/*-----------------------------*/ /*-----------------------------*/
ulint space; /*!< space id where the undo log ulint space; /*!< space id where the undo log
placed */ placed */
page_size_t page_size;
ulint hdr_page_no; /*!< page number of the header page in ulint hdr_page_no; /*!< page number of the header page in
the undo log */ the undo log */
ulint hdr_offset; /*!< header offset of the undo log on ulint hdr_offset; /*!< header offset of the undo log on
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -153,17 +154,13 @@ trx_read_roll_ptr( ...@@ -153,17 +154,13 @@ trx_read_roll_ptr(
/** Gets an undo log page and x-latches it. /** Gets an undo log page and x-latches it.
@param[in] page_id page id @param[in] page_id page id
@param[in] page_size page size
@param[in,out] mtr mini-transaction @param[in,out] mtr mini-transaction
@return pointer to page x-latched */ @return pointer to page x-latched */
UNIV_INLINE UNIV_INLINE
page_t* page_t*
trx_undo_page_get( trx_undo_page_get(const page_id_t& page_id, mtr_t* mtr)
const page_id_t& page_id,
const page_size_t& page_size,
mtr_t* mtr)
{ {
buf_block_t* block = buf_page_get(page_id, page_size, buf_block_t* block = buf_page_get(page_id, univ_page_size,
RW_X_LATCH, mtr); RW_X_LATCH, mtr);
buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE); buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
...@@ -173,17 +170,13 @@ trx_undo_page_get( ...@@ -173,17 +170,13 @@ trx_undo_page_get(
/** Gets an undo log page and s-latches it. /** Gets an undo log page and s-latches it.
@param[in] page_id page id @param[in] page_id page id
@param[in] page_size page size
@param[in,out] mtr mini-transaction @param[in,out] mtr mini-transaction
@return pointer to page s-latched */ @return pointer to page s-latched */
UNIV_INLINE UNIV_INLINE
page_t* page_t*
trx_undo_page_get_s_latched( trx_undo_page_get_s_latched(const page_id_t& page_id, mtr_t* mtr)
const page_id_t& page_id,
const page_size_t& page_size,
mtr_t* mtr)
{ {
buf_block_t* block = buf_page_get(page_id, page_size, buf_block_t* block = buf_page_get(page_id, univ_page_size,
RW_S_LATCH, mtr); RW_S_LATCH, mtr);
buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE); buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2014, 2015, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
......
...@@ -1047,8 +1047,7 @@ srv_undo_tablespaces_init( ...@@ -1047,8 +1047,7 @@ srv_undo_tablespaces_init(
if (space_id == *it) { if (space_id == *it) {
trx_rseg_header_create( trx_rseg_header_create(
*it, univ_page_size, ULINT_MAX, *it, ULINT_MAX, i, &mtr);
i, &mtr);
} }
} }
......
...@@ -81,11 +81,9 @@ TrxUndoRsegsIterator::TrxUndoRsegsIterator() ...@@ -81,11 +81,9 @@ TrxUndoRsegsIterator::TrxUndoRsegsIterator()
} }
/** Sets the next rseg to purge in purge_sys. /** Sets the next rseg to purge in purge_sys.
@return page size of the table for which the log is. @return whether anything is to be purged */
NOTE: if rseg is NULL when this function returns this means that inline
there are no rollback segments to purge and then the returned page bool
size object should not be used. */
const page_size_t
TrxUndoRsegsIterator::set_next() TrxUndoRsegsIterator::set_next()
{ {
mutex_enter(&purge_sys->pq_mutex); mutex_enter(&purge_sys->pq_mutex);
...@@ -141,9 +139,7 @@ TrxUndoRsegsIterator::set_next() ...@@ -141,9 +139,7 @@ TrxUndoRsegsIterator::set_next()
mutex_exit(&purge_sys->pq_mutex); mutex_exit(&purge_sys->pq_mutex);
purge_sys->rseg = NULL; purge_sys->rseg = NULL;
return false;
/* return a dummy object, not going to be used by the caller */
return(univ_page_size);
} }
purge_sys->rseg = *m_iter++; purge_sys->rseg = *m_iter++;
...@@ -164,8 +160,6 @@ TrxUndoRsegsIterator::set_next() ...@@ -164,8 +160,6 @@ TrxUndoRsegsIterator::set_next()
|| is_system_tablespace( || is_system_tablespace(
purge_sys->rseg->space)); purge_sys->rseg->space));
const page_size_t page_size(purge_sys->rseg->page_size);
ut_a(purge_sys->iter.trx_no <= purge_sys->rseg->last_trx_no); ut_a(purge_sys->iter.trx_no <= purge_sys->rseg->last_trx_no);
purge_sys->iter.trx_no = purge_sys->rseg->last_trx_no; purge_sys->iter.trx_no = purge_sys->rseg->last_trx_no;
...@@ -174,7 +168,7 @@ TrxUndoRsegsIterator::set_next() ...@@ -174,7 +168,7 @@ TrxUndoRsegsIterator::set_next()
mutex_exit(&purge_sys->rseg->mutex); mutex_exit(&purge_sys->rseg->mutex);
return(page_size); return(true);
} }
/** Build a purge 'query' graph. The actual purge is performed by executing /** Build a purge 'query' graph. The actual purge is performed by executing
...@@ -275,9 +269,7 @@ trx_purge_add_update_undo_to_history( ...@@ -275,9 +269,7 @@ trx_purge_add_update_undo_to_history(
undo = undo_ptr->update_undo; undo = undo_ptr->update_undo;
rseg = undo->rseg; rseg = undo->rseg;
rseg_header = trx_rsegf_get( rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
undo->rseg->space, undo->rseg->page_no, undo->rseg->page_size,
mtr);
undo_header = undo_page + undo->hdr_offset; undo_header = undo_page + undo->hdr_offset;
...@@ -385,12 +377,10 @@ trx_purge_free_segment( ...@@ -385,12 +377,10 @@ trx_purge_free_segment(
mutex_enter(&rseg->mutex); mutex_enter(&rseg->mutex);
rseg_hdr = trx_rsegf_get( rseg_hdr = trx_rsegf_get(rseg->space, rseg->page_no, &mtr);
rseg->space, rseg->page_no, rseg->page_size, &mtr);
undo_page = trx_undo_page_get( undo_page = trx_undo_page_get(
page_id_t(rseg->space, hdr_addr.page), rseg->page_size, page_id_t(rseg->space, hdr_addr.page), &mtr);
&mtr);
seg_hdr = undo_page + TRX_UNDO_SEG_HDR; seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
log_hdr = undo_page + hdr_addr.boffset; log_hdr = undo_page + hdr_addr.boffset;
...@@ -483,8 +473,7 @@ trx_purge_truncate_rseg_history( ...@@ -483,8 +473,7 @@ trx_purge_truncate_rseg_history(
} }
mutex_enter(&(rseg->mutex)); mutex_enter(&(rseg->mutex));
rseg_hdr = trx_rsegf_get(rseg->space, rseg->page_no, rseg_hdr = trx_rsegf_get(rseg->space, rseg->page_no, &mtr);
rseg->page_size, &mtr);
hdr_addr = trx_purge_get_log_from_hist( hdr_addr = trx_purge_get_log_from_hist(
flst_get_last(rseg_hdr + TRX_RSEG_HISTORY, &mtr)); flst_get_last(rseg_hdr + TRX_RSEG_HISTORY, &mtr));
...@@ -499,7 +488,7 @@ trx_purge_truncate_rseg_history( ...@@ -499,7 +488,7 @@ trx_purge_truncate_rseg_history(
} }
undo_page = trx_undo_page_get(page_id_t(rseg->space, hdr_addr.page), undo_page = trx_undo_page_get(page_id_t(rseg->space, hdr_addr.page),
rseg->page_size, &mtr); &mtr);
log_hdr = undo_page + hdr_addr.boffset; log_hdr = undo_page + hdr_addr.boffset;
...@@ -554,8 +543,7 @@ trx_purge_truncate_rseg_history( ...@@ -554,8 +543,7 @@ trx_purge_truncate_rseg_history(
} }
mutex_enter(&(rseg->mutex)); mutex_enter(&(rseg->mutex));
rseg_hdr = trx_rsegf_get(rseg->space, rseg->page_no, rseg_hdr = trx_rsegf_get(rseg->space, rseg->page_no, &mtr);
rseg->page_size, &mtr);
hdr_addr = prev_hdr_addr; hdr_addr = prev_hdr_addr;
...@@ -1189,8 +1177,7 @@ trx_purge_rseg_get_next_history_log( ...@@ -1189,8 +1177,7 @@ trx_purge_rseg_get_next_history_log(
mtr_start(&mtr); mtr_start(&mtr);
undo_page = trx_undo_page_get_s_latched( undo_page = trx_undo_page_get_s_latched(
page_id_t(rseg->space, rseg->last_page_no), page_id_t(rseg->space, rseg->last_page_no), &mtr);
rseg->page_size, &mtr);
log_hdr = undo_page + rseg->last_offset; log_hdr = undo_page + rseg->last_offset;
...@@ -1242,7 +1229,7 @@ trx_purge_rseg_get_next_history_log( ...@@ -1242,7 +1229,7 @@ trx_purge_rseg_get_next_history_log(
log_hdr = trx_undo_page_get_s_latched(page_id_t(rseg->space, log_hdr = trx_undo_page_get_s_latched(page_id_t(rseg->space,
prev_log_addr.page), prev_log_addr.page),
rseg->page_size, &mtr) &mtr)
+ prev_log_addr.boffset; + prev_log_addr.boffset;
trx_no = mach_read_from_8(log_hdr + TRX_UNDO_TRX_NO); trx_no = mach_read_from_8(log_hdr + TRX_UNDO_TRX_NO);
...@@ -1275,12 +1262,10 @@ trx_purge_rseg_get_next_history_log( ...@@ -1275,12 +1262,10 @@ trx_purge_rseg_get_next_history_log(
mutex_exit(&rseg->mutex); mutex_exit(&rseg->mutex);
} }
/** Position the purge sys "iterator" on the undo record to use for purging. /** Position the purge sys "iterator" on the undo record to use for purging. */
@param[in] page_size page size */
static static
void void
trx_purge_read_undo_rec( trx_purge_read_undo_rec()
const page_size_t& page_size)
{ {
ulint offset; ulint offset;
ulint page_no; ulint page_no;
...@@ -1298,7 +1283,6 @@ trx_purge_read_undo_rec( ...@@ -1298,7 +1283,6 @@ trx_purge_read_undo_rec(
undo_rec = trx_undo_get_first_rec( undo_rec = trx_undo_get_first_rec(
purge_sys->rseg->space, purge_sys->rseg->space,
page_size,
purge_sys->hdr_page_no, purge_sys->hdr_page_no,
purge_sys->hdr_offset, RW_S_LATCH, &mtr); purge_sys->hdr_offset, RW_S_LATCH, &mtr);
...@@ -1340,10 +1324,8 @@ trx_purge_choose_next_log(void) ...@@ -1340,10 +1324,8 @@ trx_purge_choose_next_log(void)
{ {
ut_ad(!purge_sys->next_stored); ut_ad(!purge_sys->next_stored);
const page_size_t& page_size = purge_sys->rseg_iter.set_next(); if (purge_sys->rseg_iter.set_next()) {
trx_purge_read_undo_rec();
if (purge_sys->rseg != NULL) {
trx_purge_read_undo_rec(page_size);
} else { } else {
/* There is nothing to do yet. */ /* There is nothing to do yet. */
os_thread_yield(); os_thread_yield();
...@@ -1378,8 +1360,6 @@ trx_purge_get_next_rec( ...@@ -1378,8 +1360,6 @@ trx_purge_get_next_rec(
page_no = purge_sys->page_no; page_no = purge_sys->page_no;
offset = purge_sys->offset; offset = purge_sys->offset;
const page_size_t page_size(purge_sys->rseg->page_size);
if (offset == 0) { if (offset == 0) {
/* It is the dummy undo log record, which means that there is /* It is the dummy undo log record, which means that there is
no need to purge this undo log */ no need to purge this undo log */
...@@ -1397,7 +1377,7 @@ trx_purge_get_next_rec( ...@@ -1397,7 +1377,7 @@ trx_purge_get_next_rec(
mtr_start(&mtr); mtr_start(&mtr);
undo_page = trx_undo_page_get_s_latched(page_id_t(space, page_no), undo_page = trx_undo_page_get_s_latched(page_id_t(space, page_no),
page_size, &mtr); &mtr);
rec = undo_page + offset; rec = undo_page + offset;
...@@ -1455,7 +1435,7 @@ trx_purge_get_next_rec( ...@@ -1455,7 +1435,7 @@ trx_purge_get_next_rec(
mtr_start(&mtr); mtr_start(&mtr);
undo_page = trx_undo_page_get_s_latched( undo_page = trx_undo_page_get_s_latched(
page_id_t(space, page_no), page_size, &mtr); page_id_t(space, page_no), &mtr);
rec = undo_page + offset; rec = undo_page + offset;
} else { } else {
......
...@@ -1972,7 +1972,7 @@ trx_undo_report_row_operation( ...@@ -1972,7 +1972,7 @@ trx_undo_report_row_operation(
page_no = undo->last_page_no; page_no = undo->last_page_no;
undo_block = buf_page_get_gen( undo_block = buf_page_get_gen(
page_id_t(undo->space, page_no), undo->page_size, RW_X_LATCH, page_id_t(undo->space, page_no), univ_page_size, RW_X_LATCH,
buf_pool_is_obsolete(undo->withdraw_clock) buf_pool_is_obsolete(undo->withdraw_clock)
? NULL : undo->guess_block, BUF_GET, __FILE__, __LINE__, ? NULL : undo->guess_block, BUF_GET, __FILE__, __LINE__,
&mtr, &err); &mtr, &err);
...@@ -2127,8 +2127,7 @@ trx_undo_get_undo_rec_low( ...@@ -2127,8 +2127,7 @@ trx_undo_get_undo_rec_low(
mtr_start(&mtr); mtr_start(&mtr);
undo_page = trx_undo_page_get_s_latched( undo_page = trx_undo_page_get_s_latched(
page_id_t(rseg->space, page_no), rseg->page_size, page_id_t(rseg->space, page_no), &mtr);
&mtr);
undo_rec = trx_undo_rec_copy(undo_page + offset, heap); undo_rec = trx_undo_rec_copy(undo_page + offset, heap);
......
...@@ -930,8 +930,7 @@ trx_roll_pop_top_rec( ...@@ -930,8 +930,7 @@ trx_roll_pop_top_rec(
ut_ad(mutex_own(&trx->undo_mutex)); ut_ad(mutex_own(&trx->undo_mutex));
page_t* undo_page = trx_undo_page_get_s_latched( page_t* undo_page = trx_undo_page_get_s_latched(
page_id_t(undo->space, undo->top_page_no), page_id_t(undo->space, undo->top_page_no), mtr);
undo->page_size, mtr);
ulint offset = undo->top_offset; ulint offset = undo->top_offset;
......
...@@ -43,7 +43,6 @@ Created 3/26/1996 Heikki Tuuri ...@@ -43,7 +43,6 @@ Created 3/26/1996 Heikki Tuuri
This function is called only when a new rollback segment is created in This function is called only when a new rollback segment is created in
the database. the database.
@param[in] space space id @param[in] space space id
@param[in] page_size page size
@param[in] max_size max size in pages @param[in] max_size max size in pages
@param[in] rseg_slot_no rseg id == slot number in trx sys @param[in] rseg_slot_no rseg id == slot number in trx sys
@param[in,out] mtr mini-transaction @param[in,out] mtr mini-transaction
...@@ -51,7 +50,6 @@ the database. ...@@ -51,7 +50,6 @@ the database.
ulint ulint
trx_rseg_header_create( trx_rseg_header_create(
ulint space, ulint space,
const page_size_t& page_size,
ulint max_size, ulint max_size,
ulint rseg_slot_no, ulint rseg_slot_no,
mtr_t* mtr) mtr_t* mtr)
...@@ -80,7 +78,7 @@ trx_rseg_header_create( ...@@ -80,7 +78,7 @@ trx_rseg_header_create(
page_no = block->page.id.page_no(); page_no = block->page.id.page_no();
/* Get the rollback segment file page */ /* Get the rollback segment file page */
rsegf = trx_rsegf_get_new(space, page_no, page_size, mtr); rsegf = trx_rsegf_get_new(space, page_no, mtr);
/* Initialize max size field */ /* Initialize max size field */
mlog_write_ulint(rsegf + TRX_RSEG_MAX_SIZE, max_size, mlog_write_ulint(rsegf + TRX_RSEG_MAX_SIZE, max_size,
...@@ -166,7 +164,6 @@ array in the trx system object. ...@@ -166,7 +164,6 @@ array in the trx system object.
@param[in] id rollback segment id @param[in] id rollback segment id
@param[in] space space where the segment is placed @param[in] space space where the segment is placed
@param[in] page_no page number of the segment header @param[in] page_no page number of the segment header
@param[in] page_size page size
@param[in,out] mtr mini-transaction */ @param[in,out] mtr mini-transaction */
static static
void void
...@@ -174,7 +171,6 @@ trx_rseg_mem_create( ...@@ -174,7 +171,6 @@ trx_rseg_mem_create(
ulint id, ulint id,
ulint space, ulint space,
ulint page_no, ulint page_no,
const page_size_t& page_size,
mtr_t* mtr) mtr_t* mtr)
{ {
ulint len; ulint len;
...@@ -188,7 +184,6 @@ trx_rseg_mem_create( ...@@ -188,7 +184,6 @@ trx_rseg_mem_create(
rseg->id = id; rseg->id = id;
rseg->space = space; rseg->space = space;
rseg->page_size.copy_from(page_size);
rseg->page_no = page_no; rseg->page_no = page_no;
rseg->trx_ref_count = 0; rseg->trx_ref_count = 0;
rseg->skip_allocation = false; rseg->skip_allocation = false;
...@@ -206,7 +201,7 @@ trx_rseg_mem_create( ...@@ -206,7 +201,7 @@ trx_rseg_mem_create(
trx_sys->rseg_array[id] = rseg; trx_sys->rseg_array[id] = rseg;
rseg_header = trx_rsegf_get_new(space, page_no, page_size, mtr); rseg_header = trx_rsegf_get_new(space, page_no, mtr);
rseg->max_size = mtr_read_ulint( rseg->max_size = mtr_read_ulint(
rseg_header + TRX_RSEG_MAX_SIZE, MLOG_4BYTES, mtr); rseg_header + TRX_RSEG_MAX_SIZE, MLOG_4BYTES, mtr);
...@@ -231,8 +226,8 @@ trx_rseg_mem_create( ...@@ -231,8 +226,8 @@ trx_rseg_mem_create(
rseg->last_offset = node_addr.boffset; rseg->last_offset = node_addr.boffset;
undo_log_hdr = trx_undo_page_get( undo_log_hdr = trx_undo_page_get(
page_id_t(rseg->space, node_addr.page), page_id_t(rseg->space, node_addr.page), mtr)
rseg->page_size, mtr) + node_addr.boffset; + node_addr.boffset;
rseg->last_trx_no = mach_read_from_8( rseg->last_trx_no = mach_read_from_8(
undo_log_hdr + TRX_UNDO_TRX_NO); undo_log_hdr + TRX_UNDO_TRX_NO);
...@@ -262,29 +257,17 @@ trx_rseg_array_init() ...@@ -262,29 +257,17 @@ trx_rseg_array_init()
mtr_t mtr; mtr_t mtr;
for (ulint i = 0; i < TRX_SYS_N_RSEGS; i++) { for (ulint i = 0; i < TRX_SYS_N_RSEGS; i++) {
ut_a(!trx_rseg_get_on_id(i)); ut_ad(!trx_rseg_get_on_id(i));
ulint page_no;
mtr.start(); mtr.start();
trx_sysf_t* sys_header = trx_sysf_get(&mtr); trx_sysf_t* sys_header = trx_sysf_get(&mtr);
ulint page_no = trx_sysf_rseg_get_page_no(
page_no = trx_sysf_rseg_get_page_no(sys_header, i, &mtr); sys_header, i, &mtr);
if (page_no != FIL_NULL) { if (page_no != FIL_NULL) {
ulint space;
space = trx_sysf_rseg_get_space(sys_header, i, &mtr);
bool found = true;
const page_size_t& page_size
= is_system_tablespace(space)
? univ_page_size
: fil_space_get_page_size(space, &found);
ut_ad(found);
trx_rseg_mem_create( trx_rseg_mem_create(
i, space, page_no, page_size, &mtr); i,
trx_sysf_rseg_get_space(sys_header, i, &mtr),
page_no, &mtr);
} }
mtr.commit(); mtr.commit();
...@@ -320,13 +303,11 @@ trx_rseg_create( ...@@ -320,13 +303,11 @@ trx_rseg_create(
break; break;
} }
page_size_t page_size(space->flags);
ulint slot_no = trx_sysf_rseg_find_free( ulint slot_no = trx_sysf_rseg_find_free(
&mtr, space->purpose == FIL_TYPE_TEMPORARY, nth_free_slot); &mtr, space->purpose == FIL_TYPE_TEMPORARY, nth_free_slot);
ulint page_no = slot_no == ULINT_UNDEFINED ulint page_no = slot_no == ULINT_UNDEFINED
? FIL_NULL ? FIL_NULL
: trx_rseg_header_create( : trx_rseg_header_create(space_id, ULINT_MAX, slot_no, &mtr);
space_id, page_size, ULINT_MAX, slot_no, &mtr);
if (page_no != FIL_NULL) { if (page_no != FIL_NULL) {
trx_sysf_t* sys_header = trx_sysf_get(&mtr); trx_sysf_t* sys_header = trx_sysf_get(&mtr);
...@@ -335,8 +316,7 @@ trx_rseg_create( ...@@ -335,8 +316,7 @@ trx_rseg_create(
sys_header, slot_no, &mtr); sys_header, slot_no, &mtr);
ut_a(id == space_id || trx_sys_is_noredo_rseg_slot(slot_no)); ut_a(id == space_id || trx_sys_is_noredo_rseg_slot(slot_no));
trx_rseg_mem_create( trx_rseg_mem_create(slot_no, space_id, page_no, &mtr);
slot_no, space_id, page_no, page_size, &mtr);
} }
mtr.commit(); mtr.commit();
......
...@@ -224,10 +224,6 @@ trx_sys_update_mysql_binlog_offset( ...@@ -224,10 +224,6 @@ trx_sys_update_mysql_binlog_offset(
return; return;
} }
if (sys_header == NULL) {
sys_header = trx_sysf_get(mtr);
}
if (mach_read_from_4(sys_header + field if (mach_read_from_4(sys_header + field
+ TRX_SYS_MYSQL_LOG_MAGIC_N_FLD) + TRX_SYS_MYSQL_LOG_MAGIC_N_FLD)
!= TRX_SYS_MYSQL_LOG_MAGIC_N) { != TRX_SYS_MYSQL_LOG_MAGIC_N) {
...@@ -571,7 +567,7 @@ trx_sysf_create( ...@@ -571,7 +567,7 @@ trx_sysf_create(
/* Create the first rollback segment in the SYSTEM tablespace */ /* Create the first rollback segment in the SYSTEM tablespace */
slot_no = trx_sysf_rseg_find_free(mtr, false, 0); slot_no = trx_sysf_rseg_find_free(mtr, false, 0);
page_no = trx_rseg_header_create(TRX_SYS_SPACE, univ_page_size, page_no = trx_rseg_header_create(TRX_SYS_SPACE,
ULINT_MAX, slot_no, mtr); ULINT_MAX, slot_no, mtr);
ut_a(slot_no == TRX_SYS_SYSTEM_RSEG_ID); ut_a(slot_no == TRX_SYS_SYSTEM_RSEG_ID);
......
...@@ -750,8 +750,7 @@ trx_resurrect_table_locks( ...@@ -750,8 +750,7 @@ trx_resurrect_table_locks(
/* trx_rseg_mem_create() may have acquired an X-latch on this /* trx_rseg_mem_create() may have acquired an X-latch on this
page, so we cannot acquire an S-latch. */ page, so we cannot acquire an S-latch. */
undo_page = trx_undo_page_get( undo_page = trx_undo_page_get(
page_id_t(undo->space, undo->top_page_no), undo->page_size, page_id_t(undo->space, undo->top_page_no), &mtr);
&mtr);
undo_rec = undo_page + undo->top_offset; undo_rec = undo_page + undo->top_offset;
...@@ -1577,8 +1576,6 @@ trx_write_serialisation_history( ...@@ -1577,8 +1576,6 @@ trx_write_serialisation_history(
trx_t* trx, /*!< in/out: transaction */ trx_t* trx, /*!< in/out: transaction */
mtr_t* mtr) /*!< in/out: mini-transaction */ mtr_t* mtr) /*!< in/out: mini-transaction */
{ {
trx_sysf_t* sys_header = NULL;
/* Change the undo log segment states from TRX_UNDO_ACTIVE to some /* Change the undo log segment states from TRX_UNDO_ACTIVE to some
other state: these modifications to the file data structure define other state: these modifications to the file data structure define
the transaction as committed in the file based domain, at the the transaction as committed in the file based domain, at the
...@@ -1698,8 +1695,8 @@ trx_write_serialisation_history( ...@@ -1698,8 +1695,8 @@ trx_write_serialisation_history(
MONITOR_INC(MONITOR_TRX_COMMIT_UNDO); MONITOR_INC(MONITOR_TRX_COMMIT_UNDO);
trx_sysf_t* sys_header = trx_sysf_get(mtr);
#ifdef WITH_WSREP #ifdef WITH_WSREP
sys_header = trx_sysf_get(mtr);
/* Update latest MySQL wsrep XID in trx sys header. */ /* Update latest MySQL wsrep XID in trx sys header. */
if (wsrep_is_wsrep_xid(trx->xid)) { if (wsrep_is_wsrep_xid(trx->xid)) {
trx_sys_update_wsrep_checkpoint(trx->xid, sys_header, mtr); trx_sys_update_wsrep_checkpoint(trx->xid, sys_header, mtr);
......
...@@ -178,14 +178,8 @@ trx_undo_get_prev_rec_from_prev_page( ...@@ -178,14 +178,8 @@ trx_undo_get_prev_rec_from_prev_page(
space = page_get_space_id(undo_page); space = page_get_space_id(undo_page);
bool found;
const page_size_t& page_size = fil_space_get_page_size(space,
&found);
ut_ad(found);
buf_block_t* block = buf_page_get( buf_block_t* block = buf_page_get(
page_id_t(space, prev_page_no), page_size, page_id_t(space, prev_page_no), univ_page_size,
shared ? RW_S_LATCH : RW_X_LATCH, mtr); shared ? RW_S_LATCH : RW_X_LATCH, mtr);
buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE); buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
...@@ -225,7 +219,6 @@ trx_undo_get_prev_rec( ...@@ -225,7 +219,6 @@ trx_undo_get_prev_rec(
/** Gets the next record in an undo log from the next page. /** Gets the next record in an undo log from the next page.
@param[in] space undo log header space @param[in] space undo log header space
@param[in] page_size page size
@param[in] undo_page undo log page @param[in] undo_page undo log page
@param[in] page_no undo log header page number @param[in] page_no undo log header page number
@param[in] offset undo log header offset on page @param[in] offset undo log header offset on page
...@@ -236,7 +229,6 @@ static ...@@ -236,7 +229,6 @@ static
trx_undo_rec_t* trx_undo_rec_t*
trx_undo_get_next_rec_from_next_page( trx_undo_get_next_rec_from_next_page(
ulint space, ulint space,
const page_size_t& page_size,
const page_t* undo_page, const page_t* undo_page,
ulint page_no, ulint page_no,
ulint offset, ulint offset,
...@@ -271,10 +263,10 @@ trx_undo_get_next_rec_from_next_page( ...@@ -271,10 +263,10 @@ trx_undo_get_next_rec_from_next_page(
if (mode == RW_S_LATCH) { if (mode == RW_S_LATCH) {
next_page = trx_undo_page_get_s_latched( next_page = trx_undo_page_get_s_latched(
next_page_id, page_size, mtr); next_page_id, mtr);
} else { } else {
ut_ad(mode == RW_X_LATCH); ut_ad(mode == RW_X_LATCH);
next_page = trx_undo_page_get(next_page_id, page_size, mtr); next_page = trx_undo_page_get(next_page_id, mtr);
} }
return(trx_undo_page_get_first_rec(next_page, page_no, offset)); return(trx_undo_page_get_first_rec(next_page, page_no, offset));
...@@ -302,13 +294,7 @@ trx_undo_get_next_rec( ...@@ -302,13 +294,7 @@ trx_undo_get_next_rec(
space = page_get_space_id(page_align(rec)); space = page_get_space_id(page_align(rec));
bool found; return(trx_undo_get_next_rec_from_next_page(space,
const page_size_t& page_size = fil_space_get_page_size(space,
&found);
ut_ad(found);
return(trx_undo_get_next_rec_from_next_page(space, page_size,
page_align(rec), page_align(rec),
page_no, offset, page_no, offset,
RW_S_LATCH, mtr)); RW_S_LATCH, mtr));
...@@ -316,7 +302,6 @@ trx_undo_get_next_rec( ...@@ -316,7 +302,6 @@ trx_undo_get_next_rec(
/** Gets the first record in an undo log. /** Gets the first record in an undo log.
@param[in] space undo log header space @param[in] space undo log header space
@param[in] page_size page size
@param[in] page_no undo log header page number @param[in] page_no undo log header page number
@param[in] offset undo log header offset on page @param[in] offset undo log header offset on page
@param[in] mode latching mode: RW_S_LATCH or RW_X_LATCH @param[in] mode latching mode: RW_S_LATCH or RW_X_LATCH
...@@ -325,7 +310,6 @@ trx_undo_get_next_rec( ...@@ -325,7 +310,6 @@ trx_undo_get_next_rec(
trx_undo_rec_t* trx_undo_rec_t*
trx_undo_get_first_rec( trx_undo_get_first_rec(
ulint space, ulint space,
const page_size_t& page_size,
ulint page_no, ulint page_no,
ulint offset, ulint offset,
ulint mode, ulint mode,
...@@ -337,10 +321,9 @@ trx_undo_get_first_rec( ...@@ -337,10 +321,9 @@ trx_undo_get_first_rec(
const page_id_t page_id(space, page_no); const page_id_t page_id(space, page_no);
if (mode == RW_S_LATCH) { if (mode == RW_S_LATCH) {
undo_page = trx_undo_page_get_s_latched( undo_page = trx_undo_page_get_s_latched(page_id, mtr);
page_id, page_size, mtr);
} else { } else {
undo_page = trx_undo_page_get(page_id, page_size, mtr); undo_page = trx_undo_page_get(page_id, mtr);
} }
rec = trx_undo_page_get_first_rec(undo_page, page_no, offset); rec = trx_undo_page_get_first_rec(undo_page, page_no, offset);
...@@ -349,7 +332,7 @@ trx_undo_get_first_rec( ...@@ -349,7 +332,7 @@ trx_undo_get_first_rec(
return(rec); return(rec);
} }
return(trx_undo_get_next_rec_from_next_page(space, page_size, return(trx_undo_get_next_rec_from_next_page(space,
undo_page, page_no, offset, undo_page, page_no, offset,
mode, mtr)); mode, mtr));
} }
...@@ -911,8 +894,7 @@ trx_undo_add_page( ...@@ -911,8 +894,7 @@ trx_undo_add_page(
} }
header_page = trx_undo_page_get( header_page = trx_undo_page_get(
page_id_t(undo->space, undo->hdr_page_no), page_id_t(undo->space, undo->hdr_page_no), mtr);
undo->page_size, mtr);
if (!fsp_reserve_free_extents(&n_reserved, undo->space, 1, if (!fsp_reserve_free_extents(&n_reserved, undo->space, 1,
FSP_UNDO, mtr)) { FSP_UNDO, mtr)) {
...@@ -977,11 +959,9 @@ trx_undo_free_page( ...@@ -977,11 +959,9 @@ trx_undo_free_page(
ut_a(hdr_page_no != page_no); ut_a(hdr_page_no != page_no);
ut_ad(mutex_own(&(rseg->mutex))); ut_ad(mutex_own(&(rseg->mutex)));
undo_page = trx_undo_page_get( undo_page = trx_undo_page_get(page_id_t(space, page_no), mtr);
page_id_t(space, page_no), rseg->page_size, mtr);
header_page = trx_undo_page_get( header_page = trx_undo_page_get(page_id_t(space, hdr_page_no), mtr);
page_id_t(space, hdr_page_no), rseg->page_size, mtr);
flst_remove(header_page + TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST, flst_remove(header_page + TRX_UNDO_SEG_HDR + TRX_UNDO_PAGE_LIST,
undo_page + TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_NODE, mtr); undo_page + TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_NODE, mtr);
...@@ -994,8 +974,7 @@ trx_undo_free_page( ...@@ -994,8 +974,7 @@ trx_undo_free_page(
rseg->curr_size--; rseg->curr_size--;
if (in_history) { if (in_history) {
rseg_header = trx_rsegf_get(space, rseg->page_no, rseg_header = trx_rsegf_get(space, rseg->page_no, mtr);
rseg->page_size, mtr);
hist_size = mtr_read_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE, hist_size = mtr_read_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE,
MLOG_4BYTES, mtr); MLOG_4BYTES, mtr);
...@@ -1036,7 +1015,6 @@ trx_undo_free_last_page_func( ...@@ -1036,7 +1015,6 @@ trx_undo_free_last_page_func(
Other undo logs may still have records on that page, if it is an update Other undo logs may still have records on that page, if it is an update
undo log. undo log.
@param[in] space space @param[in] space space
@param[in] page_size page size
@param[in] hdr_page_no header page number @param[in] hdr_page_no header page number
@param[in] hdr_offset header offset @param[in] hdr_offset header offset
@param[in,out] mtr mini-transaction */ @param[in,out] mtr mini-transaction */
...@@ -1044,7 +1022,6 @@ static ...@@ -1044,7 +1022,6 @@ static
void void
trx_undo_empty_header_page( trx_undo_empty_header_page(
ulint space, ulint space,
const page_size_t& page_size,
ulint hdr_page_no, ulint hdr_page_no,
ulint hdr_offset, ulint hdr_offset,
mtr_t* mtr) mtr_t* mtr)
...@@ -1053,8 +1030,7 @@ trx_undo_empty_header_page( ...@@ -1053,8 +1030,7 @@ trx_undo_empty_header_page(
trx_ulogf_t* log_hdr; trx_ulogf_t* log_hdr;
ulint end; ulint end;
header_page = trx_undo_page_get( header_page = trx_undo_page_get(page_id_t(space, hdr_page_no), mtr);
page_id_t(space, hdr_page_no), page_size, mtr);
log_hdr = header_page + hdr_offset; log_hdr = header_page + hdr_offset;
...@@ -1099,8 +1075,7 @@ trx_undo_truncate_end_func( ...@@ -1099,8 +1075,7 @@ trx_undo_truncate_end_func(
last_page_no = undo->last_page_no; last_page_no = undo->last_page_no;
undo_page = trx_undo_page_get( undo_page = trx_undo_page_get(
page_id_t(undo->space, last_page_no), page_id_t(undo->space, last_page_no), &mtr);
undo->page_size, &mtr);
rec = trx_undo_page_get_last_rec(undo_page, undo->hdr_page_no, rec = trx_undo_page_get_last_rec(undo_page, undo->hdr_page_no,
undo->hdr_offset); undo->hdr_offset);
...@@ -1172,8 +1147,7 @@ trx_undo_truncate_start( ...@@ -1172,8 +1147,7 @@ trx_undo_truncate_start(
mtr.set_log_mode(MTR_LOG_NO_REDO); mtr.set_log_mode(MTR_LOG_NO_REDO);
} }
rec = trx_undo_get_first_rec(rseg->space, rseg->page_size, rec = trx_undo_get_first_rec(rseg->space, hdr_page_no, hdr_offset,
hdr_page_no, hdr_offset,
RW_X_LATCH, &mtr); RW_X_LATCH, &mtr);
if (rec == NULL) { if (rec == NULL) {
/* Already empty */ /* Already empty */
...@@ -1197,7 +1171,7 @@ trx_undo_truncate_start( ...@@ -1197,7 +1171,7 @@ trx_undo_truncate_start(
page_no = page_get_page_no(undo_page); page_no = page_get_page_no(undo_page);
if (page_no == hdr_page_no) { if (page_no == hdr_page_no) {
trx_undo_empty_header_page(rseg->space, rseg->page_size, trx_undo_empty_header_page(rseg->space,
hdr_page_no, hdr_offset, hdr_page_no, hdr_offset,
&mtr); &mtr);
} else { } else {
...@@ -1240,7 +1214,7 @@ trx_undo_seg_free( ...@@ -1240,7 +1214,7 @@ trx_undo_seg_free(
seg_header = trx_undo_page_get(page_id_t(undo->space, seg_header = trx_undo_page_get(page_id_t(undo->space,
undo->hdr_page_no), undo->hdr_page_no),
undo->page_size, &mtr) &mtr)
+ TRX_UNDO_SEG_HDR; + TRX_UNDO_SEG_HDR;
file_seg = seg_header + TRX_UNDO_FSEG_HEADER; file_seg = seg_header + TRX_UNDO_FSEG_HEADER;
...@@ -1250,8 +1224,7 @@ trx_undo_seg_free( ...@@ -1250,8 +1224,7 @@ trx_undo_seg_free(
if (finished) { if (finished) {
/* Update the rseg header */ /* Update the rseg header */
rseg_header = trx_rsegf_get( rseg_header = trx_rsegf_get(
rseg->space, rseg->page_no, rseg->page_size, rseg->space, rseg->page_no, &mtr);
&mtr);
trx_rsegf_set_nth_undo(rseg_header, undo->id, FIL_NULL, trx_rsegf_set_nth_undo(rseg_header, undo->id, FIL_NULL,
&mtr); &mtr);
...@@ -1296,8 +1269,7 @@ trx_undo_mem_create_at_db_start( ...@@ -1296,8 +1269,7 @@ trx_undo_mem_create_at_db_start(
ut_a(id < TRX_RSEG_N_SLOTS); ut_a(id < TRX_RSEG_N_SLOTS);
undo_page = trx_undo_page_get( undo_page = trx_undo_page_get(page_id_t(rseg->space, page_no), mtr);
page_id_t(rseg->space, page_no), rseg->page_size, mtr);
page_header = undo_page + TRX_UNDO_PAGE_HDR; page_header = undo_page + TRX_UNDO_PAGE_HDR;
...@@ -1349,8 +1321,7 @@ trx_undo_mem_create_at_db_start( ...@@ -1349,8 +1321,7 @@ trx_undo_mem_create_at_db_start(
undo->top_page_no = last_addr.page; undo->top_page_no = last_addr.page;
last_page = trx_undo_page_get( last_page = trx_undo_page_get(
page_id_t(rseg->space, undo->last_page_no), page_id_t(rseg->space, undo->last_page_no), mtr);
rseg->page_size, mtr);
rec = trx_undo_page_get_last_rec(last_page, page_no, offset); rec = trx_undo_page_get_last_rec(last_page, page_no, offset);
...@@ -1405,8 +1376,7 @@ trx_undo_lists_init( ...@@ -1405,8 +1376,7 @@ trx_undo_lists_init(
mtr_start(&mtr); mtr_start(&mtr);
rseg_header = trx_rsegf_get_new( rseg_header = trx_rsegf_get_new(rseg->space, rseg->page_no, &mtr);
rseg->space, rseg->page_no, rseg->page_size, &mtr);
for (i = 0; i < TRX_RSEG_N_SLOTS; i++) { for (i = 0; i < TRX_RSEG_N_SLOTS; i++) {
ulint page_no; ulint page_no;
...@@ -1433,8 +1403,7 @@ trx_undo_lists_init( ...@@ -1433,8 +1403,7 @@ trx_undo_lists_init(
mtr_start(&mtr); mtr_start(&mtr);
rseg_header = trx_rsegf_get( rseg_header = trx_rsegf_get(
rseg->space, rseg->page_no, rseg->page_size, rseg->space, rseg->page_no, &mtr);
&mtr);
/* Found a used slot */ /* Found a used slot */
MONITOR_INC(MONITOR_NUM_UNDO_SLOT_USED); MONITOR_INC(MONITOR_NUM_UNDO_SLOT_USED);
...@@ -1488,7 +1457,6 @@ trx_undo_mem_create( ...@@ -1488,7 +1457,6 @@ trx_undo_mem_create(
undo->rseg = rseg; undo->rseg = rseg;
undo->space = rseg->space; undo->space = rseg->space;
undo->page_size.copy_from(rseg->page_size);
undo->hdr_page_no = page_no; undo->hdr_page_no = page_no;
undo->hdr_offset = offset; undo->hdr_offset = offset;
undo->last_page_no = page_no; undo->last_page_no = page_no;
...@@ -1577,8 +1545,7 @@ trx_undo_create( ...@@ -1577,8 +1545,7 @@ trx_undo_create(
rseg->curr_size++; rseg->curr_size++;
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
rseg->page_size, mtr);
err = trx_undo_seg_create(rseg, rseg_header, type, &id, err = trx_undo_seg_create(rseg, rseg_header, type, &id,
&undo_page, mtr); &undo_page, mtr);
...@@ -1660,8 +1627,7 @@ trx_undo_reuse_cached( ...@@ -1660,8 +1627,7 @@ trx_undo_reuse_cached(
ut_a(undo->id < TRX_RSEG_N_SLOTS); ut_a(undo->id < TRX_RSEG_N_SLOTS);
undo_page = trx_undo_page_get( undo_page = trx_undo_page_get(
page_id_t(undo->space, undo->hdr_page_no), page_id_t(undo->space, undo->hdr_page_no), mtr);
undo->page_size, mtr);
if (type == TRX_UNDO_INSERT) { if (type == TRX_UNDO_INSERT) {
offset = trx_undo_insert_header_reuse(undo_page, trx_id, mtr); offset = trx_undo_insert_header_reuse(undo_page, trx_id, mtr);
...@@ -1698,8 +1664,7 @@ trx_undo_mark_as_dict_operation( ...@@ -1698,8 +1664,7 @@ trx_undo_mark_as_dict_operation(
page_t* hdr_page; page_t* hdr_page;
hdr_page = trx_undo_page_get( hdr_page = trx_undo_page_get(
page_id_t(undo->space, undo->hdr_page_no), page_id_t(undo->space, undo->hdr_page_no), mtr);
undo->page_size, mtr);
switch (trx_get_dict_operation(trx)) { switch (trx_get_dict_operation(trx)) {
case TRX_DICT_OP_NONE: case TRX_DICT_OP_NONE:
...@@ -1828,8 +1793,7 @@ trx_undo_set_state_at_finish( ...@@ -1828,8 +1793,7 @@ trx_undo_set_state_at_finish(
ut_a(undo->id < TRX_RSEG_N_SLOTS); ut_a(undo->id < TRX_RSEG_N_SLOTS);
undo_page = trx_undo_page_get( undo_page = trx_undo_page_get(
page_id_t(undo->space, undo->hdr_page_no), page_id_t(undo->space, undo->hdr_page_no), mtr);
undo->page_size, mtr);
seg_hdr = undo_page + TRX_UNDO_SEG_HDR; seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
page_hdr = undo_page + TRX_UNDO_PAGE_HDR; page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
...@@ -1877,8 +1841,7 @@ trx_undo_set_state_at_prepare( ...@@ -1877,8 +1841,7 @@ trx_undo_set_state_at_prepare(
ut_a(undo->id < TRX_RSEG_N_SLOTS); ut_a(undo->id < TRX_RSEG_N_SLOTS);
undo_page = trx_undo_page_get( undo_page = trx_undo_page_get(
page_id_t(undo->space, undo->hdr_page_no), page_id_t(undo->space, undo->hdr_page_no), mtr);
undo->page_size, mtr);
seg_hdr = undo_page + TRX_UNDO_SEG_HDR; seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
...@@ -2123,10 +2086,9 @@ trx_undo_truncate_tablespace( ...@@ -2123,10 +2086,9 @@ trx_undo_truncate_tablespace(
trx_rseg_t* rseg = undo_trunc->get_ith_rseg(i); trx_rseg_t* rseg = undo_trunc->get_ith_rseg(i);
rseg->page_no = trx_rseg_header_create( rseg->page_no = trx_rseg_header_create(
space_id, univ_page_size, ULINT_MAX, rseg->id, &mtr); space_id, ULINT_MAX, rseg->id, &mtr);
rseg_header = trx_rsegf_get_new( rseg_header = trx_rsegf_get_new(space_id, rseg->page_no, &mtr);
space_id, rseg->page_no, rseg->page_size, &mtr);
/* Before re-initialization ensure that we free the existing /* Before re-initialization ensure that we free the existing
structure. There can't be any active transactions. */ structure. There can't be any active transactions. */
......
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