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
a62c5b14
Commit
a62c5b14
authored
Jul 22, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FT-304 Fix an oops in the blocktable, first exposed in a MySQl test and
now by src/tests/stress_test7.cc
parent
94355a23
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
ft/serialize/block_allocator.cc
ft/serialize/block_allocator.cc
+9
-10
ft/serialize/block_table.cc
ft/serialize/block_table.cc
+2
-2
No files found.
ft/serialize/block_allocator.cc
View file @
a62c5b14
...
...
@@ -100,7 +100,7 @@ PATENT RIGHTS GRANT:
#include "ft/serialize/block_allocator.h"
#include "ft/serialize/block_allocator_strategy.h"
#if
0
#if
TOKU_DEBUG_PARANOID
#define VALIDATE() validate()
#else
#define VALIDATE()
...
...
@@ -180,19 +180,18 @@ void block_allocator::create_from_blockpairs(uint64_t reserve_at_beginning, uint
struct
blockpair
*
pairs
,
uint64_t
n_blocks
)
{
_create_internal
(
reserve_at_beginning
,
alignment
);
for
(
uint64_t
i
=
0
;
i
<
_n_blocks
;
i
++
)
{
// Allocator does not support size 0 blocks. See block_allocator_free_block.
invariant
(
pairs
[
i
].
size
>
0
);
invariant
(
pairs
[
i
].
offset
>=
_reserve_at_beginning
);
invariant
(
pairs
[
i
].
offset
%
_alignment
==
0
);
_n_bytes_in_use
+=
pairs
[
i
].
size
;
}
_n_blocks
=
n_blocks
;
grow_blocks_array_by
(
_n_blocks
);
memcpy
(
_blocks_array
,
pairs
,
_n_blocks
*
sizeof
(
struct
blockpair
));
qsort
(
_blocks_array
,
_n_blocks
,
sizeof
(
struct
blockpair
),
compare_blockpairs
);
for
(
uint64_t
i
=
0
;
i
<
_n_blocks
;
i
++
)
{
// Allocator does not support size 0 blocks. See block_allocator_free_block.
invariant
(
_blocks_array
[
i
].
size
>
0
);
invariant
(
_blocks_array
[
i
].
offset
>=
_reserve_at_beginning
);
invariant
(
_blocks_array
[
i
].
offset
%
_alignment
==
0
);
_n_bytes_in_use
+=
_blocks_array
[
i
].
size
;
}
VALIDATE
();
}
...
...
ft/serialize/block_table.cc
View file @
a62c5b14
...
...
@@ -959,7 +959,7 @@ void block_table::get_fragmentation_unlocked(TOKU_DB_FRAGMENTATION report) {
struct
translation
*
checkpointed
=
&
_checkpointed
;
for
(
int64_t
i
=
0
;
i
<
checkpointed
->
length_of_array
;
i
++
)
{
struct
block_translation_pair
*
pair
=
&
_checkpointed
.
block_translation
[
i
];
struct
block_translation_pair
*
pair
=
&
checkpointed
->
block_translation
[
i
];
if
(
pair
->
size
>
0
&&
!
(
i
<
current
->
length_of_array
&&
current
->
block_translation
[
i
].
size
>
0
&&
current
->
block_translation
[
i
].
u
.
diskoff
==
pair
->
u
.
diskoff
))
{
...
...
@@ -970,7 +970,7 @@ void block_table::get_fragmentation_unlocked(TOKU_DB_FRAGMENTATION report) {
struct
translation
*
inprogress
=
&
_inprogress
;
for
(
int64_t
i
=
0
;
i
<
inprogress
->
length_of_array
;
i
++
)
{
struct
block_translation_pair
*
pair
=
&
_inprogress
.
block_translation
[
i
];
struct
block_translation_pair
*
pair
=
&
inprogress
->
block_translation
[
i
];
if
(
pair
->
size
>
0
&&
!
(
i
<
current
->
length_of_array
&&
current
->
block_translation
[
i
].
size
>
0
&&
current
->
block_translation
[
i
].
u
.
diskoff
==
pair
->
u
.
diskoff
)
&&
...
...
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