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
8146cb62
Commit
8146cb62
authored
Jan 08, 2014
by
John Esmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes #132 Calculate size delta statistics once during the partial
eviction callback
parent
c623f13e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
+22
-12
ft/ft-ops.cc
ft/ft-ops.cc
+22
-12
No files found.
ft/ft-ops.cc
View file @
8146cb62
...
@@ -1067,6 +1067,8 @@ BASEMENTNODE toku_detach_bn(FTNODE node, int childnum) {
...
@@ -1067,6 +1067,8 @@ BASEMENTNODE toku_detach_bn(FTNODE node, int childnum) {
int
toku_ftnode_pe_callback
(
void
*
ftnode_pv
,
PAIR_ATTR
UU
(
old_attr
),
PAIR_ATTR
*
new_attr
,
void
*
extraargs
)
{
int
toku_ftnode_pe_callback
(
void
*
ftnode_pv
,
PAIR_ATTR
UU
(
old_attr
),
PAIR_ATTR
*
new_attr
,
void
*
extraargs
)
{
FTNODE
node
=
(
FTNODE
)
ftnode_pv
;
FTNODE
node
=
(
FTNODE
)
ftnode_pv
;
FT
ft
=
(
FT
)
extraargs
;
FT
ft
=
(
FT
)
extraargs
;
long
size_before
=
0
;
int
num_partial_evictions
=
0
;
// Don't partially evict dirty nodes
// Don't partially evict dirty nodes
if
(
node
->
dirty
)
{
if
(
node
->
dirty
)
{
goto
exit
;
goto
exit
;
...
@@ -1083,11 +1085,10 @@ int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATTR*
...
@@ -1083,11 +1085,10 @@ int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATTR*
for
(
int
i
=
0
;
i
<
node
->
n_children
;
i
++
)
{
for
(
int
i
=
0
;
i
<
node
->
n_children
;
i
++
)
{
if
(
BP_STATE
(
node
,
i
)
==
PT_AVAIL
)
{
if
(
BP_STATE
(
node
,
i
)
==
PT_AVAIL
)
{
if
(
BP_SHOULD_EVICT
(
node
,
i
))
{
if
(
BP_SHOULD_EVICT
(
node
,
i
))
{
long
size_before
=
ftnode_memory_size
(
node
);
if
(
num_partial_evictions
++
==
0
)
{
size_before
=
ftnode_memory_size
(
node
);
}
compress_internal_node_partition
(
node
,
i
,
ft
->
h
->
compression_method
);
compress_internal_node_partition
(
node
,
i
,
ft
->
h
->
compression_method
);
long
delta
=
size_before
-
ftnode_memory_size
(
node
);
STATUS_INC
(
FT_PARTIAL_EVICTIONS_NONLEAF
,
1
);
STATUS_INC
(
FT_PARTIAL_EVICTIONS_NONLEAF_BYTES
,
delta
);
}
}
else
{
else
{
BP_SWEEP_CLOCK
(
node
,
i
);
BP_SWEEP_CLOCK
(
node
,
i
);
...
@@ -1107,23 +1108,21 @@ int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATTR*
...
@@ -1107,23 +1108,21 @@ int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATTR*
for
(
int
i
=
0
;
i
<
node
->
n_children
;
i
++
)
{
for
(
int
i
=
0
;
i
<
node
->
n_children
;
i
++
)
{
// Get rid of compressed stuff no matter what.
// Get rid of compressed stuff no matter what.
if
(
BP_STATE
(
node
,
i
)
==
PT_COMPRESSED
)
{
if
(
BP_STATE
(
node
,
i
)
==
PT_COMPRESSED
)
{
long
size_before
=
ftnode_memory_size
(
node
);
if
(
num_partial_evictions
++
==
0
)
{
size_before
=
ftnode_memory_size
(
node
);
}
SUB_BLOCK
sb
=
BSB
(
node
,
i
);
SUB_BLOCK
sb
=
BSB
(
node
,
i
);
toku_free
(
sb
->
compressed_ptr
);
toku_free
(
sb
->
compressed_ptr
);
toku_free
(
sb
);
toku_free
(
sb
);
set_BNULL
(
node
,
i
);
set_BNULL
(
node
,
i
);
BP_STATE
(
node
,
i
)
=
PT_ON_DISK
;
BP_STATE
(
node
,
i
)
=
PT_ON_DISK
;
long
delta
=
size_before
-
ftnode_memory_size
(
node
);
STATUS_INC
(
FT_PARTIAL_EVICTIONS_LEAF
,
1
);
STATUS_INC
(
FT_PARTIAL_EVICTIONS_LEAF_BYTES
,
delta
);
}
}
else
if
(
BP_STATE
(
node
,
i
)
==
PT_AVAIL
)
{
else
if
(
BP_STATE
(
node
,
i
)
==
PT_AVAIL
)
{
if
(
BP_SHOULD_EVICT
(
node
,
i
))
{
if
(
BP_SHOULD_EVICT
(
node
,
i
))
{
long
size_before
=
ftnode_memory_size
(
node
);
if
(
num_partial_evictions
++
==
0
)
{
size_before
=
ftnode_memory_size
(
node
);
}
toku_evict_bn_from_memory
(
node
,
i
,
ft
);
toku_evict_bn_from_memory
(
node
,
i
,
ft
);
long
delta
=
size_before
-
ftnode_memory_size
(
node
);
STATUS_INC
(
FT_PARTIAL_EVICTIONS_LEAF
,
1
);
STATUS_INC
(
FT_PARTIAL_EVICTIONS_LEAF_BYTES
,
delta
);
}
}
else
{
else
{
BP_SWEEP_CLOCK
(
node
,
i
);
BP_SWEEP_CLOCK
(
node
,
i
);
...
@@ -1138,6 +1137,17 @@ int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATTR*
...
@@ -1138,6 +1137,17 @@ int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR UU(old_attr), PAIR_ATTR*
}
}
}
}
if
(
num_partial_evictions
>
0
)
{
long
delta
=
size_before
-
ftnode_memory_size
(
node
);
if
(
node
->
height
==
0
)
{
STATUS_INC
(
FT_PARTIAL_EVICTIONS_LEAF
,
num_partial_evictions
);
STATUS_INC
(
FT_PARTIAL_EVICTIONS_LEAF_BYTES
,
delta
);
}
else
{
STATUS_INC
(
FT_PARTIAL_EVICTIONS_NONLEAF
,
num_partial_evictions
);
STATUS_INC
(
FT_PARTIAL_EVICTIONS_NONLEAF_BYTES
,
delta
);
}
}
exit:
exit:
*
new_attr
=
make_ftnode_pair_attr
(
node
);
*
new_attr
=
make_ftnode_pair_attr
(
node
);
return
0
;
return
0
;
...
...
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