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
ae0ecb11
Commit
ae0ecb11
authored
Jan 24, 2007
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: buf_page_t: Add the in_page_hash and in_zip_hash
for extra validation in UNIV_DEBUG builds.
parent
87defea2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
3 deletions
+46
-3
buf/buf0buddy.c
buf/buf0buddy.c
+6
-0
buf/buf0buf.c
buf/buf0buf.c
+20
-0
buf/buf0flu.c
buf/buf0flu.c
+8
-3
buf/buf0lru.c
buf/buf0lru.c
+6
-0
include/buf0buf.h
include/buf0buf.h
+4
-0
include/buf0buf.ic
include/buf0buf.ic
+2
-0
No files found.
buf/buf0buddy.c
View file @
ae0ecb11
...
...
@@ -164,6 +164,9 @@ buf_buddy_block_free(
((
buf_block_t
*
)
bpage
)
->
frame
==
buf
);
ut_a
(
bpage
);
ut_a
(
buf_page_get_state
(
bpage
)
==
BUF_BLOCK_MEMORY
);
ut_ad
(
!
bpage
->
in_page_hash
);
ut_ad
(
bpage
->
in_zip_hash
);
ut_d
(
bpage
->
in_zip_hash
=
FALSE
);
HASH_DELETE
(
buf_page_t
,
hash
,
buf_pool
->
zip_hash
,
fold
,
bpage
);
ut_d
(
memset
(
buf
,
0
,
UNIV_PAGE_SIZE
));
...
...
@@ -192,6 +195,9 @@ buf_buddy_block_register(
ut_a
(
block
->
frame
);
ut_a
(
!
ut_align_offset
(
block
->
frame
,
UNIV_PAGE_SIZE
));
ut_ad
(
!
block
->
page
.
in_page_hash
);
ut_ad
(
!
block
->
page
.
in_zip_hash
);
ut_d
(
block
->
page
.
in_zip_hash
=
TRUE
);
HASH_INSERT
(
buf_page_t
,
hash
,
buf_pool
->
zip_hash
,
fold
,
&
block
->
page
);
}
...
...
buf/buf0buf.c
View file @
ae0ecb11
...
...
@@ -614,6 +614,8 @@ buf_block_init(
block
->
index
=
NULL
;
#ifdef UNIV_DEBUG
block
->
page
.
in_page_hash
=
FALSE
;
block
->
page
.
in_zip_hash
=
FALSE
;
block
->
page
.
in_flush_list
=
FALSE
;
block
->
page
.
in_free_list
=
FALSE
;
block
->
page
.
in_LRU_list
=
FALSE
;
...
...
@@ -973,10 +975,16 @@ buf_relocate(
ut_a
(
buf_page_get_io_fix
(
bpage
)
==
BUF_IO_NONE
);
ut_a
(
bpage
->
buf_fix_count
==
0
);
ut_a
(
buf_page_in_file
(
bpage
));
ut_ad
(
bpage
->
in_LRU_list
);
ut_ad
(
!
bpage
->
in_zip_hash
);
ut_ad
(
bpage
->
in_page_hash
);
ut_ad
(
bpage
==
buf_page_hash_get
(
bpage
->
space
,
bpage
->
offset
));
memcpy
(
dpage
,
bpage
,
sizeof
*
dpage
);
ut_d
(
bpage
->
in_LRU_list
=
FALSE
);
ut_d
(
bpage
->
in_page_hash
=
FALSE
);
/* relocate buf_pool->LRU */
b
=
UT_LIST_GET_PREV
(
LRU
,
bpage
);
UT_LIST_REMOVE
(
LRU
,
buf_pool
->
LRU
,
bpage
);
...
...
@@ -1192,6 +1200,9 @@ buf_pool_page_hash_rebuild(void)
for
(
j
=
0
;
j
<
chunk
->
size
;
j
++
,
block
++
)
{
if
(
buf_block_get_state
(
block
)
==
BUF_BLOCK_FILE_PAGE
)
{
ut_ad
(
!
block
->
page
.
in_zip_hash
);
ut_ad
(
block
->
page
.
in_page_hash
);
HASH_INSERT
(
buf_page_t
,
hash
,
page_hash
,
buf_page_address_fold
(
block
->
page
.
space
,
...
...
@@ -1209,6 +1220,9 @@ buf_pool_page_hash_rebuild(void)
b
=
UT_LIST_GET_NEXT
(
list
,
b
))
{
ut_a
(
buf_page_get_state
(
b
)
==
BUF_BLOCK_ZIP_PAGE
);
ut_ad
(
!
b
->
in_flush_list
);
ut_ad
(
b
->
in_LRU_list
);
ut_ad
(
b
->
in_page_hash
);
ut_ad
(
!
b
->
in_zip_hash
);
HASH_INSERT
(
buf_page_t
,
hash
,
page_hash
,
buf_page_address_fold
(
b
->
space
,
b
->
offset
),
b
);
...
...
@@ -1217,6 +1231,9 @@ buf_pool_page_hash_rebuild(void)
for
(
b
=
UT_LIST_GET_FIRST
(
buf_pool
->
flush_list
);
b
;
b
=
UT_LIST_GET_NEXT
(
list
,
b
))
{
ut_ad
(
b
->
in_flush_list
);
ut_ad
(
b
->
in_LRU_list
);
ut_ad
(
b
->
in_page_hash
);
ut_ad
(
!
b
->
in_zip_hash
);
switch
(
buf_page_get_state
(
b
))
{
case
BUF_BLOCK_ZIP_DIRTY
:
...
...
@@ -2107,6 +2124,9 @@ buf_page_init(
ut_error
;
}
ut_ad
(
!
block
->
page
.
in_zip_hash
);
ut_ad
(
!
block
->
page
.
in_page_hash
);
ut_d
(
block
->
page
.
in_page_hash
=
TRUE
);
HASH_INSERT
(
buf_page_t
,
hash
,
buf_pool
->
page_hash
,
buf_page_address_fold
(
space
,
offset
),
&
block
->
page
);
...
...
buf/buf0flu.c
View file @
ae0ecb11
...
...
@@ -65,6 +65,9 @@ buf_flush_insert_into_flush_list(
/* fall through */
case
BUF_BLOCK_ZIP_DIRTY
:
case
BUF_BLOCK_FILE_PAGE
:
ut_ad
(
bpage
->
in_LRU_list
);
ut_ad
(
bpage
->
in_page_hash
);
ut_ad
(
!
bpage
->
in_zip_hash
);
ut_ad
(
!
bpage
->
in_flush_list
);
ut_d
(
bpage
->
in_flush_list
=
TRUE
);
UT_LIST_ADD_FIRST
(
list
,
buf_pool
->
flush_list
,
bpage
);
...
...
@@ -107,6 +110,11 @@ buf_flush_insert_sorted_into_flush_list(
/* fall through */
case
BUF_BLOCK_ZIP_DIRTY
:
case
BUF_BLOCK_FILE_PAGE
:
ut_ad
(
bpage
->
in_LRU_list
);
ut_ad
(
bpage
->
in_page_hash
);
ut_ad
(
!
bpage
->
in_zip_hash
);
ut_ad
(
!
bpage
->
in_flush_list
);
ut_d
(
bpage
->
in_flush_list
=
TRUE
);
break
;
case
BUF_BLOCK_ZIP_FREE
:
case
BUF_BLOCK_NOT_USED
:
...
...
@@ -126,9 +134,6 @@ buf_flush_insert_sorted_into_flush_list(
b
=
UT_LIST_GET_NEXT
(
list
,
b
);
}
ut_ad
(
!
bpage
->
in_flush_list
);
ut_d
(
bpage
->
in_flush_list
=
TRUE
);
if
(
prev_b
==
NULL
)
{
UT_LIST_ADD_FIRST
(
list
,
buf_pool
->
flush_list
,
bpage
);
}
else
{
...
...
buf/buf0lru.c
View file @
ae0ecb11
...
...
@@ -956,6 +956,9 @@ buf_LRU_free_block(
UNIV_MEM_DESC
(
b
->
zip
.
data
,
page_zip_get_size
(
&
b
->
zip
),
b
);
ut_ad
(
!
b
->
in_zip_hash
);
ut_ad
(
!
b
->
in_page_hash
);
ut_d
(
b
->
in_page_hash
=
TRUE
);
HASH_INSERT
(
buf_page_t
,
hash
,
buf_pool
->
page_hash
,
fold
,
b
);
...
...
@@ -1214,6 +1217,9 @@ buf_LRU_block_remove_hashed_page(
ut_error
;
}
ut_ad
(
!
bpage
->
in_zip_hash
);
ut_ad
(
bpage
->
in_page_hash
);
ut_d
(
bpage
->
in_page_hash
=
FALSE
);
HASH_DELETE
(
buf_page_t
,
hash
,
buf_pool
->
page_hash
,
buf_page_address_fold
(
bpage
->
space
,
bpage
->
offset
),
bpage
);
...
...
include/buf0buf.h
View file @
ae0ecb11
...
...
@@ -968,6 +968,10 @@ struct buf_page_struct{
buf_page_t
*
hash
;
/* node used in chaining to
buf_pool->page_hash or
buf_pool->zip_hash */
#ifdef UNIV_DEBUG
ibool
in_page_hash
;
/* TRUE if in buf_pool->page_hash */
ibool
in_zip_hash
;
/* TRUE if in buf_pool->zip_hash */
#endif
/* UNIV_DEBUG */
/* 2. Page flushing fields; protected by buf_pool->mutex */
...
...
include/buf0buf.ic
View file @
ae0ecb11
...
...
@@ -878,6 +878,8 @@ buf_page_hash_get(
HASH_SEARCH(hash, buf_pool->page_hash, fold, bpage,
bpage->space == space && bpage->offset == offset);
ut_a(!bpage || buf_page_in_file(bpage));
ut_ad(!bpage || bpage->in_page_hash);
ut_ad(!bpage || !bpage->in_zip_hash);
return(bpage);
}
...
...
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