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
1abce35d
Commit
1abce35d
authored
Jun 23, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FT-93 Fix a bug with aligned pivotkeys where we may overestimate how
much space is needed on disk
parent
71b54a74
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
ft/ft-ops.cc
ft/ft-ops.cc
+1
-1
ft/pivotkeys.cc
ft/pivotkeys.cc
+7
-1
No files found.
ft/ft-ops.cc
View file @
1abce35d
...
...
@@ -540,7 +540,7 @@ ftnode_memory_size (FTNODE node)
int
n_children
=
node
->
n_children
;
retval
+=
sizeof
(
*
node
);
retval
+=
(
n_children
)
*
(
sizeof
(
node
->
bp
[
0
]));
retval
+=
node
->
pivotkeys
.
total
_size
();
retval
+=
node
->
pivotkeys
.
serialized
_size
();
// now calculate the sizes of the partitions
for
(
int
i
=
0
;
i
<
n_children
;
i
++
)
{
...
...
ft/pivotkeys.cc
View file @
1abce35d
...
...
@@ -436,7 +436,7 @@ void ftnode_pivot_keys::serialize_to_wbuf(struct wbuf *wb) const {
wbuf_nocrc_bytes
(
wb
,
fixed
?
_fixed_key
(
i
)
:
_dbt_keys
[
i
].
data
,
size
);
written
+=
size
;
}
invariant
(
written
==
_total_size
);
invariant
(
written
==
serialized_size
()
);
}
int
ftnode_pivot_keys
::
num_pivots
()
const
{
...
...
@@ -450,3 +450,9 @@ size_t ftnode_pivot_keys::total_size() const {
paranoid_invariant
(
_fixed_keys
==
nullptr
||
(
_total_size
==
_fixed_keylen_aligned
*
_num_pivots
));
return
_total_size
;
}
size_t
ftnode_pivot_keys
::
serialized_size
()
const
{
// we only return the size that will be used when serialized, so we calculate based
// on the fixed keylen and not the aligned keylen.
return
_fixed_format
()
?
_num_pivots
*
_fixed_keylen
:
_total_size
;
}
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