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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5520ddfb
Commit
5520ddfb
authored
Feb 08, 2008
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
ma_pagecache.c:
SCCS merged storage/maria/ma_pagecache.c: SCCS merged
parents
01336db3
c5abb8f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
storage/maria/ha_maria.cc
storage/maria/ha_maria.cc
+1
-1
storage/maria/ma_pagecache.c
storage/maria/ma_pagecache.c
+20
-8
No files found.
storage/maria/ha_maria.cc
View file @
5520ddfb
...
...
@@ -1498,7 +1498,7 @@ int ha_maria::preload_keys(THD * thd, HA_CHECK_OPT *check_opt)
maria_extra
(
file
,
HA_EXTRA_PRELOAD_BUFFER_SIZE
,
(
void
*
)
&
thd
->
variables
.
preload_buff_size
);
#if
n
def NOT_YET
#ifdef NOT_YET
if
((
error
=
maria_preload
(
file
,
map
,
ignore_leaves
)))
{
switch
(
error
)
{
...
...
storage/maria/ma_pagecache.c
View file @
5520ddfb
...
...
@@ -3004,14 +3004,6 @@ restart:
test
((
pin
==
PAGECACHE_PIN_LEFT_UNPINNED
)
||
(
pin
==
PAGECACHE_PIN
)),
&
page_st
);
DBUG_ASSERT
(
block
->
type
==
PAGECACHE_EMPTY_PAGE
||
block
->
type
==
type
||
type
==
PAGECACHE_LSN_PAGE
||
type
==
PAGECACHE_READ_UNKNOWN_PAGE
||
block
->
type
==
PAGECACHE_READ_UNKNOWN_PAGE
);
if
(
type
!=
PAGECACHE_READ_UNKNOWN_PAGE
||
block
->
type
==
PAGECACHE_EMPTY_PAGE
)
block
->
type
=
type
;
if
(((
block
->
status
&
PCBLOCK_ERROR
)
==
0
)
&&
(
page_st
!=
PAGE_READ
))
{
DBUG_PRINT
(
"info"
,
(
"read block 0x%lx"
,
(
ulong
)
block
));
...
...
@@ -3020,6 +3012,26 @@ restart:
(
my_bool
)(
page_st
==
PAGE_TO_BE_READ
));
DBUG_PRINT
(
"info"
,
(
"read is done"
));
}
/*
Assert after block is read. Imagine two concurrent SELECTs on same
table (thread1 and 2), which want to pagecache_read() the same
pageno/fileno. Thread1 calls find_block(), decides to evict a dirty
page from LRU; while it's writing this dirty page to disk, it is
pre-empted and thread2 runs its find_block(), gets the block (in
PAGE_TO_BE_READ state). This block is still containing the in-eviction
dirty page so has an its type, which cannot be tested.
So thread2 has to wait for read_block() to finish (when it wakes up in
read_block(), it's woken up by read_block() of thread1, which implies
that block's type was set to EMPTY by thread1 as part of find_block()).
*/
DBUG_ASSERT
(
block
->
type
==
PAGECACHE_EMPTY_PAGE
||
block
->
type
==
type
||
type
==
PAGECACHE_LSN_PAGE
||
type
==
PAGECACHE_READ_UNKNOWN_PAGE
||
block
->
type
==
PAGECACHE_READ_UNKNOWN_PAGE
);
if
(
type
!=
PAGECACHE_READ_UNKNOWN_PAGE
||
block
->
type
==
PAGECACHE_EMPTY_PAGE
)
block
->
type
=
type
;
if
(
make_lock_and_pin
(
pagecache
,
block
,
lock
,
pin
))
{
...
...
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