Commit fa229ab9 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Fix the cachetable-race so that it doesn't run in BDB and compiles under...

Fix the cachetable-race so that it doesn't run in BDB and compiles under windows. Fixes #2699, #2698. close[t:2699] close[t:2698].

git-svn-id: file:///svn/toku/tokudb@20902 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1ef31830
......@@ -2176,12 +2176,11 @@ toku_cachetable_begin_checkpoint (CACHETABLE ct, TOKULOGGER logger) {
// This is used by the cachetable_race test.
extern int get_toku_checkpointing_user_data_status(void) __attribute__((__visibility__("default")));
static volatile int toku_checkpointing_user_data_status = 0;
static void set_toku_checkpointing_user_data_status (int v) {
static void toku_cachetable_set_checkpointing_user_data_status (int v) {
toku_checkpointing_user_data_status = v;
}
int get_toku_checkpointing_user_data_status (void) {
int toku_cachetable_get_checkpointing_user_data_status (void) {
return toku_checkpointing_user_data_status;
}
......@@ -2223,9 +2222,9 @@ toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger,
assert(ct->lsn_of_checkpoint_in_progress.lsn >= cf->most_recent_global_checkpoint_that_finished_early.lsn);
cachetable_unlock(ct);
assert(cf->checkpoint_state == CS_CALLED_BEGIN_CHECKPOINT);
set_toku_checkpointing_user_data_status(1);
toku_cachetable_set_checkpointing_user_data_status(1);
int r = cf->checkpoint_userdata(cf, cf->fd, cf->userdata);
set_toku_checkpointing_user_data_status(0);
toku_cachetable_set_checkpointing_user_data_status(0);
assert(r==0);
cf->checkpoint_state = CS_CALLED_CHECKPOINT;
cachetable_lock(ct);
......
......@@ -336,6 +336,9 @@ char * toku_cachetable_get_fname_in_cwd(CACHETABLE ct, const char * fname_in_env
int toku_cachetable_local_checkpoint_for_commit(CACHETABLE ct, TOKUTXN txn, uint32_t n, CACHEFILE cachefiles[]);
// test-only function
extern int toku_cachetable_get_checkpointing_user_data_status(void);
#if defined(__cplusplus) || defined(__cilkplusplus)
};
#endif
......
......@@ -74,8 +74,7 @@
toku_test_db_redirect_dictionary;
toku_test_get_latest_lsn;
get_toku_checkpointing_user_data_status;
toku_test_get_checkpointing_user_data_status;
local: *;
};
......
......@@ -82,6 +82,7 @@ BDB_DONTRUN_TESTS = \
backwards_10_each_le_and_msg \
bug1381 \
bug627 \
cachetable-race \
checkpoint_1 \
checkpoint_callback \
checkpoint_stress \
......
......@@ -24,6 +24,7 @@
#include "toku_atomic.h"
#include <db.h>
#include <sys/stat.h>
#include "ydb.h"
#include "ydb-internal.h"
DB_ENV *env;
......@@ -71,11 +72,10 @@ static void run_cachetable_race_test(void)
dbs[i] = NULL;
if (i==2) {
extern int get_toku_checkpointing_user_data_status(void);
if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, get_toku_checkpointing_user_data_status());
while (get_toku_checkpointing_user_data_status()==0)
if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, toku_test_get_checkpointing_user_data_status());
while (toku_test_get_checkpointing_user_data_status()==0)
sched_yield();
if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, get_toku_checkpointing_user_data_status());
if (verbose) printf("%s:%d c=%d\n", __FILE__, __LINE__, toku_test_get_checkpointing_user_data_status());
}
}
r = env->close(env, 0); CKERR(r);
......
......@@ -6,10 +6,10 @@
{
ignore_race_on_toku_checkpointing_user_data_status
Helgrind:Race
fun:set_toku_checkpointing_user_data_status.*
fun:toku_set_checkpointing_user_data_status.*
}
{
ignore_race_on_toku_checkpointing_user_data_status
Helgrind:Race
fun:get_toku_checkpointing_user_data_status
fun:toku_get_checkpointing_user_data_status
}
......@@ -5904,3 +5904,6 @@ toku_test_get_latest_lsn(DB_ENV *env) {
return rval.lsn;
}
int toku_test_get_checkpointing_user_data_status (void) {
return toku_cachetable_get_checkpointing_user_data_status();
}
......@@ -28,6 +28,9 @@ int toku_test_db_redirect_dictionary(DB * db, char * dname_of_new_file, DB_TXN *
uint64_t toku_test_get_latest_lsn(DB_ENV *env) __attribute__((__visibility__("default")));
// test-only function
extern int toku_test_get_checkpointing_user_data_status(void) __attribute__((__visibility__("default")));
#if defined(__cplusplus)
}
#endif
......
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