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