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
3bdf1bbd
Commit
3bdf1bbd
authored
Jul 02, 2014
by
Zardosht Kasheff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FT-287, have engine status report the amount of cloned data in the cachetable
parent
47f57224
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
4 deletions
+27
-4
ft/cachetable-internal.h
ft/cachetable-internal.h
+5
-2
ft/cachetable.cc
ft/cachetable.cc
+21
-2
ft/cachetable.h
ft/cachetable.h
+1
-0
No files found.
ft/cachetable-internal.h
View file @
3bdf1bbd
...
...
@@ -516,8 +516,8 @@ class evictor {
void
add_pair_attr
(
PAIR_ATTR
attr
);
void
remove_pair_attr
(
PAIR_ATTR
attr
);
void
change_pair_attr
(
PAIR_ATTR
old_attr
,
PAIR_ATTR
new_attr
);
void
add_
to_size_current
(
long
size
);
void
remove_
from_size_current
(
long
size
);
void
add_
cloned_data_size
(
long
size
);
void
remove_
cloned_data_size
(
long
size
);
uint64_t
reserve_memory
(
double
fraction
,
uint64_t
upper_bound
);
void
release_reserved_memory
(
uint64_t
reserved_memory
);
void
run_eviction_thread
();
...
...
@@ -531,6 +531,8 @@ class evictor {
void
get_state
(
long
*
size_current_ptr
,
long
*
size_limit_ptr
);
void
fill_engine_status
();
private:
void
add_to_size_current
(
long
size
);
void
remove_from_size_current
(
long
size
);
void
run_eviction
();
bool
run_eviction_on_pair
(
PAIR
p
);
void
try_evict_pair
(
PAIR
p
);
...
...
@@ -546,6 +548,7 @@ class evictor {
pair_list
*
m_pl
;
cachefile_list
*
m_cf_list
;
int64_t
m_size_current
;
// the sum of the sizes of the pairs in the cachetable
int64_t
m_size_cloned_data
;
// stores amount of cloned data we have, only used for engine status
// changes to these two values are protected
// by ev_thread_lock
int64_t
m_size_reserved
;
// How much memory is reserved (e.g., by the loader)
...
...
ft/cachetable.cc
View file @
3bdf1bbd
...
...
@@ -144,6 +144,7 @@ status_init(void) {
STATUS_INIT
(
CT_SIZE_LEAF
,
CACHETABLE_SIZE_LEAF
,
UINT64
,
"size leaf"
,
TOKU_ENGINE_STATUS
|
TOKU_GLOBAL_STATUS
);
STATUS_INIT
(
CT_SIZE_ROLLBACK
,
CACHETABLE_SIZE_ROLLBACK
,
UINT64
,
"size rollback"
,
TOKU_ENGINE_STATUS
|
TOKU_GLOBAL_STATUS
);
STATUS_INIT
(
CT_SIZE_CACHEPRESSURE
,
CACHETABLE_SIZE_CACHEPRESSURE
,
UINT64
,
"size cachepressure"
,
TOKU_ENGINE_STATUS
|
TOKU_GLOBAL_STATUS
);
STATUS_INIT
(
CT_SIZE_CLONED
,
CACHETABLE_SIZE_CACHEPRESSURE
,
UINT64
,
"size currently cloned data for checkpoint"
,
TOKU_ENGINE_STATUS
|
TOKU_GLOBAL_STATUS
);
STATUS_INIT
(
CT_EVICTIONS
,
CACHETABLE_EVICTIONS
,
UINT64
,
"evictions"
,
TOKU_ENGINE_STATUS
|
TOKU_GLOBAL_STATUS
);
STATUS_INIT
(
CT_CLEANER_EXECUTIONS
,
CACHETABLE_CLEANER_EXECUTIONS
,
UINT64
,
"cleaner executions"
,
TOKU_ENGINE_STATUS
|
TOKU_GLOBAL_STATUS
);
STATUS_INIT
(
CT_CLEANER_PERIOD
,
CACHETABLE_CLEANER_PERIOD
,
UINT64
,
"cleaner period"
,
TOKU_ENGINE_STATUS
|
TOKU_GLOBAL_STATUS
);
...
...
@@ -704,7 +705,7 @@ static void cachetable_only_write_locked_data(
p
->
disk_data
=
disk_data
;
if
(
is_clone
)
{
p
->
cloned_value_data
=
NULL
;
ev
->
remove_
from_size_current
(
p
->
cloned_value_size
);
ev
->
remove_
cloned_data_size
(
p
->
cloned_value_size
);
p
->
cloned_value_size
=
0
;
}
}
...
...
@@ -949,7 +950,7 @@ clone_pair(evictor* ev, PAIR p) {
ev
->
change_pair_attr
(
old_attr
,
new_attr
);
}
p
->
cloned_value_size
=
clone_size
;
ev
->
add_
to_size_current
(
p
->
cloned_value_size
);
ev
->
add_
cloned_data_size
(
p
->
cloned_value_size
);
}
static
void
checkpoint_cloned_pair
(
void
*
extra
)
{
...
...
@@ -3635,6 +3636,7 @@ int evictor::init(long _size_limit, pair_list* _pl, cachefile_list* _cf_list, KI
m_size_reserved
=
unreservable_memory
(
_size_limit
);
m_size_current
=
0
;
m_size_cloned_data
=
0
;
m_size_evicting
=
0
;
m_size_nonleaf
=
create_partitioned_counter
();
...
...
@@ -3769,6 +3771,22 @@ void evictor::remove_from_size_current(long size) {
(
void
)
toku_sync_fetch_and_sub
(
&
m_size_current
,
size
);
}
//
// Adds the size of cloned data to necessary variables in the evictor
//
void
evictor
::
add_cloned_data_size
(
long
size
)
{
(
void
)
toku_sync_fetch_and_add
(
&
m_size_cloned_data
,
size
);
add_to_size_current
(
size
);
}
//
// Removes the size of cloned data to necessary variables in the evictor
//
void
evictor
::
remove_cloned_data_size
(
long
size
)
{
(
void
)
toku_sync_fetch_and_sub
(
&
m_size_cloned_data
,
size
);
remove_from_size_current
(
size
);
}
//
// TODO: (Zardosht) comment this function
//
...
...
@@ -4333,6 +4351,7 @@ void evictor::fill_engine_status() {
STATUS_VALUE
(
CT_SIZE_LEAF
)
=
read_partitioned_counter
(
m_size_leaf
);
STATUS_VALUE
(
CT_SIZE_ROLLBACK
)
=
read_partitioned_counter
(
m_size_rollback
);
STATUS_VALUE
(
CT_SIZE_CACHEPRESSURE
)
=
read_partitioned_counter
(
m_size_cachepressure
);
STATUS_VALUE
(
CT_SIZE_CLONED
)
=
m_size_cloned_data
;
STATUS_VALUE
(
CT_WAIT_PRESSURE_COUNT
)
=
read_partitioned_counter
(
m_wait_pressure_count
);
STATUS_VALUE
(
CT_WAIT_PRESSURE_TIME
)
=
read_partitioned_counter
(
m_wait_pressure_time
);
STATUS_VALUE
(
CT_LONG_WAIT_PRESSURE_COUNT
)
=
read_partitioned_counter
(
m_long_wait_pressure_count
);
...
...
ft/cachetable.h
View file @
3bdf1bbd
...
...
@@ -594,6 +594,7 @@ typedef enum {
CT_SIZE_LEAF
,
// number of bytes in cachetable belonging to leaf nodes
CT_SIZE_ROLLBACK
,
// number of bytes in cachetable belonging to rollback nodes
CT_SIZE_CACHEPRESSURE
,
// number of bytes causing cache pressure (sum of buffers and workdone counters)
CT_SIZE_CLONED
,
// number of bytes of cloned data in the system
CT_EVICTIONS
,
CT_CLEANER_EXECUTIONS
,
// number of times the cleaner thread's loop has executed
CT_CLEANER_PERIOD
,
...
...
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