Commit 31d817a3 authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

[t:4967] remove the ydb lock from end checkpoint. note_unpin_by_checkpoint...

[t:4967] remove the ydb lock from end checkpoint. note_unpin_by_checkpoint removes an ft reference, which is protected by the ft's ref lock.


git-svn-id: file:///svn/toku/tokudb@44129 c7de825b-a66e-492c-adef-691d508d4ae1
parent 2c757cdc
......@@ -194,7 +194,6 @@ static inline void ctpair_destroy(PAIR p) {
// The cachetable is as close to an ENV as we get.
// There are 3 locks, must be taken in this order
// TODO: review the removal of this mutex, since it is only ever held when the ydb lock is held
// cachetable_mutex
// cachefiles_mutex
struct cachetable {
......@@ -3505,7 +3504,6 @@ int toku_cachetable_get_checkpointing_user_data_status (void) {
int
toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger,
void (*ydb_lock)(void), void (*ydb_unlock)(void),
void (*testcallback_f)(void*), void * testextra) {
// Requires: The big checkpoint lock must be held (see checkpoint.c).
// Algorithm: Write all pending nodes to disk
......@@ -3609,9 +3607,7 @@ toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger,
// checking for function existing so that this function
// can be called from cachetable tests
if (cf->note_unpin_by_checkpoint) {
ydb_lock();
int r = cf->note_unpin_by_checkpoint(cf, cf->userdata);
ydb_unlock();
if (r!=0) {
retval = r;
goto panic;
......
......@@ -68,7 +68,6 @@ char * toku_cachefile_fname_in_cwd (CACHEFILE cf);
// TODO: #1510 Add comments on how these behave
int toku_cachetable_begin_checkpoint (CACHETABLE ct, TOKULOGGER);
int toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger,
void (*ydb_lock)(void), void (*ydb_unlock)(void),
void (*testcallback_f)(void*), void * testextra);
// Shuts down checkpoint thread
......
......@@ -295,7 +295,7 @@ toku_checkpoint(CACHETABLE ct, TOKULOGGER logger,
if (r==0) {
if (callback_f)
callback_f(extra); // callback is called with checkpoint_safe_lock still held
r = toku_cachetable_end_checkpoint(ct, logger, ydb_lock, ydb_unlock, callback2_f, extra2);
r = toku_cachetable_end_checkpoint(ct, logger, callback2_f, extra2);
}
SET_CHECKPOINT_FOOTPRINT(50);
if (r==0 && logger) {
......
......@@ -80,8 +80,6 @@ run_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -71,8 +71,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -99,8 +99,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -98,8 +98,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -87,8 +87,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -87,8 +87,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -28,8 +28,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -44,8 +44,6 @@ static void *run_end_checkpoint(void *arg) {
int r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -92,8 +92,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -92,8 +92,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -72,8 +72,6 @@ cachetable_test (enum cachetable_dirty dirty, BOOL cloneable) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -81,8 +81,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -274,8 +274,6 @@ static void *checkpoints(void *arg) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -59,8 +59,6 @@ run_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -402,8 +402,6 @@ static void *checkpoints(void *arg) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -130,8 +130,6 @@ test_clean (enum cachetable_dirty dirty, BOOL cloneable) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -77,8 +77,6 @@ test_clean (enum cachetable_dirty dirty, BOOL cloneable) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -58,8 +58,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -147,8 +147,6 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -113,8 +113,6 @@ run_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -94,8 +94,6 @@ run_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -155,8 +155,6 @@ cachetable_test (BOOL write_first, BOOL write_second, BOOL start_checkpoint) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -45,8 +45,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -16,8 +16,6 @@ static void *run_end_chkpt(void *arg) {
int r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
......@@ -155,8 +155,6 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint(
ct,
NULL,
fake_ydb_lock,
fake_ydb_unlock,
NULL,
NULL
);
......
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