Skip to content

Commit a20340c

Browse files
committed
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.
1 parent 0ef91c8 commit a20340c

File tree

14 files changed

+84
-200
lines changed

14 files changed

+84
-200
lines changed

storage/innobase/include/trx0purge.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,8 @@ struct TrxUndoRsegsIterator {
210210
TrxUndoRsegsIterator();
211211

212212
/** Sets the next rseg to purge in purge_sys.
213-
@return page size of the table for which the log is.
214-
NOTE: if rseg is NULL when this function returns this means that
215-
there are no rollback segments to purge and then the returned page
216-
size object should not be used. */
217-
const page_size_t set_next();
213+
@return whether anything is to be purged */
214+
bool set_next();
218215

219216
private:
220217
// Disable copying

storage/innobase/include/trx0rseg.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,25 @@ Created 3/26/1996 Heikki Tuuri
3535
/** Gets a rollback segment header.
3636
@param[in] space space where placed
3737
@param[in] page_no page number of the header
38-
@param[in] page_size page size
3938
@param[in,out] mtr mini-transaction
4039
@return rollback segment header, page x-latched */
4140
UNIV_INLINE
4241
trx_rsegf_t*
4342
trx_rsegf_get(
4443
ulint space,
4544
ulint page_no,
46-
const page_size_t& page_size,
4745
mtr_t* mtr);
4846

4947
/** Gets a newly created rollback segment header.
5048
@param[in] space space where placed
5149
@param[in] page_no page number of the header
52-
@param[in] page_size page size
5350
@param[in,out] mtr mini-transaction
5451
@return rollback segment header, page x-latched */
5552
UNIV_INLINE
5653
trx_rsegf_t*
5754
trx_rsegf_get_new(
5855
ulint space,
5956
ulint page_no,
60-
const page_size_t& page_size,
6157
mtr_t* mtr);
6258

6359
/***************************************************************//**
@@ -104,15 +100,13 @@ trx_rseg_get_on_id(ulint id)
104100
This function is called only when a new rollback segment is created in
105101
the database.
106102
@param[in] space space id
107-
@param[in] page_size page size
108103
@param[in] max_size max size in pages
109104
@param[in] rseg_slot_no rseg id == slot number in trx sys
110105
@param[in,out] mtr mini-transaction
111106
@return page number of the created segment, FIL_NULL if fail */
112107
ulint
113108
trx_rseg_header_create(
114109
ulint space,
115-
const page_size_t& page_size,
116110
ulint max_size,
117111
ulint rseg_slot_no,
118112
mtr_t* mtr);
@@ -168,9 +162,6 @@ struct trx_rseg_t {
168162
/** page number of the rollback segment header */
169163
ulint page_no;
170164

171-
/** page size of the relevant tablespace */
172-
page_size_t page_size;
173-
174165
/** maximum allowed size in pages */
175166
ulint max_size;
176167

storage/innobase/include/trx0rseg.ic

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ Created 3/26/1996 Heikki Tuuri
3030
/** Gets a rollback segment header.
3131
@param[in] space space where placed
3232
@param[in] page_no page number of the header
33-
@param[in] page_size page size
3433
@param[in,out] mtr mini-transaction
3534
@return rollback segment header, page x-latched */
3635
UNIV_INLINE
3736
trx_rsegf_t*
3837
trx_rsegf_get(
3938
ulint space,
4039
ulint page_no,
41-
const page_size_t& page_size,
4240
mtr_t* mtr)
4341
{
4442
buf_block_t* block;
4543
trx_rsegf_t* header;
4644

45+
ut_ad(space <= srv_undo_tablespaces || space == SRV_TMP_SPACE_ID);
46+
4747
block = buf_page_get(
48-
page_id_t(space, page_no), page_size, RW_X_LATCH, mtr);
48+
page_id_t(space, page_no), univ_page_size, RW_X_LATCH, mtr);
4949

5050
buf_block_dbg_add_level(block, SYNC_RSEG_HEADER);
5151

@@ -57,22 +57,22 @@ trx_rsegf_get(
5757
/** Gets a newly created rollback segment header.
5858
@param[in] space space where placed
5959
@param[in] page_no page number of the header
60-
@param[in] page_size page size
6160
@param[in,out] mtr mini-transaction
6261
@return rollback segment header, page x-latched */
6362
UNIV_INLINE
6463
trx_rsegf_t*
6564
trx_rsegf_get_new(
6665
ulint space,
6766
ulint page_no,
68-
const page_size_t& page_size,
6967
mtr_t* mtr)
7068
{
7169
buf_block_t* block;
7270
trx_rsegf_t* header;
7371

72+
ut_ad(space <= srv_undo_tablespaces || space == SRV_TMP_SPACE_ID);
73+
7474
block = buf_page_get(
75-
page_id_t(space, page_no), page_size, RW_X_LATCH, mtr);
75+
page_id_t(space, page_no), univ_page_size, RW_X_LATCH, mtr);
7676

7777
buf_block_dbg_add_level(block, SYNC_RSEG_HEADER_NEW);
7878

storage/innobase/include/trx0undo.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
4+
Copyright (c) 2017, MariaDB Corporation.
45
56
This program is free software; you can redistribute it and/or modify it under
67
the terms of the GNU General Public License as published by the Free Software
@@ -98,27 +99,19 @@ trx_read_roll_ptr(
9899

99100
/** Gets an undo log page and x-latches it.
100101
@param[in] page_id page id
101-
@param[in] page_size page size
102102
@param[in,out] mtr mini-transaction
103103
@return pointer to page x-latched */
104104
UNIV_INLINE
105105
page_t*
106-
trx_undo_page_get(
107-
const page_id_t& page_id,
108-
const page_size_t& page_size,
109-
mtr_t* mtr);
106+
trx_undo_page_get(const page_id_t& page_id, mtr_t* mtr);
110107

111108
/** Gets an undo log page and s-latches it.
112109
@param[in] page_id page id
113-
@param[in] page_size page size
114110
@param[in,out] mtr mini-transaction
115111
@return pointer to page s-latched */
116112
UNIV_INLINE
117113
page_t*
118-
trx_undo_page_get_s_latched(
119-
const page_id_t& page_id,
120-
const page_size_t& page_size,
121-
mtr_t* mtr);
114+
trx_undo_page_get_s_latched(const page_id_t& page_id, mtr_t* mtr);
122115

123116
/******************************************************************//**
124117
Returns the previous undo record on the page in the specified log, or
@@ -188,7 +181,6 @@ trx_undo_get_next_rec(
188181

189182
/** Gets the first record in an undo log.
190183
@param[in] space undo log header space
191-
@param[in] page_size page size
192184
@param[in] page_no undo log header page number
193185
@param[in] offset undo log header offset on page
194186
@param[in] mode latching mode: RW_S_LATCH or RW_X_LATCH
@@ -197,7 +189,6 @@ trx_undo_get_next_rec(
197189
trx_undo_rec_t*
198190
trx_undo_get_first_rec(
199191
ulint space,
200-
const page_size_t& page_size,
201192
ulint page_no,
202193
ulint offset,
203194
ulint mode,
@@ -455,7 +446,6 @@ struct trx_undo_t {
455446
/*-----------------------------*/
456447
ulint space; /*!< space id where the undo log
457448
placed */
458-
page_size_t page_size;
459449
ulint hdr_page_no; /*!< page number of the header page in
460450
the undo log */
461451
ulint hdr_offset; /*!< header offset of the undo log on

storage/innobase/include/trx0undo.ic

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*****************************************************************************
22

33
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All Rights Reserved.
4+
Copyright (c) 2017, MariaDB Corporation.
45

56
This program is free software; you can redistribute it and/or modify it under
67
the terms of the GNU General Public License as published by the Free Software
@@ -153,17 +154,13 @@ trx_read_roll_ptr(
153154

154155
/** Gets an undo log page and x-latches it.
155156
@param[in] page_id page id
156-
@param[in] page_size page size
157157
@param[in,out] mtr mini-transaction
158158
@return pointer to page x-latched */
159159
UNIV_INLINE
160160
page_t*
161-
trx_undo_page_get(
162-
const page_id_t& page_id,
163-
const page_size_t& page_size,
164-
mtr_t* mtr)
161+
trx_undo_page_get(const page_id_t& page_id, mtr_t* mtr)
165162
{
166-
buf_block_t* block = buf_page_get(page_id, page_size,
163+
buf_block_t* block = buf_page_get(page_id, univ_page_size,
167164
RW_X_LATCH, mtr);
168165

169166
buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
@@ -173,17 +170,13 @@ trx_undo_page_get(
173170

174171
/** Gets an undo log page and s-latches it.
175172
@param[in] page_id page id
176-
@param[in] page_size page size
177173
@param[in,out] mtr mini-transaction
178174
@return pointer to page s-latched */
179175
UNIV_INLINE
180176
page_t*
181-
trx_undo_page_get_s_latched(
182-
const page_id_t& page_id,
183-
const page_size_t& page_size,
184-
mtr_t* mtr)
177+
trx_undo_page_get_s_latched(const page_id_t& page_id, mtr_t* mtr)
185178
{
186-
buf_block_t* block = buf_page_get(page_id, page_size,
179+
buf_block_t* block = buf_page_get(page_id, univ_page_size,
187180
RW_S_LATCH, mtr);
188181

189182
buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);

storage/innobase/include/ut0stage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*****************************************************************************
22
33
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All Rights Reserved.
4+
Copyright (c) 2017, MariaDB Corporation.
45
56
This program is free software; you can redistribute it and/or modify it under
67
the terms of the GNU General Public License as published by the Free Software

storage/innobase/srv/srv0start.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,8 +1047,7 @@ srv_undo_tablespaces_init(
10471047

10481048
if (space_id == *it) {
10491049
trx_rseg_header_create(
1050-
*it, univ_page_size, ULINT_MAX,
1051-
i, &mtr);
1050+
*it, ULINT_MAX, i, &mtr);
10521051
}
10531052
}
10541053

0 commit comments

Comments
 (0)