Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7fa5cce3
Commit
7fa5cce3
authored
Jan 19, 2023
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-30289: Remove the pointer indirection for mtr_t::m_memo
parent
a01abad6
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
108 deletions
+81
-108
storage/innobase/include/mtr0mtr.h
storage/innobase/include/mtr0mtr.h
+14
-14
storage/innobase/mtr/mtr0mtr.cc
storage/innobase/mtr/mtr0mtr.cc
+67
-94
No files found.
storage/innobase/include/mtr0mtr.h
View file @
7fa5cce3
...
...
@@ -77,6 +77,9 @@ struct mtr_memo_slot_t
/** Mini-transaction handle and buffer */
struct
mtr_t
{
mtr_t
();
~
mtr_t
();
/** Start a mini-transaction. */
void
start
();
...
...
@@ -91,11 +94,11 @@ struct mtr_t {
/** Release latches of unmodified buffer pages.
@param begin first slot to release */
void
rollback_to_savepoint
(
ulint
begin
)
{
rollback_to_savepoint
(
begin
,
m_memo
->
size
());
}
{
rollback_to_savepoint
(
begin
,
m_memo
.
size
());
}
/** Release the last acquired buffer page latch. */
void
release_last_page
()
{
auto
s
=
m_memo
->
size
();
rollback_to_savepoint
(
s
-
1
,
s
);
}
{
auto
s
=
m_memo
.
size
();
rollback_to_savepoint
(
s
-
1
,
s
);
}
/** Commit a mini-transaction that is shrinking a tablespace.
@param space tablespace that is being shrunk */
...
...
@@ -119,7 +122,7 @@ struct mtr_t {
ulint
get_savepoint
()
const
{
ut_ad
(
is_active
());
return
m_memo
?
m_memo
->
size
()
:
0
;
return
m_memo
.
size
()
;
}
/** Release the (index tree) s-latch stored in an mtr memo after a savepoint.
...
...
@@ -128,7 +131,7 @@ struct mtr_t {
void
release_s_latch_at_savepoint
(
ulint
savepoint
,
index_lock
*
lock
)
{
ut_ad
(
is_active
());
mtr_memo_slot_t
&
slot
=
m_memo
->
at
(
savepoint
)
;
mtr_memo_slot_t
&
slot
=
m_memo
[
savepoint
]
;
ut_ad
(
slot
.
object
==
lock
);
ut_ad
(
slot
.
type
==
MTR_MEMO_S_LOCK
);
slot
.
object
=
nullptr
;
...
...
@@ -138,7 +141,7 @@ struct mtr_t {
void
release_block_at_savepoint
(
ulint
savepoint
,
buf_block_t
*
block
)
{
ut_ad
(
is_active
());
mtr_memo_slot_t
&
slot
=
m_memo
->
at
(
savepoint
)
;
mtr_memo_slot_t
&
slot
=
m_memo
[
savepoint
]
;
ut_ad
(
slot
.
object
==
block
);
ut_ad
(
!
(
slot
.
type
&
MTR_MEMO_MODIFY
));
slot
.
object
=
nullptr
;
...
...
@@ -172,7 +175,7 @@ struct mtr_t {
ut_ad
(
is_active
());
ut_ad
(
!
memo_contains_flagged
(
block
,
MTR_MEMO_PAGE_S_FIX
|
MTR_MEMO_PAGE_X_FIX
|
MTR_MEMO_PAGE_SX_FIX
));
mtr_memo_slot_t
&
slot
=
m_memo
->
at
(
savepoint
)
;
mtr_memo_slot_t
&
slot
=
m_memo
[
savepoint
]
;
ut_ad
(
slot
.
object
==
block
);
ut_ad
(
slot
.
type
==
MTR_MEMO_BUF_FIX
);
slot
.
type
=
MTR_MEMO_PAGE_X_FIX
;
...
...
@@ -189,7 +192,7 @@ struct mtr_t {
ut_ad
(
is_active
());
ut_ad
(
!
memo_contains_flagged
(
block
,
MTR_MEMO_PAGE_S_FIX
|
MTR_MEMO_PAGE_X_FIX
|
MTR_MEMO_PAGE_SX_FIX
));
mtr_memo_slot_t
&
slot
=
m_memo
->
at
(
savepoint
)
;
mtr_memo_slot_t
&
slot
=
m_memo
[
savepoint
]
;
ut_ad
(
slot
.
object
==
block
);
ut_ad
(
slot
.
type
==
MTR_MEMO_BUF_FIX
);
slot
.
type
=
MTR_MEMO_PAGE_SX_FIX
;
...
...
@@ -409,7 +412,7 @@ struct mtr_t {
@param latch latch type */
void
u_lock_register
(
ulint
savepoint
)
{
mtr_memo_slot_t
&
slot
=
m_memo
->
at
(
savepoint
)
;
mtr_memo_slot_t
&
slot
=
m_memo
[
savepoint
]
;
ut_ad
(
slot
.
type
==
MTR_MEMO_BUF_FIX
);
slot
.
type
=
MTR_MEMO_PAGE_SX_FIX
;
}
...
...
@@ -418,7 +421,7 @@ struct mtr_t {
@param latch latch type */
void
s_lock_register
(
ulint
savepoint
)
{
mtr_memo_slot_t
&
slot
=
m_memo
->
at
(
savepoint
)
;
mtr_memo_slot_t
&
slot
=
m_memo
[
savepoint
]
;
ut_ad
(
slot
.
type
==
MTR_MEMO_BUF_FIX
);
slot
.
type
=
MTR_MEMO_PAGE_S_FIX
;
}
...
...
@@ -477,10 +480,7 @@ struct mtr_t {
m_made_dirty
=
is_block_dirtied
(
*
static_cast
<
const
buf_page_t
*>
(
object
));
if
(
!
m_memo
)
m_memo
=
new
std
::
vector
<
mtr_memo_slot_t
>
(
1
,
{
object
,
type
});
else
m_memo
->
emplace_back
(
mtr_memo_slot_t
{
object
,
type
});
m_memo
.
emplace_back
(
mtr_memo_slot_t
{
object
,
type
});
}
/** @return the size of the log is empty */
...
...
@@ -790,7 +790,7 @@ struct mtr_t {
#endif
/* UNIV_DEBUG */
/** acquired dict_index_t::lock, fil_space_t::latch, buf_block_t */
std
::
vector
<
mtr_memo_slot_t
>
*
m_memo
=
nullptr
;
std
::
vector
<
mtr_memo_slot_t
>
m_memo
;
/** mini-transaction log */
mtr_buf_t
m_log
;
...
...
storage/innobase/mtr/mtr0mtr.cc
View file @
7fa5cce3
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment