Commit 9e015609 authored by Christian Rober's avatar Christian Rober Committed by Yoni Fogel

refs #5372 Removed checks for CACHEFILE callbacks. Replaced with asserts.

git-svn-id: file:///svn/toku/tokudb@47780 c7de825b-a66e-492c-adef-691d508d4ae1
parent cb85dc67
......@@ -4246,7 +4246,8 @@ void checkpointer::update_cachefiles() {
int r = 0;
CACHEFILE cf;
for(cf = m_cf_list->m_head; cf; cf=cf->next) {
if (cf->for_checkpoint && cf->begin_checkpoint_userdata) {
assert(cf->begin_checkpoint_userdata);
if (cf->for_checkpoint) {
r = cf->begin_checkpoint_userdata(m_lsn_of_checkpoint_in_progress,
cf->userdata);
assert(r == 0);
......@@ -4273,10 +4274,9 @@ int checkpointer::begin_checkpoint() {
// Putting this check here so that this method may be called
// by cachetable tests.
if (cf->note_pin_by_checkpoint) {
assert(cf->note_pin_by_checkpoint);
r = cf->note_pin_by_checkpoint(cf, cf->userdata);
assert(r == 0);
}
cf->for_checkpoint = true;
m_checkpoint_num_files++;
}
......@@ -4330,11 +4330,10 @@ void checkpointer::log_begin_checkpoint() {
// Log the list of open dictionaries.
for (CACHEFILE cf = m_cf_list->m_head; cf; cf = cf->next) {
if (cf->log_fassociate_during_checkpoint) {
assert(cf->log_fassociate_during_checkpoint);
r = cf->log_fassociate_during_checkpoint(cf, cf->userdata);
assert(r == 0);
}
}
// Write open transactions to the log.
r = toku_txn_manager_iter_over_live_txns<checkpointer, log_open_txn> (
......@@ -4345,11 +4344,10 @@ void checkpointer::log_begin_checkpoint() {
// Writes list of dictionaries that have had
// rollback logs suppressed.
for (CACHEFILE cf = m_cf_list->m_head; cf; cf = cf->next) {
if (cf->log_suppress_rollback_during_checkpoint) {
assert(cf->log_suppress_rollback_during_checkpoint);
r = cf->log_suppress_rollback_during_checkpoint(cf, cf->userdata);
assert(r == 0);
}
}
}
//
......@@ -4456,13 +4454,12 @@ void checkpointer::checkpoint_userdata(CACHEFILE* checkpoint_cfs) {
for (uint32_t i = 0; i < m_checkpoint_num_files; i++) {
CACHEFILE cf = checkpoint_cfs[i];
assert(cf->for_checkpoint);
if (cf->checkpoint_userdata) {
assert(cf->checkpoint_userdata);
toku_cachetable_set_checkpointing_user_data_status(1);
int r = cf->checkpoint_userdata(cf, cf->fd, cf->userdata);
toku_cachetable_set_checkpointing_user_data_status(0);
assert(r==0);
}
}
}
void checkpointer::log_end_checkpoint() {
......@@ -4486,11 +4483,10 @@ void checkpointer::end_checkpoint_userdata(CACHEFILE* checkpoint_cfs) {
for (uint32_t i = 0; i < m_checkpoint_num_files; i++) {
CACHEFILE cf = checkpoint_cfs[i];
assert(cf->for_checkpoint);
if (cf->end_checkpoint_userdata) {
assert(cf->end_checkpoint_userdata);
int r = cf->end_checkpoint_userdata(cf, cf->fd, cf->userdata);
assert(r==0);
}
}
}
//
......@@ -4505,14 +4501,13 @@ int checkpointer::remove_cachefiles(CACHEFILE* checkpoint_cfs) {
// can be called from cachetable tests.
assert(cf->for_checkpoint);
cf->for_checkpoint = false;
if (cf->note_unpin_by_checkpoint) {
assert(cf->note_unpin_by_checkpoint);
// Clear the bit saying theis file is in the checkpoint.
r = cf->note_unpin_by_checkpoint(cf, cf->userdata);
if (r != 0) {
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