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
5dbe7a8c
Commit
5dbe7a8c
authored
Nov 15, 2023
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.5 into 10.6
parents
52ca2e65
a0f02f74
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
32 deletions
+67
-32
storage/innobase/fsp/fsp0fsp.cc
storage/innobase/fsp/fsp0fsp.cc
+62
-21
storage/innobase/trx/trx0purge.cc
storage/innobase/trx/trx0purge.cc
+5
-11
No files found.
storage/innobase/fsp/fsp0fsp.cc
View file @
5dbe7a8c
...
...
@@ -1034,35 +1034,76 @@ static
buf_block_t
*
fsp_page_create
(
fil_space_t
*
space
,
page_no_t
offset
,
mtr_t
*
mtr
)
{
buf_block_t
*
block
,
*
free_block
;
buf_block_t
*
block
;
if
(
UNIV_UNLIKELY
(
space
->
is_being_truncated
))
{
const
page_id_t
page_id
{
space
->
id
,
offset
};
buf_pool_t
::
hash_chain
&
chain
=
buf_pool
.
page_hash
.
cell_get
(
page_id
.
fold
());
mysql_mutex_lock
(
&
buf_pool
.
mutex
);
block
=
reinterpret_cast
<
buf_block_t
*>
(
buf_pool
.
page_hash
.
get
(
page_id
,
chain
));
if
(
block
&&
block
->
page
.
oldest_modification
()
<=
1
)
block
=
nullptr
;
mysql_mutex_unlock
(
&
buf_pool
.
mutex
);
uint32_t
state
;
block
=
mtr
->
get_already_latched
(
page_id
,
MTR_MEMO_PAGE_X_FIX
);
if
(
block
)
goto
have_latch
;
else
{
ut_ad
(
block
->
page
.
buf_fix_count
()
>=
1
);
ut_ad
(
block
->
page
.
lock
.
x_lock_count
()
==
1
);
ut_ad
(
mtr
->
have_x_latch
(
*
block
));
free_block
=
block
;
goto
got_free_block
;
buf_pool_t
::
hash_chain
&
chain
=
buf_pool
.
page_hash
.
cell_get
(
page_id
.
fold
());
mysql_mutex_lock
(
&
buf_pool
.
mutex
);
block
=
reinterpret_cast
<
buf_block_t
*>
(
buf_pool
.
page_hash
.
get
(
page_id
,
chain
));
if
(
!
block
)
{
mysql_mutex_unlock
(
&
buf_pool
.
mutex
);
goto
create
;
}
}
if
(
!
mtr
->
have_x_latch
(
*
block
))
{
const
bool
got
{
block
->
page
.
lock
.
x_lock_try
()};
mysql_mutex_unlock
(
&
buf_pool
.
mutex
);
if
(
!
got
)
{
block
->
page
.
lock
.
x_lock
();
const
page_id_t
id
{
block
->
page
.
id
()};
if
(
UNIV_UNLIKELY
(
id
!=
page_id
))
{
ut_ad
(
id
.
is_corrupted
());
block
->
page
.
lock
.
x_unlock
();
goto
create
;
}
}
state
=
block
->
page
.
fix
()
+
1
;
mtr
->
memo_push
(
block
,
MTR_MEMO_PAGE_X_FIX
);
}
else
{
mysql_mutex_unlock
(
&
buf_pool
.
mutex
);
have_latch:
state
=
block
->
page
.
state
();
}
}
free_block
=
buf_LRU_get_free_block
(
false
);
got_free_block:
block
=
buf_page_create
(
space
,
static_cast
<
uint32_t
>
(
offset
),
space
->
zip_size
(),
mtr
,
free_block
);
if
(
UNIV_UNLIKELY
(
block
!=
free_block
))
buf_pool
.
free_block
(
free_block
);
ut_ad
(
state
>
buf_page_t
::
FREED
);
ut_ad
(
state
<
buf_page_t
::
READ_FIX
);
ut_ad
((
state
&
buf_page_t
::
LRU_MASK
)
!=
buf_page_t
::
IBUF_EXIST
);
ut_ad
(
block
->
page
.
lock
.
x_lock_count
()
==
1
);
ut_ad
(
block
->
page
.
frame
);
#ifdef BTR_CUR_HASH_ADAPT
ut_ad
(
!
block
->
index
);
#endif
block
->
page
.
set_reinit
(
state
<
buf_page_t
::
UNFIXED
?
buf_page_t
::
FREED
:
(
state
&
buf_page_t
::
LRU_MASK
));
}
else
{
create:
buf_block_t
*
free_block
=
buf_LRU_get_free_block
(
false
);
block
=
buf_page_create
(
space
,
static_cast
<
uint32_t
>
(
offset
),
space
->
zip_size
(),
mtr
,
free_block
);
if
(
UNIV_UNLIKELY
(
block
!=
free_block
))
buf_pool
.
free_block
(
free_block
);
}
fsp_init_file_page
(
space
,
block
,
mtr
);
return
block
;
...
...
storage/innobase/trx/trx0purge.cc
View file @
5dbe7a8c
...
...
@@ -677,8 +677,8 @@ TRANSACTIONAL_TARGET void trx_purge_truncate_history()
mini-transaction commit and the server was killed, then
discarding the to-be-trimmed pages without flushing would
break crash recovery. */
rescan:
mysql_mutex_lock
(
&
buf_pool
.
flush_list_mutex
);
rescan:
for
(
buf_page_t
*
bpage
=
UT_LIST_GET_LAST
(
buf_pool
.
flush_list
);
bpage
;
)
{
ut_ad
(
bpage
->
oldest_modification
());
...
...
@@ -707,26 +707,20 @@ TRANSACTIONAL_TARGET void trx_purge_truncate_history()
ut_ad
(
!
bpage
->
is_io_fixed
());
ut_ad
(
bpage
->
id
().
space
()
==
space_id
);
if
(
bpage
->
oldest_modification
()
>
2
)
{
if
(
bpage
->
oldest_modification
()
>
2
&&
!
mtr
.
have_x_latch
(
*
reinterpret_cast
<
buf_block_t
*>
(
bpage
)))
mtr
.
memo_push
(
reinterpret_cast
<
buf_block_t
*>
(
bpage
),
MTR_MEMO_PAGE_X_FIX
);
mysql_mutex_lock
(
&
buf_pool
.
flush_list_mutex
);
ut_ad
(
bpage
->
oldest_modification
()
>
2
);
bpage
->
reset_oldest_modification
();
}
else
{
bpage
->
unfix
();
bpage
->
lock
.
x_unlock
();
mysql_mutex_lock
(
&
buf_pool
.
flush_list_mutex
);
}
mysql_mutex_lock
(
&
buf_pool
.
flush_list_mutex
);
if
(
prev
!=
buf_pool
.
flush_hp
.
get
())
{
mysql_mutex_unlock
(
&
buf_pool
.
flush_list_mutex
);
goto
rescan
;
}
}
bpage
=
prev
;
...
...
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