Commit 5dd0e5e8 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

refs #5467, merge to main

git-svn-id: file:///svn/toku/tokudb@47870 c7de825b-a66e-492c-adef-691d508d4ae1
parent 77c30060
...@@ -324,7 +324,7 @@ class checkpointer { ...@@ -324,7 +324,7 @@ class checkpointer {
int begin_checkpoint(); int begin_checkpoint();
void add_background_job(); void add_background_job();
void remove_background_job(); void remove_background_job();
int end_checkpoint(void (*testcallback_f)(void*), void* testextra); int end_checkpoint(bool aggressive, void (*testcallback_f)(void*), void* testextra);
TOKULOGGER get_logger(); TOKULOGGER get_logger();
// used during begin_checkpoint // used during begin_checkpoint
void increment_num_txns(); void increment_num_txns();
...@@ -347,7 +347,7 @@ class checkpointer { ...@@ -347,7 +347,7 @@ class checkpointer {
void turn_on_pending_bits(); void turn_on_pending_bits();
// private methods for end_checkpoint // private methods for end_checkpoint
void fill_checkpoint_cfs(CACHEFILE* checkpoint_cfs); void fill_checkpoint_cfs(CACHEFILE* checkpoint_cfs);
void checkpoint_pending_pairs(); void checkpoint_pending_pairs(bool aggressive);
void checkpoint_userdata(CACHEFILE* checkpoint_cfs); void checkpoint_userdata(CACHEFILE* checkpoint_cfs);
void log_end_checkpoint(); void log_end_checkpoint();
void end_checkpoint_userdata(CACHEFILE* checkpoint_cfs); void end_checkpoint_userdata(CACHEFILE* checkpoint_cfs);
......
...@@ -563,7 +563,7 @@ static void cachetable_free_pair(PAIR p) { ...@@ -563,7 +563,7 @@ static void cachetable_free_pair(PAIR p) {
// cachetable_remove_pair, we cannot pass in p->cachefile and p->cachefile->fd // cachetable_remove_pair, we cannot pass in p->cachefile and p->cachefile->fd
// for the first two parameters, as these may be invalid (#5171), so, we // for the first two parameters, as these may be invalid (#5171), so, we
// pass in NULL and -1, dummy values // pass in NULL and -1, dummy values
flush_callback(NULL, -1, key, value, &disk_data, write_extraargs, old_attr, &new_attr, false, false, true, false); flush_callback(NULL, -1, key, value, &disk_data, write_extraargs, old_attr, &new_attr, false, false, true, false, false);
ctpair_destroy(p); ctpair_destroy(p);
} }
...@@ -613,7 +613,8 @@ static void cachetable_only_write_locked_data( ...@@ -613,7 +613,8 @@ static void cachetable_only_write_locked_data(
PAIR p, PAIR p,
bool for_checkpoint, bool for_checkpoint,
PAIR_ATTR* new_attr, PAIR_ATTR* new_attr,
bool is_clone bool is_clone,
bool aggressive
) )
{ {
CACHETABLE_FLUSH_CALLBACK flush_callback = p->flush_callback; CACHETABLE_FLUSH_CALLBACK flush_callback = p->flush_callback;
...@@ -648,7 +649,8 @@ static void cachetable_only_write_locked_data( ...@@ -648,7 +649,8 @@ static void cachetable_only_write_locked_data(
dowrite, dowrite,
is_clone ? false : true, // keep_me (only keep if this is not cloned pointer) is_clone ? false : true, // keep_me (only keep if this is not cloned pointer)
for_checkpoint, for_checkpoint,
is_clone //is_clone is_clone, //is_clone
aggressive
); );
p->disk_data = disk_data; p->disk_data = disk_data;
if (is_clone) { if (is_clone) {
...@@ -689,7 +691,7 @@ static void cachetable_write_locked_pair( ...@@ -689,7 +691,7 @@ static void cachetable_write_locked_pair(
// there should be no cloned value data // there should be no cloned value data
assert(p->cloned_value_data == NULL); assert(p->cloned_value_data == NULL);
if (p->dirty) { if (p->dirty) {
cachetable_only_write_locked_data(ev, p, for_checkpoint, &new_attr, false); cachetable_only_write_locked_data(ev, p, for_checkpoint, &new_attr, false, false);
// //
// now let's update variables // now let's update variables
// //
...@@ -924,7 +926,8 @@ static void checkpoint_cloned_pair(void* extra) { ...@@ -924,7 +926,8 @@ static void checkpoint_cloned_pair(void* extra) {
p, p,
true, //for_checkpoint true, //for_checkpoint
&new_attr, &new_attr,
true //is_clone true, //is_clone
false // aggressive
); );
pair_lock(p); pair_lock(p);
nb_mutex_unlock(&p->disk_nb_mutex); nb_mutex_unlock(&p->disk_nb_mutex);
...@@ -978,7 +981,7 @@ write_locked_pair_for_checkpoint(CACHETABLE ct, PAIR p, bool checkpoint_pending) ...@@ -978,7 +981,7 @@ write_locked_pair_for_checkpoint(CACHETABLE ct, PAIR p, bool checkpoint_pending)
// Else release write lock // Else release write lock
// //
static void static void
write_pair_for_checkpoint_thread (evictor* ev, PAIR p) write_pair_for_checkpoint_thread (evictor* ev, PAIR p, bool aggressive)
{ {
// Grab an exclusive lock on the pair. // Grab an exclusive lock on the pair.
// If we grab an expensive lock, then other threads will return // If we grab an expensive lock, then other threads will return
...@@ -1019,7 +1022,8 @@ write_pair_for_checkpoint_thread (evictor* ev, PAIR p) ...@@ -1019,7 +1022,8 @@ write_pair_for_checkpoint_thread (evictor* ev, PAIR p)
p, p,
true, //for_checkpoint true, //for_checkpoint
&attr, &attr,
true //is_clone true, //is_clone
aggressive
); );
pair_lock(p); pair_lock(p);
nb_mutex_unlock(&p->disk_nb_mutex); nb_mutex_unlock(&p->disk_nb_mutex);
...@@ -2446,7 +2450,8 @@ static void cachetable_flush_pair_for_close(void* extra) { ...@@ -2446,7 +2450,8 @@ static void cachetable_flush_pair_for_close(void* extra) {
p, p,
false, // not for a checkpoint, as we assert above false, // not for a checkpoint, as we assert above
&attr, &attr,
false // not a clone false, // not a clone
true // aggressive
); );
p->dirty = CACHETABLE_CLEAN; p->dirty = CACHETABLE_CLEAN;
bjm_remove_background_job(args->bjm); bjm_remove_background_job(args->bjm);
...@@ -2824,7 +2829,7 @@ int log_open_txn (const TOKUTXN &txn, const uint32_t UU(index), checkpointer * c ...@@ -2824,7 +2829,7 @@ int log_open_txn (const TOKUTXN &txn, const uint32_t UU(index), checkpointer * c
// Mark every dirty node as "pending." ("Pending" means that the node must be // Mark every dirty node as "pending." ("Pending" means that the node must be
// written to disk before it can be modified.) // written to disk before it can be modified.)
int int
toku_cachetable_begin_checkpoint (CHECKPOINTER cp, TOKULOGGER UU(logger)) { toku_cachetable_begin_checkpoint (CHECKPOINTER cp) {
return cp->begin_checkpoint(); return cp->begin_checkpoint();
} }
...@@ -2844,9 +2849,9 @@ int toku_cachetable_get_checkpointing_user_data_status (void) { ...@@ -2844,9 +2849,9 @@ int toku_cachetable_get_checkpointing_user_data_status (void) {
// Use end_checkpoint callback to fsync dictionary and log, and to free unused blocks // Use end_checkpoint callback to fsync dictionary and log, and to free unused blocks
// Note: If testcallback is null (for testing purposes only), call it after writing dictionary but before writing log // Note: If testcallback is null (for testing purposes only), call it after writing dictionary but before writing log
int int
toku_cachetable_end_checkpoint(CHECKPOINTER cp, TOKULOGGER UU(logger), toku_cachetable_end_checkpoint(CHECKPOINTER cp, bool aggressive,
void (*testcallback_f)(void*), void* testextra) { void (*testcallback_f)(void*), void* testextra) {
return cp->end_checkpoint(testcallback_f, testextra); return cp->end_checkpoint(aggressive, testcallback_f, testextra);
} }
TOKULOGGER toku_cachefile_logger (CACHEFILE cf) { TOKULOGGER toku_cachefile_logger (CACHEFILE cf) {
...@@ -4396,12 +4401,17 @@ void checkpointer::remove_background_job() { ...@@ -4396,12 +4401,17 @@ void checkpointer::remove_background_job() {
bjm_remove_background_job(m_checkpoint_clones_bjm); bjm_remove_background_job(m_checkpoint_clones_bjm);
} }
int checkpointer::end_checkpoint(void (*testcallback_f)(void*), void* testextra) { int checkpointer::end_checkpoint(
bool aggressive,
void (*testcallback_f)(void*),
void* testextra
)
{
int r = 0; int r = 0;
CACHEFILE *XMALLOC_N(m_checkpoint_num_files, checkpoint_cfs); CACHEFILE *XMALLOC_N(m_checkpoint_num_files, checkpoint_cfs);
this->fill_checkpoint_cfs(checkpoint_cfs); this->fill_checkpoint_cfs(checkpoint_cfs);
this->checkpoint_pending_pairs(); this->checkpoint_pending_pairs(aggressive);
this->checkpoint_userdata(checkpoint_cfs); this->checkpoint_userdata(checkpoint_cfs);
// For testing purposes only. Dictionary has been fsync-ed to disk but log has not yet been written. // For testing purposes only. Dictionary has been fsync-ed to disk but log has not yet been written.
if (testcallback_f) { if (testcallback_f) {
...@@ -4430,7 +4440,7 @@ void checkpointer::fill_checkpoint_cfs(CACHEFILE* checkpoint_cfs) { ...@@ -4430,7 +4440,7 @@ void checkpointer::fill_checkpoint_cfs(CACHEFILE* checkpoint_cfs) {
m_cf_list->read_unlock(); m_cf_list->read_unlock();
} }
void checkpointer::checkpoint_pending_pairs() { void checkpointer::checkpoint_pending_pairs(bool aggressive) {
PAIR p; PAIR p;
m_list->read_list_lock(); m_list->read_list_lock();
while ((p = m_list->m_pending_head)!=0) { while ((p = m_list->m_pending_head)!=0) {
...@@ -4440,7 +4450,7 @@ void checkpointer::checkpoint_pending_pairs() { ...@@ -4440,7 +4450,7 @@ void checkpointer::checkpoint_pending_pairs() {
// if still pending, clear the pending bit and write out the node // if still pending, clear the pending bit and write out the node
pair_lock(p); pair_lock(p);
m_list->read_list_unlock(); m_list->read_list_unlock();
write_pair_for_checkpoint_thread(m_ev, p); write_pair_for_checkpoint_thread(m_ev, p, aggressive);
pair_unlock(p); pair_unlock(p);
m_list->read_list_lock(); m_list->read_list_lock();
} }
......
...@@ -65,8 +65,11 @@ int toku_cachefile_of_iname_in_env (CACHETABLE ct, const char *iname_in_env, CAC ...@@ -65,8 +65,11 @@ int toku_cachefile_of_iname_in_env (CACHETABLE ct, const char *iname_in_env, CAC
char * toku_cachefile_fname_in_cwd (CACHEFILE cf); 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 (CHECKPOINTER cp, TOKULOGGER); int toku_cachetable_begin_checkpoint (CHECKPOINTER cp);
int toku_cachetable_end_checkpoint(CHECKPOINTER cp, TOKULOGGER logger, // Completes the checkpoint by writing dirty nodes and headers to disk.
// The aggressive variable determines if the checkpointer should aggressively
// use CPU during the writes or not.
int toku_cachetable_end_checkpoint(CHECKPOINTER cp, bool aggressive,
void (*testcallback_f)(void*), void * testextra); void (*testcallback_f)(void*), void * testextra);
// Shuts down checkpoint thread // Shuts down checkpoint thread
...@@ -118,9 +121,10 @@ enum cachetable_dirty { ...@@ -118,9 +121,10 @@ enum cachetable_dirty {
// When write_me is true, the value should be written to storage. // When write_me is true, the value should be written to storage.
// When keep_me is false, the value should be freed. // When keep_me is false, the value should be freed.
// When for_checkpoint is true, this was a 'pending' write // When for_checkpoint is true, this was a 'pending' write
// When aggressive is true, the callback can feel free to use all the cores it can to complete the flush ASAP
// Returns: 0 if success, otherwise an error number. // Returns: 0 if success, otherwise an error number.
// Can access fd (fd is protected by a readlock during call) // Can access fd (fd is protected by a readlock during call)
typedef void (*CACHETABLE_FLUSH_CALLBACK)(CACHEFILE, int fd, CACHEKEY key, void *value, void **disk_data, void *write_extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, bool write_me, bool keep_me, bool for_checkpoint, bool is_clone); typedef void (*CACHETABLE_FLUSH_CALLBACK)(CACHEFILE, int fd, CACHEKEY key, void *value, void **disk_data, void *write_extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, bool write_me, bool keep_me, bool for_checkpoint, bool is_clone, bool aggressive);
// The fetch callback is called when a thread is attempting to get and pin a memory // The fetch callback is called when a thread is attempting to get and pin a memory
// object and it is not in the cachetable. // object and it is not in the cachetable.
......
...@@ -213,6 +213,24 @@ toku_checkpoint_destroy(void) { ...@@ -213,6 +213,24 @@ toku_checkpoint_destroy(void) {
initialized = false; initialized = false;
} }
static bool checkpoint_caller_is_aggressive(checkpoint_caller_t caller_id) {
bool retval;
switch (caller_id) {
case SCHEDULED_CHECKPOINT:
case CLIENT_CHECKPOINT:
retval = false;
break;
case TXN_COMMIT_CHECKPOINT:
case STARTUP_CHECKPOINT:
case UPGRADE_CHECKPOINT:
case RECOVERY_CHECKPOINT:
case SHUTDOWN_CHECKPOINT:
retval = true;
break;
}
return retval;
}
#define SET_CHECKPOINT_FOOTPRINT(x) STATUS_VALUE(CP_FOOTPRINT) = footprint_offset + x #define SET_CHECKPOINT_FOOTPRINT(x) STATUS_VALUE(CP_FOOTPRINT) = footprint_offset + x
...@@ -241,16 +259,18 @@ toku_checkpoint(CHECKPOINTER cp, TOKULOGGER logger, ...@@ -241,16 +259,18 @@ toku_checkpoint(CHECKPOINTER cp, TOKULOGGER logger,
SET_CHECKPOINT_FOOTPRINT(30); SET_CHECKPOINT_FOOTPRINT(30);
STATUS_VALUE(CP_TIME_LAST_CHECKPOINT_BEGIN) = time(NULL); STATUS_VALUE(CP_TIME_LAST_CHECKPOINT_BEGIN) = time(NULL);
r = toku_cachetable_begin_checkpoint(cp, logger); r = toku_cachetable_begin_checkpoint(cp);
toku_ft_open_close_unlock(); toku_ft_open_close_unlock();
multi_operation_checkpoint_unlock(); multi_operation_checkpoint_unlock();
SET_CHECKPOINT_FOOTPRINT(40); SET_CHECKPOINT_FOOTPRINT(40);
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(cp, logger, callback2_f, extra2); }
bool aggressive = checkpoint_caller_is_aggressive(caller_id);
r = toku_cachetable_end_checkpoint(cp, aggressive, callback2_f, extra2);
} }
SET_CHECKPOINT_FOOTPRINT(50); SET_CHECKPOINT_FOOTPRINT(50);
if (r==0 && logger) { if (r==0 && logger) {
......
...@@ -524,7 +524,7 @@ int toku_serialize_ftnode_to_memory (FTNODE node, ...@@ -524,7 +524,7 @@ int toku_serialize_ftnode_to_memory (FTNODE node,
bool in_parallel, bool in_parallel,
/*out*/ size_t *n_bytes_to_write, /*out*/ size_t *n_bytes_to_write,
/*out*/ char **bytes_to_write); /*out*/ char **bytes_to_write);
int toku_serialize_ftnode_to(int fd, BLOCKNUM, FTNODE node, FTNODE_DISK_DATA* ndd, bool do_rebalancing, FT h, bool for_checkpoint); int toku_serialize_ftnode_to(int fd, BLOCKNUM, FTNODE node, FTNODE_DISK_DATA* ndd, bool do_rebalancing, FT h, bool for_checkpoint, bool aggressive);
int toku_serialize_rollback_log_to (int fd, ROLLBACK_LOG_NODE log, SERIALIZED_ROLLBACK_LOG_NODE serialized_log, bool is_serialized, int toku_serialize_rollback_log_to (int fd, ROLLBACK_LOG_NODE log, SERIALIZED_ROLLBACK_LOG_NODE serialized_log, bool is_serialized,
FT h, bool for_checkpoint); FT h, bool for_checkpoint);
void toku_serialize_rollback_log_to_memory_uncompressed(ROLLBACK_LOG_NODE log, SERIALIZED_ROLLBACK_LOG_NODE serialized); void toku_serialize_rollback_log_to_memory_uncompressed(ROLLBACK_LOG_NODE log, SERIALIZED_ROLLBACK_LOG_NODE serialized);
...@@ -641,7 +641,7 @@ STAT64INFO_S toku_get_and_clear_basement_stats(FTNODE leafnode); ...@@ -641,7 +641,7 @@ STAT64INFO_S toku_get_and_clear_basement_stats(FTNODE leafnode);
void toku_evict_bn_from_memory(FTNODE node, int childnum, FT h); void toku_evict_bn_from_memory(FTNODE node, int childnum, FT h);
void toku_ft_status_update_pivot_fetch_reason(struct ftnode_fetch_extra *bfe); void toku_ft_status_update_pivot_fetch_reason(struct ftnode_fetch_extra *bfe);
extern void toku_ftnode_clone_callback(void* value_data, void** cloned_value_data, PAIR_ATTR* new_attr, bool for_checkpoint, void* write_extraargs); extern void toku_ftnode_clone_callback(void* value_data, void** cloned_value_data, PAIR_ATTR* new_attr, bool for_checkpoint, void* write_extraargs);
extern void toku_ftnode_flush_callback (CACHEFILE cachefile, int fd, BLOCKNUM nodename, void *ftnode_v, void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, bool write_me, bool keep_me, bool for_checkpoint, bool is_clone); extern void toku_ftnode_flush_callback (CACHEFILE cachefile, int fd, BLOCKNUM nodename, void *ftnode_v, void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, bool write_me, bool keep_me, bool for_checkpoint, bool is_clone, bool aggressive);
extern int toku_ftnode_fetch_callback (CACHEFILE cachefile, PAIR p, int fd, BLOCKNUM nodename, uint32_t fullhash, void **ftnode_pv, void** UU(disk_data), PAIR_ATTR *sizep, int*dirty, void*extraargs); extern int toku_ftnode_fetch_callback (CACHEFILE cachefile, PAIR p, int fd, BLOCKNUM nodename, uint32_t fullhash, void **ftnode_pv, void** UU(disk_data), PAIR_ATTR *sizep, int*dirty, void*extraargs);
extern void toku_ftnode_pe_est_callback(void* ftnode_pv, void* disk_data, long* bytes_freed_estimate, enum partial_eviction_cost *cost, void* write_extraargs); extern void toku_ftnode_pe_est_callback(void* ftnode_pv, void* disk_data, long* bytes_freed_estimate, enum partial_eviction_cost *cost, void* write_extraargs);
extern int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR old_attr, PAIR_ATTR* new_attr, void *extraargs); extern int toku_ftnode_pe_callback (void *ftnode_pv, PAIR_ATTR old_attr, PAIR_ATTR* new_attr, void *extraargs);
......
...@@ -717,7 +717,8 @@ void toku_ftnode_flush_callback ( ...@@ -717,7 +717,8 @@ void toku_ftnode_flush_callback (
bool write_me, bool write_me,
bool keep_me, bool keep_me,
bool for_checkpoint, bool for_checkpoint,
bool is_clone bool is_clone,
bool aggressive
) )
{ {
FT h = (FT) extraargs; FT h = (FT) extraargs;
...@@ -731,7 +732,7 @@ void toku_ftnode_flush_callback ( ...@@ -731,7 +732,7 @@ void toku_ftnode_flush_callback (
} }
if (!h->panic) { // if the brt panicked, stop writing, otherwise try to write it. if (!h->panic) { // if the brt panicked, stop writing, otherwise try to write it.
toku_assert_entire_node_in_memory(ftnode); toku_assert_entire_node_in_memory(ftnode);
int r = toku_serialize_ftnode_to(fd, ftnode->thisnodename, ftnode, ndd, !is_clone, h, for_checkpoint); int r = toku_serialize_ftnode_to(fd, ftnode->thisnodename, ftnode, ndd, !is_clone, h, for_checkpoint, aggressive);
assert_zero(r); assert_zero(r);
ftnode->layout_version_read_from_disk = FT_LAYOUT_VERSION; ftnode->layout_version_read_from_disk = FT_LAYOUT_VERSION;
} }
......
...@@ -861,7 +861,7 @@ toku_serialize_ftnode_to_memory (FTNODE node, ...@@ -861,7 +861,7 @@ toku_serialize_ftnode_to_memory (FTNODE node,
} }
int int
toku_serialize_ftnode_to (int fd, BLOCKNUM blocknum, FTNODE node, FTNODE_DISK_DATA* ndd, bool do_rebalancing, FT h, bool for_checkpoint) { toku_serialize_ftnode_to (int fd, BLOCKNUM blocknum, FTNODE node, FTNODE_DISK_DATA* ndd, bool do_rebalancing, FT h, bool for_checkpoint, bool aggressive) {
size_t n_to_write; size_t n_to_write;
char *compressed_buf = NULL; char *compressed_buf = NULL;
...@@ -885,7 +885,7 @@ toku_serialize_ftnode_to (int fd, BLOCKNUM blocknum, FTNODE node, FTNODE_DISK_DA ...@@ -885,7 +885,7 @@ toku_serialize_ftnode_to (int fd, BLOCKNUM blocknum, FTNODE node, FTNODE_DISK_DA
h->h->basementnodesize, h->h->basementnodesize,
h->h->compression_method, h->h->compression_method,
do_rebalancing, do_rebalancing,
false, // in_parallel aggressive, // in_parallel
&n_to_write, &n_to_write,
&compressed_buf &compressed_buf
); );
......
...@@ -26,7 +26,7 @@ rollback_log_destroy(ROLLBACK_LOG_NODE log) { ...@@ -26,7 +26,7 @@ rollback_log_destroy(ROLLBACK_LOG_NODE log) {
// On success return nbytes. // On success return nbytes.
void toku_rollback_flush_callback (CACHEFILE cachefile, int fd, BLOCKNUM logname, void toku_rollback_flush_callback (CACHEFILE cachefile, int fd, BLOCKNUM logname,
void *rollback_v, void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, void *rollback_v, void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size,
bool write_me, bool keep_me, bool for_checkpoint, bool is_clone) { bool write_me, bool keep_me, bool for_checkpoint, bool is_clone, bool UU(aggressive)) {
int r; int r;
ROLLBACK_LOG_NODE log = nullptr; ROLLBACK_LOG_NODE log = nullptr;
SERIALIZED_ROLLBACK_LOG_NODE serialized = nullptr; SERIALIZED_ROLLBACK_LOG_NODE serialized = nullptr;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "cachetable.h" #include "cachetable.h"
#include "fttypes.h" #include "fttypes.h"
void toku_rollback_flush_callback(CACHEFILE cachefile, int fd, BLOCKNUM logname, void *rollback_v, void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, bool write_me, bool keep_me, bool for_checkpoint, bool UU(is_clone)); void toku_rollback_flush_callback(CACHEFILE cachefile, int fd, BLOCKNUM logname, void *rollback_v, void** UU(disk_data), void *extraargs, PAIR_ATTR size, PAIR_ATTR* new_size, bool write_me, bool keep_me, bool for_checkpoint, bool UU(is_clone), bool UU(aggressive));
int toku_rollback_fetch_callback(CACHEFILE cachefile, PAIR p, int fd, BLOCKNUM logname, uint32_t fullhash, void **rollback_pv, void** UU(disk_data), PAIR_ATTR *sizep, int * UU(dirtyp), void *extraargs); int toku_rollback_fetch_callback(CACHEFILE cachefile, PAIR p, int fd, BLOCKNUM logname, uint32_t fullhash, void **rollback_pv, void** UU(disk_data), PAIR_ATTR *sizep, int * UU(dirtyp), void *extraargs);
void toku_rollback_pe_est_callback( void toku_rollback_pe_est_callback(
void* rollback_v, void* rollback_v,
......
...@@ -53,7 +53,7 @@ run_test (void) { ...@@ -53,7 +53,7 @@ run_test (void) {
// pin 1 and 2 // pin 1 and 2
r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL); r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); r = toku_cachetable_begin_checkpoint(cp);
// mark nodes as pending a checkpoint, so that get_and_pin_nonblocking on block 1 will return TOKUDB_TRY_AGAIN // mark nodes as pending a checkpoint, so that get_and_pin_nonblocking on block 1 will return TOKUDB_TRY_AGAIN
r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8)); assert(r==0); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8)); assert(r==0);
...@@ -82,7 +82,7 @@ run_test (void) { ...@@ -82,7 +82,7 @@ run_test (void) {
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -43,7 +43,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -43,7 +43,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
if (check_flush && w) { if (check_flush && w) {
dirty_flush_called = true; dirty_flush_called = true;
......
...@@ -17,7 +17,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -17,7 +17,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (verbose) { printf("FLUSH: %d write_me %d\n", (int)k.b, w); } if (verbose) { printf("FLUSH: %d write_me %d\n", (int)k.b, w); }
......
...@@ -46,7 +46,7 @@ flush ( ...@@ -46,7 +46,7 @@ flush (
bool write_me, bool write_me,
bool keep_me, bool keep_me,
bool UU(for_checkpoint), bool UU(for_checkpoint),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) )
{ {
// printf("f"); // printf("f");
......
...@@ -24,7 +24,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -24,7 +24,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (verbose) { printf("FLUSH: %d\n", (int)k.b); } if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
...@@ -91,7 +91,7 @@ cachetable_test (void) { ...@@ -91,7 +91,7 @@ cachetable_test (void) {
// flush will be called only for v1, because v1 is dirty // flush will be called only for v1, because v1 is dirty
// //
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert(r == 0); r = toku_cachetable_begin_checkpoint(cp); assert(r == 0);
r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8)); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
...@@ -101,7 +101,7 @@ cachetable_test (void) { ...@@ -101,7 +101,7 @@ cachetable_test (void) {
flush_called = false; flush_called = false;
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -24,7 +24,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -24,7 +24,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (verbose) { printf("FLUSH: %d\n", (int)k.b); } if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
...@@ -93,14 +93,14 @@ cachetable_test (void) { ...@@ -93,14 +93,14 @@ cachetable_test (void) {
// flush will be called only for v1, because v1 is dirty // flush will be called only for v1, because v1 is dirty
// //
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert(r == 0); r = toku_cachetable_begin_checkpoint(cp); assert(r == 0);
check_me = true; check_me = true;
flush_called = false; flush_called = false;
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -26,7 +26,7 @@ static void flush( ...@@ -26,7 +26,7 @@ static void flush(
bool write_me, bool write_me,
bool keep_me, bool keep_me,
bool UU(for_checkpoint), bool UU(for_checkpoint),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) )
{ {
//cf = cf; key = key; value = value; extraargs = extraargs; //cf = cf; key = key; value = value; extraargs = extraargs;
......
...@@ -280,7 +280,7 @@ void checkpointer_test::test_end_checkpoint() { ...@@ -280,7 +280,7 @@ void checkpointer_test::test_end_checkpoint() {
assert(pending_pairs == count / 2); assert(pending_pairs == count / 2);
// 5. Call end checkpoint // 5. Call end checkpoint
m_cp.end_checkpoint(NULL, NULL); m_cp.end_checkpoint(false, NULL, NULL);
pending_pairs = get_number_pending_pairs(m_cp.m_list); pending_pairs = get_number_pending_pairs(m_cp.m_list);
assert(pending_pairs == 0); assert(pending_pairs == 0);
......
...@@ -22,7 +22,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -22,7 +22,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (verbose) { printf("FLUSH: %d\n", (int)k.b); } if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
...@@ -83,13 +83,13 @@ cachetable_test (void) { ...@@ -83,13 +83,13 @@ cachetable_test (void) {
cleaner_called = false; cleaner_called = false;
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); r = toku_cachetable_begin_checkpoint(cp);
assert_zero(r); assert_zero(r);
toku_cleaner_thread_for_test(ct); toku_cleaner_thread_for_test(ct);
assert(cleaner_called); assert(cleaner_called);
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -22,7 +22,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -22,7 +22,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (verbose) { printf("FLUSH: %d\n", (int)k.b); } if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
...@@ -83,13 +83,13 @@ cachetable_test (void) { ...@@ -83,13 +83,13 @@ cachetable_test (void) {
cleaner_called = false; cleaner_called = false;
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); r = toku_cachetable_begin_checkpoint(cp);
assert_zero(r); assert_zero(r);
toku_cleaner_thread_for_test(ct); toku_cleaner_thread_for_test(ct);
assert(!cleaner_called); assert(!cleaner_called);
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -39,7 +39,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -39,7 +39,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
PAIR_ATTR *CAST_FROM_VOIDP(expect, e); PAIR_ATTR *CAST_FROM_VOIDP(expect, e);
if (!keep) { if (!keep) {
......
...@@ -26,10 +26,10 @@ cachetable_test (void) { ...@@ -26,10 +26,10 @@ cachetable_test (void) {
usleep(4000000); usleep(4000000);
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert(r == 0); r = toku_cachetable_begin_checkpoint(cp); assert(r == 0);
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -22,7 +22,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -22,7 +22,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (check_flush && !keep) { if (check_flush && !keep) {
......
...@@ -21,7 +21,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -21,7 +21,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep, bool keep,
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
assert(flush_may_occur); assert(flush_may_occur);
if (!keep) { if (!keep) {
...@@ -63,7 +63,7 @@ other_flush (CACHEFILE f __attribute__((__unused__)), ...@@ -63,7 +63,7 @@ other_flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
} }
......
...@@ -21,7 +21,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -21,7 +21,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep, bool keep,
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
assert(flush_may_occur); assert(flush_may_occur);
if (!keep) { if (!keep) {
...@@ -63,7 +63,7 @@ other_flush (CACHEFILE f __attribute__((__unused__)), ...@@ -63,7 +63,7 @@ other_flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
} }
......
...@@ -32,7 +32,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -32,7 +32,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (check_flush && !keep) { if (check_flush && !keep) {
......
...@@ -30,7 +30,8 @@ flush ( ...@@ -30,7 +30,8 @@ flush (
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool is_clone bool is_clone,
bool UU(aggressive)
) )
{ {
if (is_clone) { if (is_clone) {
...@@ -44,7 +45,7 @@ static void *run_end_checkpoint(void *arg) { ...@@ -44,7 +45,7 @@ static void *run_end_checkpoint(void *arg) {
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
int r = toku_cachetable_end_checkpoint( int r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
...@@ -77,7 +78,7 @@ cachetable_test (void) { ...@@ -77,7 +78,7 @@ cachetable_test (void) {
r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8)); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
assert_zero(r); assert_zero(r);
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); r = toku_cachetable_begin_checkpoint(cp);
clone_flush_started = false; clone_flush_started = false;
......
...@@ -29,7 +29,7 @@ flush ( ...@@ -29,7 +29,7 @@ flush (
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) )
{ {
if (is_clone) { if (is_clone) {
...@@ -73,7 +73,7 @@ cachetable_test (void) { ...@@ -73,7 +73,7 @@ cachetable_test (void) {
flush_completed = false; flush_completed = false;
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert_zero(r); r = toku_cachetable_begin_checkpoint(cp); assert_zero(r);
assert_zero(r); assert_zero(r);
r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL); r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
assert_zero(r); assert_zero(r);
...@@ -93,7 +93,7 @@ cachetable_test (void) { ...@@ -93,7 +93,7 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -29,7 +29,7 @@ flush ( ...@@ -29,7 +29,7 @@ flush (
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) )
{ {
if (is_clone) { if (is_clone) {
...@@ -78,7 +78,7 @@ cachetable_test (void) { ...@@ -78,7 +78,7 @@ cachetable_test (void) {
flush_completed = false; flush_completed = false;
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert_zero(r); r = toku_cachetable_begin_checkpoint(cp); assert_zero(r);
assert_zero(r); assert_zero(r);
r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL); r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
assert_zero(r); assert_zero(r);
...@@ -94,7 +94,7 @@ cachetable_test (void) { ...@@ -94,7 +94,7 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -27,7 +27,7 @@ flush ( ...@@ -27,7 +27,7 @@ flush (
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) )
{ {
} }
...@@ -58,7 +58,7 @@ cachetable_test (enum cachetable_dirty dirty, bool cloneable) { ...@@ -58,7 +58,7 @@ cachetable_test (enum cachetable_dirty dirty, bool cloneable) {
// test that having a pin that passes false for may_modify_value does not stall behind checkpoint // test that having a pin that passes false for may_modify_value does not stall behind checkpoint
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert_zero(r); r = toku_cachetable_begin_checkpoint(cp); assert_zero(r);
r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, PL_READ, NULL, NULL); r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, PL_READ, NULL, NULL);
assert(r == 0); assert(r == 0);
r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8));
...@@ -75,7 +75,7 @@ cachetable_test (enum cachetable_dirty dirty, bool cloneable) { ...@@ -75,7 +75,7 @@ cachetable_test (enum cachetable_dirty dirty, bool cloneable) {
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -29,7 +29,7 @@ flush ( ...@@ -29,7 +29,7 @@ flush (
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) )
{ {
if (is_clone) { if (is_clone) {
...@@ -72,7 +72,7 @@ cachetable_test (void) { ...@@ -72,7 +72,7 @@ cachetable_test (void) {
flush_completed = false; flush_completed = false;
evict_called = false; evict_called = false;
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert_zero(r); r = toku_cachetable_begin_checkpoint(cp); assert_zero(r);
assert_zero(r); assert_zero(r);
r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL); r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
assert_zero(r); assert_zero(r);
...@@ -82,7 +82,7 @@ cachetable_test (void) { ...@@ -82,7 +82,7 @@ cachetable_test (void) {
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -23,7 +23,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -23,7 +23,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
assert(expect_full_flush); assert(expect_full_flush);
sleep(2); sleep(2);
......
...@@ -23,7 +23,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -23,7 +23,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
assert(expect_full_flush); assert(expect_full_flush);
} }
......
...@@ -21,7 +21,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -21,7 +21,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
if (do_sleep) { if (do_sleep) {
sleep(3); sleep(3);
......
...@@ -18,7 +18,7 @@ flush (CACHEFILE cf __attribute__((__unused__)), ...@@ -18,7 +18,7 @@ flush (CACHEFILE cf __attribute__((__unused__)),
bool write_me __attribute__((__unused__)), bool write_me __attribute__((__unused__)),
bool keep_me __attribute__((__unused__)), bool keep_me __attribute__((__unused__)),
bool for_checkpoint __attribute__((__unused__)), bool for_checkpoint __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
assert((long) key.b == size.size); assert((long) key.b == size.size);
if (!keep_me) toku_free(v); if (!keep_me) toku_free(v);
......
...@@ -52,7 +52,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -52,7 +52,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool write_me, bool write_me,
bool keep_me, bool keep_me,
bool checkpoint_me, bool checkpoint_me,
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
int64_t val_to_write = *(int64_t *)v; int64_t val_to_write = *(int64_t *)v;
...@@ -271,10 +271,10 @@ static void *checkpoints(void *arg) { ...@@ -271,10 +271,10 @@ static void *checkpoints(void *arg) {
// //
int r; int r;
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert(r == 0); r = toku_cachetable_begin_checkpoint(cp); assert(r == 0);
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -37,7 +37,7 @@ run_test (void) { ...@@ -37,7 +37,7 @@ run_test (void) {
r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL); r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v2, &s2, def_write_callback(NULL), def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); r = toku_cachetable_begin_checkpoint(cp);
// mark nodes as pending a checkpoint, so that get_and_pin_nonblocking on block 1 will return TOKUDB_TRY_AGAIN // mark nodes as pending a checkpoint, so that get_and_pin_nonblocking on block 1 will return TOKUDB_TRY_AGAIN
r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); assert(r==0); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_CLEAN, make_pair_attr(8)); assert(r==0);
...@@ -60,7 +60,7 @@ run_test (void) { ...@@ -60,7 +60,7 @@ run_test (void) {
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -28,7 +28,7 @@ static void flush( ...@@ -28,7 +28,7 @@ static void flush(
bool write_me, bool write_me,
bool keep_me, bool keep_me,
bool UU(for_checkpoint), bool UU(for_checkpoint),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) )
{ {
// assert(key == make_blocknum((long)value)); // assert(key == make_blocknum((long)value));
......
...@@ -19,7 +19,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -19,7 +19,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
assert(w == false && v != NULL); assert(w == false && v != NULL);
toku_free(v); toku_free(v);
......
...@@ -21,7 +21,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -21,7 +21,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
assert(w == false); assert(w == false);
} }
......
...@@ -26,7 +26,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -26,7 +26,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w, bool w,
bool keep, bool keep,
bool f_ckpt __attribute__((__unused__)), bool f_ckpt __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
assert(w == false); assert(w == false);
sleep(1); sleep(1);
......
...@@ -22,7 +22,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -22,7 +22,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
assert(w == false); assert(w == false);
} }
......
...@@ -55,7 +55,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -55,7 +55,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool write_me, bool write_me,
bool keep_me, bool keep_me,
bool checkpoint_me, bool checkpoint_me,
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
int64_t val_to_write = *(int64_t *)v; int64_t val_to_write = *(int64_t *)v;
size_t data_index = (size_t)k.b; size_t data_index = (size_t)k.b;
...@@ -400,10 +400,10 @@ static void *checkpoints(void *arg) { ...@@ -400,10 +400,10 @@ static void *checkpoints(void *arg) {
// //
int r; int r;
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert(r == 0); r = toku_cachetable_begin_checkpoint(cp); assert(r == 0);
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -22,7 +22,7 @@ static void f_flush (CACHEFILE f, ...@@ -22,7 +22,7 @@ static void f_flush (CACHEFILE f,
bool write_me, bool write_me,
bool keep_me, bool keep_me,
bool for_checkpoint __attribute__((__unused__)), bool for_checkpoint __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
assert(size.size==BLOCKSIZE); assert(size.size==BLOCKSIZE);
if (write_me) { if (write_me) {
......
...@@ -32,7 +32,7 @@ flush ( ...@@ -32,7 +32,7 @@ flush (
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) )
{ {
if (w) usleep(5*1024*1024); if (w) usleep(5*1024*1024);
...@@ -86,7 +86,7 @@ test_clean (enum cachetable_dirty dirty, bool cloneable) { ...@@ -86,7 +86,7 @@ test_clean (enum cachetable_dirty dirty, bool cloneable) {
// begin checkpoint, since pair is clean, we should not // begin checkpoint, since pair is clean, we should not
// have the clone called // have the clone called
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); r = toku_cachetable_begin_checkpoint(cp);
assert_zero(r); assert_zero(r);
struct timeval tstart; struct timeval tstart;
struct timeval tend; struct timeval tend;
...@@ -132,7 +132,7 @@ test_clean (enum cachetable_dirty dirty, bool cloneable) { ...@@ -132,7 +132,7 @@ test_clean (enum cachetable_dirty dirty, bool cloneable) {
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -32,7 +32,7 @@ flush ( ...@@ -32,7 +32,7 @@ flush (
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) )
{ {
if (w && check_flush) { if (w && check_flush) {
...@@ -70,7 +70,7 @@ test_clean (enum cachetable_dirty dirty, bool cloneable) { ...@@ -70,7 +70,7 @@ test_clean (enum cachetable_dirty dirty, bool cloneable) {
// begin checkpoint, since pair is clean, we should not // begin checkpoint, since pair is clean, we should not
// have the clone called // have the clone called
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); r = toku_cachetable_begin_checkpoint(cp);
assert_zero(r); assert_zero(r);
r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL); r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
...@@ -79,7 +79,7 @@ test_clean (enum cachetable_dirty dirty, bool cloneable) { ...@@ -79,7 +79,7 @@ test_clean (enum cachetable_dirty dirty, bool cloneable) {
usleep(2*1024*1024); usleep(2*1024*1024);
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -52,7 +52,7 @@ cachetable_test (void) { ...@@ -52,7 +52,7 @@ cachetable_test (void) {
assert(r==0); assert(r==0);
r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8)); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8));
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert(r == 0); r = toku_cachetable_begin_checkpoint(cp); assert(r == 0);
// now these should fail, because the node should be pending a checkpoint // now these should fail, because the node should be pending a checkpoint
r = toku_cachetable_maybe_get_and_pin(f1, make_blocknum(1), 1, &v1); r = toku_cachetable_maybe_get_and_pin(f1, make_blocknum(1), 1, &v1);
assert(r==-1); assert(r==-1);
...@@ -60,7 +60,7 @@ cachetable_test (void) { ...@@ -60,7 +60,7 @@ cachetable_test (void) {
assert(r==-1); assert(r==-1);
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -25,7 +25,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -25,7 +25,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (verbose) { printf("FLUSH: %d\n", (int)k.b); } if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
...@@ -107,7 +107,7 @@ cachetable_test (bool write_first, bool write_second, bool start_checkpoint) { ...@@ -107,7 +107,7 @@ cachetable_test (bool write_first, bool write_second, bool start_checkpoint) {
// //
// should mark the v1 and v2 as pending // should mark the v1 and v2 as pending
// //
r = toku_cachetable_begin_checkpoint(cp, NULL); assert(r==0); r = toku_cachetable_begin_checkpoint(cp); assert(r==0);
} }
// //
// This call should cause a flush for both // This call should cause a flush for both
...@@ -147,7 +147,7 @@ cachetable_test (bool write_first, bool write_second, bool start_checkpoint) { ...@@ -147,7 +147,7 @@ cachetable_test (bool write_first, bool write_second, bool start_checkpoint) {
if (start_checkpoint) { if (start_checkpoint) {
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -17,7 +17,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -17,7 +17,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
if (w) { if (w) {
assert(c); assert(c);
......
...@@ -24,7 +24,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -24,7 +24,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (verbose) { printf("FLUSH: %d\n", (int)k.b); } if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
...@@ -109,12 +109,12 @@ run_test (void) { ...@@ -109,12 +109,12 @@ run_test (void) {
r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8)); assert(r==0); r = toku_test_cachetable_unpin(f1, make_blocknum(1), 1, CACHETABLE_DIRTY, make_pair_attr(8)); assert(r==0);
// this should mark the PAIR as pending // this should mark the PAIR as pending
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert(r == 0); r = toku_cachetable_begin_checkpoint(cp); assert(r == 0);
r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, PL_WRITE_EXPENSIVE, NULL, NULL); r = toku_cachetable_get_and_pin_nonblocking(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, PL_WRITE_EXPENSIVE, NULL, NULL);
assert(r==TOKUDB_TRY_AGAIN); assert(r==TOKUDB_TRY_AGAIN);
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -26,7 +26,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -26,7 +26,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (verbose) { printf("FLUSH: %d\n", (int)k.b); } if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
...@@ -81,7 +81,7 @@ run_test (void) { ...@@ -81,7 +81,7 @@ run_test (void) {
// now this should mark the pair for checkpoint // now this should mark the pair for checkpoint
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); r = toku_cachetable_begin_checkpoint(cp);
// //
// now we pin the pair again, and verify in flush callback that the pair is being checkpointed // now we pin the pair again, and verify in flush callback that the pair is being checkpointed
...@@ -96,7 +96,7 @@ run_test (void) { ...@@ -96,7 +96,7 @@ run_test (void) {
check_me = false; check_me = false;
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -25,7 +25,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -25,7 +25,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
/* Do nothing */ /* Do nothing */
if (verbose) { printf("FLUSH: %d\n", (int)k.b); } if (verbose) { printf("FLUSH: %d\n", (int)k.b); }
...@@ -112,7 +112,7 @@ cachetable_test (bool write_first, bool write_second, bool start_checkpoint) { ...@@ -112,7 +112,7 @@ cachetable_test (bool write_first, bool write_second, bool start_checkpoint) {
// //
// should mark the v1 and v2 as pending // should mark the v1 and v2 as pending
// //
r = toku_cachetable_begin_checkpoint(cp, NULL); assert(r==0); r = toku_cachetable_begin_checkpoint(cp); assert(r==0);
} }
// //
// This call should cause a flush for both // This call should cause a flush for both
...@@ -156,7 +156,7 @@ cachetable_test (bool write_first, bool write_second, bool start_checkpoint) { ...@@ -156,7 +156,7 @@ cachetable_test (bool write_first, bool write_second, bool start_checkpoint) {
if (start_checkpoint) { if (start_checkpoint) {
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -43,11 +43,11 @@ cachetable_test (void) { ...@@ -43,11 +43,11 @@ cachetable_test (void) {
CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL); CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL); r = toku_cachetable_get_and_pin(f1, make_blocknum(1), 1, &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); assert(r == 0); r = toku_cachetable_begin_checkpoint(cp); assert(r == 0);
r = toku_test_cachetable_unpin_and_remove(f1, make_blocknum(1), remove_key_expect_checkpoint, NULL); r = toku_test_cachetable_unpin_and_remove(f1, make_blocknum(1), remove_key_expect_checkpoint, NULL);
r = toku_cachetable_end_checkpoint( r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
......
...@@ -81,7 +81,7 @@ static void flush_n (CACHEFILE f __attribute__((__unused__)), int UU(fd), CACHEK ...@@ -81,7 +81,7 @@ static void flush_n (CACHEFILE f __attribute__((__unused__)), int UU(fd), CACHEK
PAIR_ATTR* new_size __attribute__((__unused__)), PAIR_ATTR* new_size __attribute__((__unused__)),
bool write_me __attribute__((__unused__)), bool keep_me __attribute__((__unused__)), bool write_me __attribute__((__unused__)), bool keep_me __attribute__((__unused__)),
bool for_checkpoint __attribute__ ((__unused__)), bool for_checkpoint __attribute__ ((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
int *CAST_FROM_VOIDP(v, value); int *CAST_FROM_VOIDP(v, value);
assert(*v==0); assert(*v==0);
...@@ -156,7 +156,7 @@ static void null_flush (CACHEFILE cf __attribute__((__unused__)), ...@@ -156,7 +156,7 @@ static void null_flush (CACHEFILE cf __attribute__((__unused__)),
bool write_me __attribute__((__unused__)), bool write_me __attribute__((__unused__)),
bool keep_me __attribute__((__unused__)), bool keep_me __attribute__((__unused__)),
bool for_checkpoint __attribute__((__unused__)), bool for_checkpoint __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
} }
...@@ -240,7 +240,7 @@ static void test_dirty_flush(CACHEFILE f, ...@@ -240,7 +240,7 @@ static void test_dirty_flush(CACHEFILE f,
bool do_write, bool do_write,
bool keep, bool keep,
bool for_checkpoint __attribute__((__unused__)), bool for_checkpoint __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
if (verbose) printf("test_dirty_flush %p %" PRId64 " %p %ld %u %u\n", f, key.b, value, size.size, (unsigned)do_write, (unsigned)keep); if (verbose) printf("test_dirty_flush %p %" PRId64 " %p %ld %u %u\n", f, key.b, value, size.size, (unsigned)do_write, (unsigned)keep);
} }
...@@ -374,7 +374,7 @@ static void test_size_flush_callback(CACHEFILE f, ...@@ -374,7 +374,7 @@ static void test_size_flush_callback(CACHEFILE f,
bool do_write, bool do_write,
bool keep, bool keep,
bool for_checkpoint __attribute__((__unused__)), bool for_checkpoint __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
if (test_size_debug && verbose) printf("test_size_flush %p %" PRId64 " %p %ld %u %u\n", f, key.b, value, size.size, (unsigned)do_write, (unsigned)keep); if (test_size_debug && verbose) printf("test_size_flush %p %" PRId64 " %p %ld %u %u\n", f, key.b, value, size.size, (unsigned)do_write, (unsigned)keep);
if (keep) { if (keep) {
......
...@@ -17,7 +17,7 @@ static void *run_end_chkpt(void *arg) { ...@@ -17,7 +17,7 @@ static void *run_end_chkpt(void *arg) {
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
int r = toku_cachetable_end_checkpoint( int r = toku_cachetable_end_checkpoint(
cp, cp,
NULL, false,
NULL, NULL,
NULL NULL
); );
...@@ -53,7 +53,7 @@ run_test (void) { ...@@ -53,7 +53,7 @@ run_test (void) {
// now this should mark the pair for checkpoint // now this should mark the pair for checkpoint
CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct); CHECKPOINTER cp = toku_cachetable_get_checkpointer(ct);
r = toku_cachetable_begin_checkpoint(cp, NULL); r = toku_cachetable_begin_checkpoint(cp);
r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL); r = toku_cachetable_get_and_pin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), &v1, &s1, wc, def_fetch, def_pf_req_callback, def_pf_callback, true, NULL);
toku_pthread_t mytid; toku_pthread_t mytid;
......
...@@ -22,7 +22,7 @@ flush (CACHEFILE f __attribute__((__unused__)), ...@@ -22,7 +22,7 @@ flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
if (w) { if (w) {
int curr_size = __sync_fetch_and_sub(&total_size, 1); int curr_size = __sync_fetch_and_sub(&total_size, 1);
......
...@@ -357,7 +357,7 @@ test_prefetching(void) { ...@@ -357,7 +357,7 @@ test_prefetching(void) {
assert(size == 100); assert(size == 100);
} }
FTNODE_DISK_DATA ndd = NULL; FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false); r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false, false);
assert(r==0); assert(r==0);
test_prefetch_read(fd, brt, brt_h); test_prefetch_read(fd, brt, brt_h);
......
...@@ -302,7 +302,7 @@ test_serialize_nonleaf(void) { ...@@ -302,7 +302,7 @@ test_serialize_nonleaf(void) {
assert(size == 100); assert(size == 100);
} }
FTNODE_DISK_DATA ndd = NULL; FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false); r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false, false);
assert(r==0); assert(r==0);
test1(fd, brt_h, &dn); test1(fd, brt_h, &dn);
...@@ -390,7 +390,7 @@ test_serialize_leaf(void) { ...@@ -390,7 +390,7 @@ test_serialize_leaf(void) {
assert(size == 100); assert(size == 100);
} }
FTNODE_DISK_DATA ndd = NULL; FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false); r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false, false);
assert(r==0); assert(r==0);
test1(fd, brt_h, &dn); test1(fd, brt_h, &dn);
......
...@@ -139,7 +139,7 @@ test_serialize_leaf(int valsize, int nelts, double entropy) { ...@@ -139,7 +139,7 @@ test_serialize_leaf(int valsize, int nelts, double entropy) {
struct timeval t[2]; struct timeval t[2];
gettimeofday(&t[0], NULL); gettimeofday(&t[0], NULL);
FTNODE_DISK_DATA ndd = NULL; FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, &ndd, true, brt->ft, false); r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, &ndd, true, brt->ft, false, false);
assert(r==0); assert(r==0);
gettimeofday(&t[1], NULL); gettimeofday(&t[1], NULL);
double dt; double dt;
...@@ -269,7 +269,7 @@ test_serialize_nonleaf(int valsize, int nelts, double entropy) { ...@@ -269,7 +269,7 @@ test_serialize_nonleaf(int valsize, int nelts, double entropy) {
struct timeval t[2]; struct timeval t[2];
gettimeofday(&t[0], NULL); gettimeofday(&t[0], NULL);
FTNODE_DISK_DATA ndd = NULL; FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false); r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, true, brt->ft, false, false);
assert(r==0); assert(r==0);
gettimeofday(&t[1], NULL); gettimeofday(&t[1], NULL);
double dt; double dt;
......
...@@ -191,12 +191,12 @@ static void write_sn_to_disk(int fd, FT_HANDLE brt, FTNODE sn, FTNODE_DISK_DATA* ...@@ -191,12 +191,12 @@ static void write_sn_to_disk(int fd, FT_HANDLE brt, FTNODE sn, FTNODE_DISK_DATA*
PAIR_ATTR attr; PAIR_ATTR attr;
toku_ftnode_clone_callback(sn, &cloned_node_v, &attr, false, brt->ft); toku_ftnode_clone_callback(sn, &cloned_node_v, &attr, false, brt->ft);
FTNODE CAST_FROM_VOIDP(cloned_node, cloned_node_v); FTNODE CAST_FROM_VOIDP(cloned_node, cloned_node_v);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), cloned_node, src_ndd, false, brt->ft, false); r = toku_serialize_ftnode_to(fd, make_blocknum(20), cloned_node, src_ndd, false, brt->ft, false, false);
assert(r==0); assert(r==0);
toku_ftnode_free(&cloned_node); toku_ftnode_free(&cloned_node);
} }
else { else {
r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, src_ndd, true, brt->ft, false); r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, src_ndd, true, brt->ft, false, false);
assert(r==0); assert(r==0);
} }
} }
......
...@@ -127,7 +127,7 @@ def_flush (CACHEFILE f __attribute__((__unused__)), ...@@ -127,7 +127,7 @@ def_flush (CACHEFILE f __attribute__((__unused__)),
bool w __attribute__((__unused__)), bool w __attribute__((__unused__)),
bool keep __attribute__((__unused__)), bool keep __attribute__((__unused__)),
bool c __attribute__((__unused__)), bool c __attribute__((__unused__)),
bool UU(is_clone) bool UU(is_clone), bool UU(aggressive)
) { ) {
} }
......
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