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
8e99a4d7
Commit
8e99a4d7
authored
Jan 12, 2014
by
Yoni Fogel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refs Tokutek/ft-index#46 Finish verify (find purpose). Restore old verify_in_mempool functionality
parent
3b923630
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
3 deletions
+32
-3
ft/bndata.cc
ft/bndata.cc
+25
-2
util/dmt.cc
util/dmt.cc
+0
-1
util/mempool.cc
util/mempool.cc
+4
-0
util/mempool.h
util/mempool.h
+3
-0
No files found.
ft/bndata.cc
View file @
8e99a4d7
...
...
@@ -530,9 +530,32 @@ uint64_t bn_data::get_disk_size() {
toku_mempool_get_used_space
(
&
m_buffer_mempool
);
}
struct
verify_le_in_mempool_state
{
size_t
offset_limit
;
class
bn_data
*
bd
;
};
static
int
verify_le_in_mempool
(
const
uint32_t
,
klpair_struct
*
klpair
,
const
uint32_t
idx
UU
(),
struct
verify_le_in_mempool_state
*
const
state
)
{
invariant
(
klpair
->
le_offset
<
state
->
offset_limit
);
LEAFENTRY
le
=
state
->
bd
->
get_le_from_klpair
(
klpair
);
uint32_t
size
=
leafentry_memsize
(
le
);
size_t
end_offset
=
klpair
->
le_offset
+
size
;
invariant
(
end_offset
<=
state
->
offset_limit
);
return
0
;
}
//This is a debug-only (paranoid) verification.
//Verifies the omt is valid, and all leafentries are entirely in the mempool's memory.
void
bn_data
::
verify_mempool
(
void
)
{
// TODO: implement something
// TODO: check 7.0 code and see if there was anything there?
//Verify the omt itself <- paranoid and slow
m_buffer
.
verify
();
verify_le_in_mempool_state
state
=
{
.
offset_limit
=
toku_mempool_get_offset_limit
(
&
m_buffer_mempool
),
.
bd
=
this
};
//Verify every leafentry pointed to by the keys in the dmt are fully inside the mempool
m_buffer
.
iterate_ptr
<
decltype
(
state
),
verify_le_in_mempool
>
(
&
state
);
}
uint32_t
bn_data
::
omt_size
(
void
)
const
{
...
...
util/dmt.cc
View file @
8e99a4d7
...
...
@@ -430,7 +430,6 @@ int dmt<dmtdata_t, dmtdataout_t>::iterate_on_range(const uint32_t left, const ui
return
this
->
iterate_internal
<
iterate_extra_t
,
f
>
(
left
,
right
,
this
->
d
.
t
.
root
,
0
,
iterate_extra
);
}
//TODO(yoni) determine where this is used and if it should crash or return an error on bad verify
template
<
typename
dmtdata_t
,
typename
dmtdataout_t
>
void
dmt
<
dmtdata_t
,
dmtdataout_t
>::
verify
(
void
)
const
{
uint32_t
num_values
=
this
->
size
();
...
...
util/mempool.cc
View file @
8e99a4d7
...
...
@@ -194,6 +194,10 @@ void* toku_mempool_get_next_free_ptr(const struct mempool *mp) {
return
toku_mempool_get_pointer_from_base_and_offset
(
mp
,
mp
->
free_offset
);
}
size_t
toku_mempool_get_offset_limit
(
const
struct
mempool
*
mp
)
{
return
mp
->
free_offset
;
}
size_t
toku_mempool_get_free_space
(
const
struct
mempool
*
mp
)
{
return
mp
->
size
-
mp
->
free_offset
;
}
...
...
util/mempool.h
View file @
8e99a4d7
...
...
@@ -146,6 +146,9 @@ size_t toku_mempool_get_offset_from_pointer_and_base(const struct mempool *mp, c
/* get the a pointer of the first free byte (if any) */
void
*
toku_mempool_get_next_free_ptr
(
const
struct
mempool
*
mp
);
/* get the limit of valid offsets. (anything later was not allocated) */
size_t
toku_mempool_get_offset_limit
(
const
struct
mempool
*
mp
);
/* get the size of the memory pool */
size_t
toku_mempool_get_size
(
const
struct
mempool
*
mp
);
...
...
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