Commit 2e136d06 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:4362] Add more checkpoint info to engine status. Refs #4362.

git-svn-id: file:///svn/toku/tokudb@38570 c7de825b-a66e-492c-adef-691d508d4ae1
parent 71cdee0e
...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status { ...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status {
uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */ uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */
uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */ uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */
uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */ uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_sched_cs; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_client; /* how many times a client checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_client_cs; /* how many times a client checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_txn; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_txn_cs; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_other; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_other_cs; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched_mo; /* how many times a scheduled checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_client_mo; /* how many times a client checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_txn_mo; /* how many times a txn_commitcheckpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_other_mo; /* how many times a checkpoint for another purpose waited for the multi_operation lock */
u_int64_t cleaner_period; /* delay between executions of cleaner */ u_int64_t cleaner_period; /* delay between executions of cleaner */
u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */ u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
......
...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status { ...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status {
uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */ uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */
uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */ uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */
uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */ uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_sched_cs; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_client; /* how many times a client checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_client_cs; /* how many times a client checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_txn; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_txn_cs; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_other; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_other_cs; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched_mo; /* how many times a scheduled checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_client_mo; /* how many times a client checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_txn_mo; /* how many times a txn_commitcheckpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_other_mo; /* how many times a checkpoint for another purpose waited for the multi_operation lock */
u_int64_t cleaner_period; /* delay between executions of cleaner */ u_int64_t cleaner_period; /* delay between executions of cleaner */
u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */ u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
......
...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status { ...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status {
uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */ uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */
uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */ uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */
uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */ uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_sched_cs; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_client; /* how many times a client checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_client_cs; /* how many times a client checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_txn; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_txn_cs; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_other; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_other_cs; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched_mo; /* how many times a scheduled checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_client_mo; /* how many times a client checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_txn_mo; /* how many times a txn_commitcheckpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_other_mo; /* how many times a checkpoint for another purpose waited for the multi_operation lock */
u_int64_t cleaner_period; /* delay between executions of cleaner */ u_int64_t cleaner_period; /* delay between executions of cleaner */
u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */ u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
......
...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status { ...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status {
uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */ uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */
uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */ uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */
uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */ uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_sched_cs; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_client; /* how many times a client checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_client_cs; /* how many times a client checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_txn; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_txn_cs; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_other; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_other_cs; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched_mo; /* how many times a scheduled checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_client_mo; /* how many times a client checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_txn_mo; /* how many times a txn_commitcheckpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_other_mo; /* how many times a checkpoint for another purpose waited for the multi_operation lock */
u_int64_t cleaner_period; /* delay between executions of cleaner */ u_int64_t cleaner_period; /* delay between executions of cleaner */
u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */ u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
......
...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status { ...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status {
uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */ uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */
uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */ uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */
uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */ uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_sched_cs; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_client; /* how many times a client checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_client_cs; /* how many times a client checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_txn; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_txn_cs; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_other; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_other_cs; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched_mo; /* how many times a scheduled checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_client_mo; /* how many times a client checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_txn_mo; /* how many times a txn_commitcheckpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_other_mo; /* how many times a checkpoint for another purpose waited for the multi_operation lock */
u_int64_t cleaner_period; /* delay between executions of cleaner */ u_int64_t cleaner_period; /* delay between executions of cleaner */
u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */ u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
......
...@@ -483,10 +483,14 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__ ...@@ -483,10 +483,14 @@ int main (int argc __attribute__((__unused__)), char *const argv[] __attribute__
printf(" uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */ \n"); printf(" uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */ \n");
printf(" uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */ \n"); printf(" uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */ \n");
printf(" uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */ \n"); printf(" uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */ \n");
printf(" uint64_t checkpoint_wait_sched; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */ \n"); printf(" uint64_t checkpoint_wait_sched_cs; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */ \n");
printf(" uint64_t checkpoint_wait_client; /* how many times a client checkpoint waited for the checkpoint_safe lock */ \n"); printf(" uint64_t checkpoint_wait_client_cs; /* how many times a client checkpoint waited for the checkpoint_safe lock */ \n");
printf(" uint64_t checkpoint_wait_txn; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */ \n"); printf(" uint64_t checkpoint_wait_txn_cs; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */ \n");
printf(" uint64_t checkpoint_wait_other; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */ \n"); printf(" uint64_t checkpoint_wait_other_cs; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */ \n");
printf(" uint64_t checkpoint_wait_sched_mo; /* how many times a scheduled checkpoint waited for the multi_operation lock */ \n");
printf(" uint64_t checkpoint_wait_client_mo; /* how many times a client checkpoint waited for the multi_operation lock */ \n");
printf(" uint64_t checkpoint_wait_txn_mo; /* how many times a txn_commitcheckpoint waited for the multi_operation lock */ \n");
printf(" uint64_t checkpoint_wait_other_mo; /* how many times a checkpoint for another purpose waited for the multi_operation lock */ \n");
printf(" u_int64_t cleaner_period; /* delay between executions of cleaner */ \n"); printf(" u_int64_t cleaner_period; /* delay between executions of cleaner */ \n");
printf(" u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */ \n"); printf(" u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */ \n");
printf(" u_int64_t txn_begin; /* number of transactions ever begun */ \n"); printf(" u_int64_t txn_begin; /* number of transactions ever begun */ \n");
......
...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status { ...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status {
uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */ uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */
uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */ uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */
uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */ uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_sched_cs; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_client; /* how many times a client checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_client_cs; /* how many times a client checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_txn; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_txn_cs; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_other; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_other_cs; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched_mo; /* how many times a scheduled checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_client_mo; /* how many times a client checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_txn_mo; /* how many times a txn_commitcheckpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_other_mo; /* how many times a checkpoint for another purpose waited for the multi_operation lock */
u_int64_t cleaner_period; /* delay between executions of cleaner */ u_int64_t cleaner_period; /* delay between executions of cleaner */
u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */ u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
......
...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status { ...@@ -90,10 +90,14 @@ typedef struct __toku_engine_status {
uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */ uint64_t checkpoint_waiters_max; /* max threads ever simultaneously waiting to perform a checkpoint */
uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */ uint64_t checkpoint_client_wait_on_mo; /* how many times a client thread waited for the multi_operation lock */
uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */ uint64_t checkpoint_client_wait_on_cs; /* how many times a client thread waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_sched_cs; /* how many times a scheduled checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_client; /* how many times a client checkpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_client_cs; /* how many times a client checkpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_txn; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_txn_cs; /* how many times a txn_commitcheckpoint waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_other; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */ uint64_t checkpoint_wait_other_cs; /* how many times a checkpoint for another purpose waited for the checkpoint_safe lock */
uint64_t checkpoint_wait_sched_mo; /* how many times a scheduled checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_client_mo; /* how many times a client checkpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_txn_mo; /* how many times a txn_commitcheckpoint waited for the multi_operation lock */
uint64_t checkpoint_wait_other_mo; /* how many times a checkpoint for another purpose waited for the multi_operation lock */
u_int64_t cleaner_period; /* delay between executions of cleaner */ u_int64_t cleaner_period; /* delay between executions of cleaner */
u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */ u_int64_t cleaner_iterations; /* number of nodes to flush per cleaner execution */
u_int64_t txn_begin; /* number of transactions ever begun */ u_int64_t txn_begin; /* number of transactions ever begun */
......
...@@ -104,9 +104,9 @@ multi_operation_checkpoint_lock(void) { ...@@ -104,9 +104,9 @@ multi_operation_checkpoint_lock(void) {
static void static void
multi_operation_checkpoint_unlock(void) { multi_operation_checkpoint_unlock(void) {
locked_mo = FALSE;
int r = toku_pthread_rwlock_wrunlock(&multi_operation_lock); int r = toku_pthread_rwlock_wrunlock(&multi_operation_lock);
assert(r == 0); assert(r == 0);
locked_mo = FALSE;
} }
...@@ -134,9 +134,9 @@ checkpoint_safe_checkpoint_lock(void) { ...@@ -134,9 +134,9 @@ checkpoint_safe_checkpoint_lock(void) {
static void static void
checkpoint_safe_checkpoint_unlock(void) { checkpoint_safe_checkpoint_unlock(void) {
locked_cs = FALSE;
int r = toku_pthread_rwlock_wrunlock(&checkpoint_safe_lock); int r = toku_pthread_rwlock_wrunlock(&checkpoint_safe_lock);
assert(r == 0); assert(r == 0);
locked_cs = FALSE;
} }
...@@ -207,7 +207,7 @@ toku_checkpoint_destroy(void) { ...@@ -207,7 +207,7 @@ toku_checkpoint_destroy(void) {
return r; return r;
} }
#define SET_CHECKPOINT_FOOTPRINT(x) cp_status.footprint = footprint_offset + x; #define SET_CHECKPOINT_FOOTPRINT(x) cp_status.footprint = footprint_offset + x
// Take a checkpoint of all currently open dictionaries // Take a checkpoint of all currently open dictionaries
...@@ -220,28 +220,41 @@ toku_checkpoint(CACHETABLE ct, TOKULOGGER logger, ...@@ -220,28 +220,41 @@ toku_checkpoint(CACHETABLE ct, TOKULOGGER logger,
int footprint_offset = (int) caller_id * 1000; int footprint_offset = (int) caller_id * 1000;
assert(initialized); assert(initialized);
(void) __sync_fetch_and_add(&cp_status.waiters_now, 1);
if (locked_cs) { if (locked_cs) {
if (caller_id == SCHEDULED_CHECKPOINT) if (caller_id == SCHEDULED_CHECKPOINT)
(void) __sync_fetch_and_add(&cp_status.cp_wait_sched, 1); (void) __sync_fetch_and_add(&cp_status.cp_wait_sched_cs, 1);
else if (caller_id == CLIENT_CHECKPOINT) else if (caller_id == CLIENT_CHECKPOINT)
(void) __sync_fetch_and_add(&cp_status.cp_wait_client, 1); (void) __sync_fetch_and_add(&cp_status.cp_wait_client_cs, 1);
else if (caller_id == TXN_COMMIT_CHECKPOINT) else if (caller_id == TXN_COMMIT_CHECKPOINT)
(void) __sync_fetch_and_add(&cp_status.cp_wait_txn, 1); (void) __sync_fetch_and_add(&cp_status.cp_wait_txn_cs, 1);
else else
(void) __sync_fetch_and_add(&cp_status.cp_wait_other, 1); (void) __sync_fetch_and_add(&cp_status.cp_wait_other_cs, 1);
} }
checkpoint_safe_checkpoint_lock();
(void) __sync_fetch_and_add(&cp_status.waiters_now, 1);
checkpoint_safe_checkpoint_lock();
(void) __sync_fetch_and_sub(&cp_status.waiters_now, 1); (void) __sync_fetch_and_sub(&cp_status.waiters_now, 1);
if (cp_status.waiters_now > cp_status.waiters_max) if (cp_status.waiters_now > cp_status.waiters_max)
cp_status.waiters_max = cp_status.waiters_now; // threadsafe, within checkpoint_safe lock cp_status.waiters_max = cp_status.waiters_now; // threadsafe, within checkpoint_safe lock
SET_CHECKPOINT_FOOTPRINT(10)
SET_CHECKPOINT_FOOTPRINT(10);
if (locked_mo) {
if (caller_id == SCHEDULED_CHECKPOINT)
cp_status.cp_wait_sched_mo++; // threadsafe, within checkpoint_safe lock
else if (caller_id == CLIENT_CHECKPOINT)
cp_status.cp_wait_client_mo++;
else if (caller_id == TXN_COMMIT_CHECKPOINT)
cp_status.cp_wait_txn_mo++;
else
cp_status.cp_wait_other_mo++;
}
multi_operation_checkpoint_lock(); multi_operation_checkpoint_lock();
SET_CHECKPOINT_FOOTPRINT(20) SET_CHECKPOINT_FOOTPRINT(20);
ydb_lock(); ydb_lock();
SET_CHECKPOINT_FOOTPRINT(30) SET_CHECKPOINT_FOOTPRINT(30);
cp_status.time_last_checkpoint_begin = time(NULL); cp_status.time_last_checkpoint_begin = time(NULL);
r = toku_cachetable_begin_checkpoint(ct, logger); r = toku_cachetable_begin_checkpoint(ct, logger);
......
...@@ -98,10 +98,14 @@ typedef struct { ...@@ -98,10 +98,14 @@ typedef struct {
uint64_t waiters_max; // max threads ever simultaneously waiting for the checkpoint_safe lock to perform a checkpoint uint64_t waiters_max; // max threads ever simultaneously waiting for the checkpoint_safe lock to perform a checkpoint
uint64_t client_wait_on_mo; // how many times a client thread waited for the multi_operation lock uint64_t client_wait_on_mo; // how many times a client thread waited for the multi_operation lock
uint64_t client_wait_on_cs; // how many times a client thread waited for the checkpoint_safe lock uint64_t client_wait_on_cs; // how many times a client thread waited for the checkpoint_safe lock
uint64_t cp_wait_sched; // how many times a scheduled checkpoint waited for the checkpoint_safe lock uint64_t cp_wait_sched_cs; // how many times a scheduled checkpoint waited for the checkpoint_safe lock
uint64_t cp_wait_client; // how many times a client checkpoint waited for the checkpoint_safe lock uint64_t cp_wait_client_cs; // how many times a client checkpoint waited for the checkpoint_safe lock
uint64_t cp_wait_txn; // how many times a txn_commit checkpoint waited for the checkpoint_safe lock uint64_t cp_wait_txn_cs; // how many times a txn_commit checkpoint waited for the checkpoint_safe lock
uint64_t cp_wait_other; // how many times a checkpoint for another purpose waited for the checkpoint_safe lock uint64_t cp_wait_other_cs; // how many times a checkpoint for another purpose waited for the checkpoint_safe lock
uint64_t cp_wait_sched_mo; // how many times a scheduled checkpoint waited for the multi_operation lock
uint64_t cp_wait_client_mo; // how many times a client checkpoint waited for the multi_operation lock
uint64_t cp_wait_txn_mo; // how many times a txn_commit checkpoint waited for the multi_operation lock
uint64_t cp_wait_other_mo; // how many times a checkpoint for another purpose waited for the multi_operation lock
} CHECKPOINT_STATUS_S, *CHECKPOINT_STATUS; } CHECKPOINT_STATUS_S, *CHECKPOINT_STATUS;
void toku_checkpoint_get_status(CHECKPOINT_STATUS stat); void toku_checkpoint_get_status(CHECKPOINT_STATUS stat);
......
...@@ -1937,12 +1937,16 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat, char * env_panic_st ...@@ -1937,12 +1937,16 @@ env_get_engine_status(DB_ENV * env, ENGINE_STATUS * engstat, char * env_panic_st
engstat->checkpoint_waiters_max = cpstat.waiters_max; engstat->checkpoint_waiters_max = cpstat.waiters_max;
engstat->checkpoint_client_wait_on_mo = cpstat.client_wait_on_mo; engstat->checkpoint_client_wait_on_mo = cpstat.client_wait_on_mo;
engstat->checkpoint_client_wait_on_cs = cpstat.client_wait_on_cs; engstat->checkpoint_client_wait_on_cs = cpstat.client_wait_on_cs;
engstat->checkpoint_wait_sched = cpstat.cp_wait_sched; engstat->checkpoint_wait_sched_cs = cpstat.cp_wait_sched_cs;
engstat->checkpoint_wait_client = cpstat.cp_wait_client; engstat->checkpoint_wait_client_cs = cpstat.cp_wait_client_cs;
engstat->checkpoint_wait_txn = cpstat.cp_wait_txn; engstat->checkpoint_wait_txn_cs = cpstat.cp_wait_txn_cs;
engstat->checkpoint_wait_other = cpstat.cp_wait_other; engstat->checkpoint_wait_other_cs = cpstat.cp_wait_other_cs;
engstat->checkpoint_wait_sched_mo = cpstat.cp_wait_sched_mo;
engstat->checkpoint_wait_client_mo = cpstat.cp_wait_client_mo;
engstat->checkpoint_wait_txn_mo = cpstat.cp_wait_txn_mo;
engstat->checkpoint_wait_other_mo = cpstat.cp_wait_other_mo;
} }
engstat->cleaner_period = toku_get_cleaner_period_unlocked(env->i->cachetable); engstat->cleaner_period = toku_get_cleaner_period_unlocked(env->i->cachetable);
engstat->cleaner_iterations = toku_get_cleaner_iterations_unlocked(env->i->cachetable); engstat->cleaner_iterations = toku_get_cleaner_iterations_unlocked(env->i->cachetable);
{ {
TXN_STATUS_S txnstat; TXN_STATUS_S txnstat;
...@@ -2302,10 +2306,14 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) { ...@@ -2302,10 +2306,14 @@ env_get_engine_status_text(DB_ENV * env, char * buff, int bufsiz) {
n += snprintf(buff + n, bufsiz - n, "checkpoint_waiters_max %"PRIu64"\n", engstat.checkpoint_waiters_max); n += snprintf(buff + n, bufsiz - n, "checkpoint_waiters_max %"PRIu64"\n", engstat.checkpoint_waiters_max);
n += snprintf(buff + n, bufsiz - n, "checkpoint_client_wait_on_mo %"PRIu64"\n", engstat.checkpoint_client_wait_on_mo); n += snprintf(buff + n, bufsiz - n, "checkpoint_client_wait_on_mo %"PRIu64"\n", engstat.checkpoint_client_wait_on_mo);
n += snprintf(buff + n, bufsiz - n, "checkpoint_client_wait_on_cs %"PRIu64"\n", engstat.checkpoint_client_wait_on_cs); n += snprintf(buff + n, bufsiz - n, "checkpoint_client_wait_on_cs %"PRIu64"\n", engstat.checkpoint_client_wait_on_cs);
n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_sched %"PRIu64"\n", engstat.checkpoint_wait_sched); n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_sched_cs %"PRIu64"\n", engstat.checkpoint_wait_sched_cs);
n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_client %"PRIu64"\n", engstat.checkpoint_wait_client); n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_client_cs %"PRIu64"\n", engstat.checkpoint_wait_client_cs);
n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_txn %"PRIu64"\n", engstat.checkpoint_wait_txn); n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_txn_cs %"PRIu64"\n", engstat.checkpoint_wait_txn_cs);
n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_other %"PRIu64"\n", engstat.checkpoint_wait_other); n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_other_cs %"PRIu64"\n", engstat.checkpoint_wait_other_cs);
n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_sched_mo %"PRIu64"\n", engstat.checkpoint_wait_sched_mo);
n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_client_mo %"PRIu64"\n", engstat.checkpoint_wait_client_mo);
n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_txn_mo %"PRIu64"\n", engstat.checkpoint_wait_txn_mo);
n += snprintf(buff + n, bufsiz - n, "checkpoint_wait_other_mo %"PRIu64"\n", engstat.checkpoint_wait_other_mo);
n += snprintf(buff + n, bufsiz - n, "cleaner_period %"PRIu64"\n", engstat.cleaner_period); n += snprintf(buff + n, bufsiz - n, "cleaner_period %"PRIu64"\n", engstat.cleaner_period);
n += snprintf(buff + n, bufsiz - n, "cleaner_iterations %"PRIu64"\n", engstat.cleaner_iterations); n += snprintf(buff + n, bufsiz - n, "cleaner_iterations %"PRIu64"\n", engstat.cleaner_iterations);
n += snprintf(buff + n, bufsiz - n, "txn_begin %"PRIu64"\n", engstat.txn_begin); n += snprintf(buff + n, bufsiz - n, "txn_begin %"PRIu64"\n", engstat.txn_begin);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment