Commit d06afaee authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

Addresses #1510 Added some breadcrumbs to checkpoint function,

may be useful for debugging.  In any case, they're harmless.

git-svn-id: file:///svn/toku/tokudb@11410 c7de825b-a66e-492c-adef-691d508d4ae1
parent 46d1cde8
...@@ -52,6 +52,13 @@ ...@@ -52,6 +52,13 @@
#include "cachetable.h" #include "cachetable.h"
#include "checkpoint.h" #include "checkpoint.h"
// breadcrumbs for debugging
static u_int64_t breadcrumb0 = 0;
static u_int64_t breadcrumb1 = 0;
static u_int64_t breadcrumb2 = 0;
static u_int64_t breadcrumb3 = 0;
static u_int64_t breadcrumb4 = 0;
static toku_pthread_rwlock_t checkpoint_safe_lock; static toku_pthread_rwlock_t checkpoint_safe_lock;
static toku_pthread_rwlock_t multi_operation_lock; static toku_pthread_rwlock_t multi_operation_lock;
...@@ -164,23 +171,28 @@ int ...@@ -164,23 +171,28 @@ int
toku_checkpoint(CACHETABLE ct, TOKULOGGER logger, char **error_string, void (*callback_f)(void*), void * extra) { toku_checkpoint(CACHETABLE ct, TOKULOGGER logger, char **error_string, void (*callback_f)(void*), void * extra) {
int r; int r;
breadcrumb0++;
assert(initialized); assert(initialized);
multi_operation_checkpoint_lock(); multi_operation_checkpoint_lock();
checkpoint_safe_checkpoint_lock(); checkpoint_safe_checkpoint_lock();
ydb_lock(); ydb_lock();
breadcrumb1++;
r = toku_cachetable_begin_checkpoint(ct, logger); r = toku_cachetable_begin_checkpoint(ct, logger);
multi_operation_checkpoint_unlock(); multi_operation_checkpoint_unlock();
ydb_unlock(); ydb_unlock();
breadcrumb2++;
if (r==0) { if (r==0) {
if (callback_f) if (callback_f)
callback_f(extra); // callback is called with checkpoint_safe_lock still held callback_f(extra); // callback is called with checkpoint_safe_lock still held
r = toku_cachetable_end_checkpoint(ct, logger, error_string); r = toku_cachetable_end_checkpoint(ct, logger, error_string);
} }
breadcrumb3++;
checkpoint_safe_checkpoint_unlock(); checkpoint_safe_checkpoint_unlock();
breadcrumb4++;
return r; return r;
} }
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