Commit 044e12fa authored by Yoni Fogel's avatar Yoni Fogel

refs #5197 Fix a couple of bugs (off by true, and missing braces around if...

refs #5197 Fix a couple of bugs (off by true, and missing braces around if statement) with not reserving memory for put-loader
Also only call toku_txn_require_checkpoint_on_commit(tokutxn) once (instead of N times)

git-svn-id: file:///svn/toku/tokudb@45351 c7de825b-a66e-492c-adef-691d508d4ae1
parent 7b7fa62b
...@@ -374,9 +374,10 @@ void toku_ft_loader_internal_destroy (FTLOADER bl, BOOL is_error) { ...@@ -374,9 +374,10 @@ void toku_ft_loader_internal_destroy (FTLOADER bl, BOOL is_error) {
toku_free(bl->fractal_queues); toku_free(bl->fractal_queues);
toku_free(bl->fractal_threads_live); toku_free(bl->fractal_threads_live);
if (bl->did_reserve_memory) if (bl->did_reserve_memory) {
invariant(bl->cachetable); invariant(bl->cachetable);
toku_cachetable_release_reserved_memory(bl->cachetable, bl->reserved_memory); toku_cachetable_release_reserved_memory(bl->cachetable, bl->reserved_memory);
}
ft_loader_destroy_error_callback(&bl->error_callback); ft_loader_destroy_error_callback(&bl->error_callback);
ft_loader_destroy_poll_callback(&bl->poll_callback); ft_loader_destroy_poll_callback(&bl->poll_callback);
......
...@@ -479,20 +479,18 @@ build_index(DB_INDEXER *indexer) { ...@@ -479,20 +479,18 @@ build_index(DB_INDEXER *indexer) {
} }
// Clients must not operate on any of the hot dbs concurrently with close // Clients must not operate on any of the hot dbs concurrently with close
static int static int
close_indexer(DB_INDEXER *indexer) { close_indexer(DB_INDEXER *indexer) {
int r = 0; int r = 0;
(void) __sync_fetch_and_sub(&STATUS_VALUE(INDEXER_CURRENT), 1); (void) __sync_fetch_and_sub(&STATUS_VALUE(INDEXER_CURRENT), 1);
// Mark txn as needing a checkpoint. // Mark txn as needing a checkpoint.
// (This will cause a checkpoint, which is necessary // (This will cause a checkpoint, which is necessary
// because these files are not necessarily on disk and all the operations // because these files are not necessarily on disk and all the operations
// to create them are not in the recovery log.) // to create them are not in the recovery log.)
DB_TXN *txn = indexer->i->txn; DB_TXN *txn = indexer->i->txn;
TOKUTXN tokutxn = db_txn_struct_i(txn)->tokutxn; TOKUTXN tokutxn = db_txn_struct_i(txn)->tokutxn;
for (int which_db = 0; which_db < indexer->i->N ; which_db++) { toku_txn_require_checkpoint_on_commit(tokutxn);
toku_txn_require_checkpoint_on_commit(tokutxn);
}
// Disassociate the indexer from the hot db and free_indexer // Disassociate the indexer from the hot db and free_indexer
disassociate_indexer_from_hot_dbs(indexer); disassociate_indexer_from_hot_dbs(indexer);
......
...@@ -274,7 +274,7 @@ int toku_loader_create_loader(DB_ENV *env, ...@@ -274,7 +274,7 @@ int toku_loader_create_loader(DB_ENV *env,
loader->i->temp_file_template, loader->i->temp_file_template,
load_lsn, load_lsn,
ttxn, ttxn,
use_puts); !use_puts);
if ( r!=0 ) { if ( r!=0 ) {
toku_free(new_inames_in_env); toku_free(new_inames_in_env);
toku_free(brts); toku_free(brts);
......
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