Commit a522ceda authored by Yoni Fogel's avatar Yoni Fogel

Closes #2153 refs[t:2153] fopen logged only once (unless closed and reopened)....

Closes #2153 refs[t:2153] fopen logged only once (unless closed and reopened).  Removed logger from cachefile_close,
removed txnid from logging of fopen.

git-svn-id: file:///svn/toku/tokudb.2037b@15691 c7de825b-a66e-492c-adef-691d508d4ae1
parent 28752b83
......@@ -236,7 +236,7 @@ struct brtenv {
extern void toku_brtnode_flush_callback (CACHEFILE cachefile, BLOCKNUM nodename, void *brtnode_v, void *extraargs, long size, BOOL write_me, BOOL keep_me, BOOL for_checkpoint);
extern int toku_brtnode_fetch_callback (CACHEFILE cachefile, BLOCKNUM nodename, u_int32_t fullhash, void **brtnode_pv, long *sizep, void*extraargs);
extern int toku_brt_alloc_init_header(BRT t);
extern int toku_read_brt_header_and_store_in_cachefile (CACHEFILE cf, struct brt_header **header);
extern int toku_read_brt_header_and_store_in_cachefile (CACHEFILE cf, struct brt_header **header, BOOL* was_open);
extern CACHEKEY* toku_calculate_root_offset_pointer (BRT brt, u_int32_t *root_hash);
static const BRTNODE null_brtnode=0;
......
......@@ -5,9 +5,10 @@
#include "includes.h"
#include "ule.h"
BOOL ignore_if_was_already_open;
int toku_testsetup_leaf(BRT brt, BLOCKNUM *blocknum) {
BRTNODE node;
int r = toku_read_brt_header_and_store_in_cachefile(brt->cf, &brt->h);
int r = toku_read_brt_header_and_store_in_cachefile(brt->cf, &brt->h, &ignore_if_was_already_open);
if (r!=0) return r;
toku_create_new_brtnode(brt, &node, 0, 0);
......@@ -21,7 +22,7 @@ int toku_testsetup_leaf(BRT brt, BLOCKNUM *blocknum) {
int toku_testsetup_nonleaf (BRT brt, int height, BLOCKNUM *blocknum, int n_children, BLOCKNUM *children, u_int32_t *subtree_fingerprints, char **keys, int *keylens) {
BRTNODE node;
assert(n_children<=BRT_FANOUT);
int r = toku_read_brt_header_and_store_in_cachefile(brt->cf, &brt->h);
int r = toku_read_brt_header_and_store_in_cachefile(brt->cf, &brt->h, &ignore_if_was_already_open);
if (r!=0) return r;
toku_create_new_brtnode(brt, &node, height, 0);
node->u.n.n_children=n_children;
......@@ -46,7 +47,7 @@ int toku_testsetup_nonleaf (BRT brt, int height, BLOCKNUM *blocknum, int n_child
}
int toku_testsetup_root(BRT brt, BLOCKNUM blocknum) {
int r = toku_read_brt_header_and_store_in_cachefile(brt->cf, &brt->h);
int r = toku_read_brt_header_and_store_in_cachefile(brt->cf, &brt->h, &ignore_if_was_already_open);
if (r!=0) return r;
brt->h->root = blocknum;
brt->h->root_hash.valid = FALSE;
......
......@@ -2950,7 +2950,7 @@ int toku_brt_alloc_init_header(BRT t) {
return r;
}
int toku_read_brt_header_and_store_in_cachefile (CACHEFILE cf, struct brt_header **header)
int toku_read_brt_header_and_store_in_cachefile (CACHEFILE cf, struct brt_header **header, BOOL* was_open)
// If the cachefile already has the header, then just get it.
// If the cachefile has not been initialized, then don't modify anything.
{
......@@ -2958,9 +2958,11 @@ int toku_read_brt_header_and_store_in_cachefile (CACHEFILE cf, struct brt_header
struct brt_header *h;
if ((h=toku_cachefile_get_userdata(cf))!=0) {
*header = h;
*was_open = TRUE;
return 0;
}
}
*was_open = FALSE;
struct brt_header *h;
int r = toku_deserialize_brtheader_from(toku_cachefile_fd(cf), &h);
if (r!=0) return r;
......@@ -3082,7 +3084,7 @@ int toku_brt_open(BRT t, const char *fname, const char *fname_in_env, int is_cre
}
if (r!=0) {
died_after_open:
toku_cachefile_close(&t->cf, toku_txn_logger(txn), 0, FALSE, ZERO_LSN);
toku_cachefile_close(&t->cf, 0, FALSE, ZERO_LSN);
goto died1;
}
assert(t->nodesize>0);
......@@ -3091,8 +3093,9 @@ int toku_brt_open(BRT t, const char *fname, const char *fname_in_env, int is_cre
died_after_read_and_pin:
goto died_after_open;
}
BOOL was_already_open;
if (is_create) {
r = toku_read_brt_header_and_store_in_cachefile(t->cf, &t->h);
r = toku_read_brt_header_and_store_in_cachefile(t->cf, &t->h, &was_already_open);
if (r==TOKUDB_DICTIONARY_NO_HEADER) {
r = toku_brt_alloc_init_header(t);
if (r != 0) goto died_after_read_and_pin;
......@@ -3107,7 +3110,7 @@ int toku_brt_open(BRT t, const char *fname, const char *fname_in_env, int is_cre
}
else goto found_it;
} else {
if ((r = toku_read_brt_header_and_store_in_cachefile(t->cf, &t->h))!=0) goto died_after_open;
if ((r = toku_read_brt_header_and_store_in_cachefile(t->cf, &t->h, &was_already_open))!=0) goto died_after_open;
found_it:
t->nodesize = t->h->nodesize; /* inherit the pagesize from the file */
if (!t->did_set_flags) {
......@@ -3121,7 +3124,7 @@ int toku_brt_open(BRT t, const char *fname, const char *fname_in_env, int is_cre
}
}
}
if (log_fopen) {
if (log_fopen && !was_already_open) { //Only log the fopen that OPENs the file. If it was already open, don't log.
r = toku_logger_log_fopen(txn, fname_in_env, toku_cachefile_filenum(t->cf), t->flags);
if (r!=0) goto died_after_read_and_pin;
}
......@@ -3404,7 +3407,7 @@ toku_brt_db_delay_closed (BRT zombie, DB* db, int (*close_db)(DB*, u_int32_t), u
return r;
}
int toku_close_brt_lsn (BRT brt, TOKULOGGER logger, char **error_string, BOOL oplsn_valid, LSN oplsn) {
int toku_close_brt_lsn (BRT brt, char **error_string, BOOL oplsn_valid, LSN oplsn) {
assert(toku_omt_size(brt->txns)==0);
int r;
while (!toku_list_empty(&brt->cursors)) {
......@@ -3425,7 +3428,7 @@ int toku_close_brt_lsn (BRT brt, TOKULOGGER logger, char **error_string, BOOL op
//printf("%s:%d closing cachetable\n", __FILE__, __LINE__);
// printf("%s:%d brt=%p ,brt->h=%p\n", __FILE__, __LINE__, brt, brt->h);
if (error_string) assert(*error_string == 0);
r = toku_cachefile_close(&brt->cf, logger, error_string, oplsn_valid, oplsn);
r = toku_cachefile_close(&brt->cf, error_string, oplsn_valid, oplsn);
if (r==0 && error_string) assert(*error_string == 0);
}
if (brt->temp_descriptor.dbt.data) toku_free(brt->temp_descriptor.dbt.data);
......@@ -3433,8 +3436,8 @@ int toku_close_brt_lsn (BRT brt, TOKULOGGER logger, char **error_string, BOOL op
return r;
}
int toku_close_brt (BRT brt, TOKULOGGER logger, char **error_string) {
return toku_close_brt_lsn(brt, logger, error_string, FALSE, ZERO_LSN);
int toku_close_brt (BRT brt, char **error_string) {
return toku_close_brt_lsn(brt, error_string, FALSE, ZERO_LSN);
}
int toku_brt_create(BRT *brt_ptr) {
......@@ -5138,7 +5141,7 @@ int toku_brt_remove_now(CACHETABLE ct, DBT* iname_dbt_p, DBT* iname_within_cwd_d
char *error_string = NULL;
r = toku_cachefile_redirect_nullfd(cf);
assert(r==0);
r = toku_cachefile_close(&cf, toku_cachefile_logger(cf), &error_string, FALSE, ZERO_LSN);
r = toku_cachefile_close(&cf, &error_string, FALSE, ZERO_LSN);
assert(r==0);
}
else
......
......@@ -77,8 +77,8 @@ int toku_brt_delete_both (BRT brt, DBT *k, DBT *v, TOKUTXN txn);
int toku_brt_maybe_delete_both (BRT brt, DBT *k, DBT *v, TOKUTXN txn, BOOL oplsn_valid, LSN oplsn);
int toku_brt_db_delay_closed (BRT brt, DB* db, int (*close_db)(DB*, u_int32_t), u_int32_t close_flags);
int toku_close_brt (BRT, TOKULOGGER, char **error_string);
int toku_close_brt_lsn (BRT brt, TOKULOGGER logger, char **error_string, BOOL oplsn_valid, LSN oplsn);
int toku_close_brt (BRT, char **error_string);
int toku_close_brt_lsn (BRT brt, char **error_string, BOOL oplsn_valid, LSN oplsn);
int toku_brt_set_panic(BRT brt, int panic, char *panic_string);
......
......@@ -660,7 +660,7 @@ static void remove_cf_from_cachefiles_list (CACHEFILE cf) {
static int cachetable_flush_cachefile (CACHETABLE, CACHEFILE cf);
int toku_cachefile_close (CACHEFILE *cfp, TOKULOGGER logger, char **error_string, BOOL oplsn_valid, LSN oplsn) {
int toku_cachefile_close (CACHEFILE *cfp, char **error_string, BOOL oplsn_valid, LSN oplsn) {
CACHEFILE cf = *cfp;
CACHETABLE ct = cf->cachetable;
......@@ -750,11 +750,6 @@ int toku_cachefile_close (CACHEFILE *cfp, TOKULOGGER logger, char **error_string
r = close(cf->fd);
assert(r == 0);
cf->fd = -1;
if (logger) {
//assert(cf->fname);
//BYTESTRING bs = {.len=strlen(cf->fname), .data=cf->fname};
//r = toku_log_cfclose(logger, 0, 0, bs, cf->filenum);
}
if (cf->fname_relative_to_env) toku_free(cf->fname_relative_to_env);
toku_free(cf);
......@@ -2000,7 +1995,7 @@ toku_cachetable_end_checkpoint(CACHETABLE ct, TOKULOGGER logger, char **error_st
ct->cachefiles_in_checkpoint = cf->next_in_checkpoint;
cf->next_in_checkpoint = NULL;
cf->for_checkpoint = FALSE;
int r = toku_cachefile_close(&cf, logger, error_string, FALSE, ZERO_LSN);
int r = toku_cachefile_close(&cf, error_string, FALSE, ZERO_LSN);
if (r!=0) {
retval = r;
goto panic;
......
......@@ -181,7 +181,7 @@ int toku_cachetable_rename (CACHEFILE cachefile, CACHEKEY oldkey, CACHEKEY newke
// object is freed.
// If oplsn_valid is TRUE then use oplsn as the LSN of the close instead of asking the logger. oplsn_valid being TRUE is only allowed during recovery, and requires that you are removing the last reference (otherwise the lsn wouldn't make it in.)
// Returns: 0 if success, otherwise returns an error number.
int toku_cachefile_close (CACHEFILE*, TOKULOGGER, char **error_string, BOOL oplsn_valid, LSN oplsn);
int toku_cachefile_close (CACHEFILE*, char **error_string, BOOL oplsn_valid, LSN oplsn);
// Flush the cachefile.
// Effect: Flush everything owned by the cachefile from the cachetable. All dirty
......
......@@ -126,8 +126,7 @@ const struct logtype logtypes[] = {
{"BYTESTRING", "descriptor", 0},
NULLFIELD}},
//TODO: #2037 Add dname
{"fopen", 'O', FA{{"TXNID", "txnid", 0},
{"BYTESTRING", "iname", 0},
{"fopen", 'O', FA{{"BYTESTRING", "iname", 0},
{"FILENUM", "filenum", 0},
{"u_int32_t", "treeflags", 0},
NULLFIELD}},
......
......@@ -594,7 +594,7 @@ int toku_logger_log_fopen (TOKUTXN txn, const char * fname, FILENUM filenum, uin
BYTESTRING bs;
bs.len = strlen(fname);
bs.data = (char*)fname;
return toku_log_fopen (txn->logger, (LSN*)0, 0, toku_txn_get_txnid(txn), bs, filenum, treeflags);
return toku_log_fopen (txn->logger, (LSN*)0, 0, bs, filenum, treeflags);
}
static int toku_fread_u_int8_t_nocrclen (FILE *f, u_int8_t *v) {
......
......@@ -83,7 +83,7 @@ static void file_map_close_dictionaries(struct file_map *fmap, BOOL recovery_suc
//Logging is already back on. No need to pass LSN into close.
char *error_string = NULL;
DB *fake_db = tuple->brt->db; //Need to free the fake db that was malloced
r = toku_close_brt(tuple->brt, NULL, &error_string);
r = toku_close_brt(tuple->brt, &error_string);
if (!recovery_succeeded) {
printf("%s:%d %d %s\n", __FUNCTION__, __LINE__, r, error_string);
assert(r != 0);
......@@ -323,7 +323,7 @@ static int internal_toku_recover_fopen_or_fcreate (RECOVER_ENV renv, int flags,
close_brt:;
//Note: If brt_open fails, then close_brt will NOT write a header to disk.
//No need to provide lsn
int rr = toku_close_brt(brt, NULL, NULL); assert(rr == 0);
int rr = toku_close_brt(brt, NULL); assert(rr == 0);
toku_free(fixedfname);
toku_free(fake_db); //Free memory allocated for the fake db.
return r;
......@@ -348,7 +348,7 @@ static int toku_recover_backward_fopen (struct logtype_fopen *l, RECOVER_ENV ren
//The only way this should be dirty, is if its doing a file-format upgrade.
//If not dirty, header will not be written.
DB *fake_db = tuple->brt->db; //Need to free the fake db that was malloced
r = toku_close_brt_lsn(tuple->brt, 0, 0, TRUE, tuple->brt->h->checkpoint_lsn);
r = toku_close_brt_lsn(tuple->brt, 0, TRUE, tuple->brt->h->checkpoint_lsn);
assert(r == 0);
toku_free(fake_db); //Must free the DB after the brt is closed
file_map_remove(&renv->fmap, l->filenum);
......@@ -489,7 +489,7 @@ static int toku_recover_fclose (struct logtype_fclose *l, RECOVER_ENV UU(renv))
assert(strcmp(tuple->fname, fixedfname) == 0);
toku_free(fixedfname);
DB *fake_db = tuple->brt->db; //Need to free the fake db that was malloced
r = toku_close_brt_lsn(tuple->brt, 0, 0, TRUE, l->lsn);
r = toku_close_brt_lsn(tuple->brt, 0, TRUE, l->lsn);
assert(r == 0);
toku_free(fake_db); //Must free the DB after the brt is closed
file_map_remove(&renv->fmap, l->filenum);
......
......@@ -36,7 +36,7 @@ toku_commit_fdelete (u_int8_t file_was_open,
r = toku_cachefile_redirect_nullfd(cf);
assert(r==0);
char *error_string = NULL;
r = toku_cachefile_close(&cf, txn->logger, &error_string, TRUE, oplsn);
r = toku_cachefile_close(&cf, &error_string, TRUE, oplsn);
assert(r==0);
}
r = unlink(fname); // pathname relative to cwd
......@@ -64,7 +64,7 @@ toku_rollback_fdelete (u_int8_t UU(file_was_open),
assert(r == 0);
char *error_string = NULL;
// decrement refcount that was incremented in toku_brt_remove_on_commit()
r = toku_cachefile_close(&cf, txn->logger, &error_string, TRUE, oplsn);
r = toku_cachefile_close(&cf, &error_string, TRUE, oplsn);
assert(r==0);
}
return r;
......
......@@ -36,7 +36,7 @@ static void setup (void) {
static void toku_shutdown (void) {
int r;
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
static void long_long_to_array (unsigned char *a, unsigned long long l) {
......
......@@ -42,7 +42,7 @@ static void test_sub_block(int n) {
}
// write to the file
error = toku_close_brt(brt, 0, 0);
error = toku_close_brt(brt, 0);
assert(error == 0);
// verify the brt by walking a cursor through the rows
......@@ -69,7 +69,7 @@ static void test_sub_block(int n) {
error = toku_brt_cursor_close(cursor);
assert(error == 0);
error = toku_close_brt(brt, 0, 0);
error = toku_close_brt(brt, 0);
assert(error == 0);
error = toku_cachetable_close(&ct);
......
......@@ -82,7 +82,7 @@ static void test_multiple_brt_cursor_dbts(int n, DB *db) {
toku_free(ptrs[i]);
}
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......
......@@ -110,7 +110,7 @@ static void test_brt_cursor_first(int n, DB *db) {
else
assert_cursor_value(brt, DB_FIRST, 0);
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -151,7 +151,7 @@ static void test_brt_cursor_last(int n, DB *db) {
else
assert_cursor_value(brt, DB_LAST, n-1);
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -194,7 +194,7 @@ static void test_brt_cursor_first_last(int n, DB *db) {
} else
assert_cursor_first_last(brt, 0, n-1);
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -238,7 +238,7 @@ static void test_brt_cursor_rfirst(int n, DB *db) {
else
assert_cursor_value(brt, DB_FIRST, 0);
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -303,7 +303,7 @@ static void test_brt_cursor_walk(int n, DB *db) {
/* walk the tree */
assert_cursor_walk(brt, n);
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -369,7 +369,7 @@ static void test_brt_cursor_rwalk(int n, DB *db) {
/* walk the tree */
assert_cursor_rwalk(brt, n);
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -465,7 +465,7 @@ static void test_brt_cursor_rand(int n, DB *db) {
/* walk the tree */
assert_cursor_walk_inorder(brt, n);
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -544,7 +544,7 @@ static void test_brt_cursor_split(int n, DB *db) {
r = toku_brt_cursor_close(cursor);
assert(r==0);
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -578,7 +578,7 @@ static void test_multiple_brt_cursors(int n, DB *db) {
assert(r == 0);
}
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -670,7 +670,7 @@ static void test_multiple_brt_cursor_walk(int n, DB *db) {
assert(r == 0);
}
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -742,7 +742,7 @@ static void test_brt_cursor_set(int n, int cursor_op, DB *db) {
r = toku_brt_cursor_close(cursor);
assert(r==0);
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -806,7 +806,7 @@ static void test_brt_cursor_set_range(int n, DB *db) {
r = toku_brt_cursor_close(cursor);
assert(r==0);
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
r = toku_cachetable_close(&ct);
......@@ -867,7 +867,7 @@ static void test_brt_cursor_delete(int n, DB *db) {
error = toku_brt_cursor_close(cursor);
assert(error == 0);
error = toku_close_brt(brt, 0, 0);
error = toku_close_brt(brt, 0);
assert(error == 0);
error = toku_cachetable_close(&ct);
......@@ -987,7 +987,7 @@ static void test_brt_cursor_get_both(int n, DB *db) {
error = toku_brt_cursor_close(cursor);
assert(error == 0);
error = toku_close_brt(brt, 0, 0);
error = toku_close_brt(brt, 0);
assert(error == 0);
error = toku_cachetable_close(&ct);
......
......@@ -20,7 +20,7 @@ static void test_dump_empty_db (void) {
r = toku_open_brt(fname, 1, &t, 1024, ct, null_txn, toku_builtin_compare_fun, null_db);
assert(r==0);
if (verbose) toku_dump_brt(stdout, t);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
}
......@@ -54,8 +54,8 @@ static void test_multiple_files_of_size (int size) {
toku_verify_brt(t0);
toku_verify_brt(t1);
r = toku_close_brt(t0, 0, 0); assert(r==0);
r = toku_close_brt(t1, 0, 0); assert(r==0);
r = toku_close_brt(t0, 0); assert(r==0);
r = toku_close_brt(t1, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
......@@ -75,8 +75,8 @@ static void test_multiple_files_of_size (int size) {
brt_lookup_and_check_nodup(t1, key, val);
}
r = toku_close_brt(t0, 0, 0); assert(r==0);
r = toku_close_brt(t1, 0, 0); assert(r==0);
r = toku_close_brt(t0, 0); assert(r==0);
r = toku_close_brt(t1, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
}
......@@ -114,7 +114,7 @@ static void test_multiple_brts_one_db_one_file (void) {
brt_lookup_and_check_nodup(trees[0], k, vexpect);
}
for (i=0; i<MANYN; i++) {
r=toku_close_brt(trees[i], 0, 0); assert(r==0);
r=toku_close_brt(trees[i], 0); assert(r==0);
}
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
......@@ -136,7 +136,7 @@ static void test_read_what_was_written (void) {
r = toku_brt_create_cachetable(&ct, 0, ZERO_LSN, NULL_LOGGER); assert(r==0);
r = toku_open_brt(fname, 1, &brt, 1<<12, ct, null_txn, toku_builtin_compare_fun, null_db); assert(r==0);
r = toku_close_brt(brt, 0, 0); assert(r==0);
r = toku_close_brt(brt, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
......@@ -151,7 +151,7 @@ static void test_read_what_was_written (void) {
toku_brt_insert(brt, toku_fill_dbt(&k, "hello", 6), toku_fill_dbt(&v, "there", 6), null_txn);
}
r = toku_close_brt(brt, 0, 0); assert(r==0);
r = toku_close_brt(brt, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
......@@ -212,7 +212,7 @@ static void test_read_what_was_written (void) {
}
}
r = toku_close_brt(brt, 0, 0); assert(r==0);
r = toku_close_brt(brt, 0); assert(r==0);
if (verbose) printf("%s:%d About to close %p\n", __FILE__, __LINE__, ct);
r = toku_cachetable_close(&ct); assert(r==0);
......@@ -232,7 +232,7 @@ static void test_read_what_was_written (void) {
}
}
r = toku_close_brt(brt, 0, 0); assert(r==0);
r = toku_close_brt(brt, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
......@@ -268,7 +268,7 @@ static void test_cursor_last_empty(void) {
assert(pair.call_count==0);
assert(r==DB_NOTFOUND);
}
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
//printf("%s:%d %d alloced\n", __FILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
r = toku_cachetable_close(&ct); assert(r==0);
//printf("%s:%d %d alloced\n", __FILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
......@@ -319,7 +319,7 @@ static void test_cursor_next (void) {
assert(pair.call_count==0);
}
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
//printf("%s:%d %d alloced\n", __FILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
r = toku_cachetable_close(&ct); assert(r==0);
//printf("%s:%d %d alloced\n", __FILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
......@@ -398,7 +398,7 @@ static void test_wrongendian_compare (int wrong_p, unsigned int N) {
}
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
}
}
......@@ -438,7 +438,7 @@ static void test_wrongendian_compare (int wrong_p, unsigned int N) {
toku_cachetable_verify(ct);
}
r = toku_close_brt(brt, 0, 0);
r = toku_close_brt(brt, 0);
assert(r==0);
}
r = toku_cachetable_close(&ct); assert(r==0);
......@@ -475,7 +475,7 @@ static void test_large_kv(int bsize, int ksize, int vsize) {
toku_free(k);
toku_free(v);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......@@ -514,7 +514,7 @@ static void test_brt_delete_empty(void) {
r = toku_brt_delete(t, &key, null_txn);
assert(r == 0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......@@ -580,7 +580,7 @@ static void test_brt_delete_present(int n) {
r = toku_brt_cursor_close(cursor);
assert(r == 0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......@@ -626,7 +626,7 @@ static void test_brt_delete_not_present(int n) {
return value depends */
if (verbose) printf("toku_brt_delete k=%d %d\n", k, r);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......@@ -713,7 +713,7 @@ static void test_brt_delete_cursor_first(int n) {
r = toku_brt_cursor_close(cursor);
assert(r == 0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......@@ -764,7 +764,7 @@ static void test_insert_delete_lookup(int n) {
}
}
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......@@ -836,7 +836,7 @@ static void test_brt_delete_both(int n) {
r = toku_brt_cursor_close(cursor); assert(r == 0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......@@ -873,7 +873,7 @@ static void test_new_brt_cursor_create_close (void) {
r = toku_brt_cursor_close(cursors[i]); assert(r == 0);
}
r = toku_close_brt(brt, 0, 0); assert(r == 0);
r = toku_close_brt(brt, 0); assert(r == 0);
}
static void test_new_brt_cursor_first(int n, int dup_mode) {
......@@ -925,7 +925,7 @@ static void test_new_brt_cursor_first(int n, int dup_mode) {
if (val.data) toku_free(val.data);
r = toku_brt_cursor_close(cursor); assert(r == 0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct);assert(r==0);
}
......@@ -979,7 +979,7 @@ static void test_new_brt_cursor_last(int n, int dup_mode) {
if (val.data) toku_free(val.data);
r = toku_brt_cursor_close(cursor); assert(r == 0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct);assert(r==0);
}
......@@ -1023,7 +1023,7 @@ static void test_new_brt_cursor_next(int n, int dup_mode) {
assert(i == n);
r = toku_brt_cursor_close(cursor); assert(r == 0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct);assert(r==0);
}
......@@ -1067,7 +1067,7 @@ static void test_new_brt_cursor_prev(int n, int dup_mode) {
assert(i == -1);
r = toku_brt_cursor_close(cursor); assert(r == 0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct);assert(r==0);
}
......@@ -1150,7 +1150,7 @@ static void test_new_brt_cursor_current(int n, int dup_mode) {
assert(i == n);
r = toku_brt_cursor_close(cursor); assert(r == 0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct);assert(r==0);
}
......@@ -1209,7 +1209,7 @@ static void test_new_brt_cursor_set_range(int n, int dup_mode) {
r = toku_brt_cursor_close(cursor); assert(r==0);
r = toku_close_brt(brt, 0, 0); assert(r==0);
r = toku_close_brt(brt, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......@@ -1268,7 +1268,7 @@ static void test_new_brt_cursor_set(int n, int cursor_op, DB *db) {
r = toku_brt_cursor_close(cursor); assert(r==0);
r = toku_close_brt(brt, 0, 0); assert(r==0);
r = toku_close_brt(brt, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......
......@@ -23,7 +23,7 @@ static void test0 (void) {
assert(r==0);
//printf("%s:%d test0\n", __FILE__, __LINE__);
//printf("%s:%d n_items_malloced=%lld\n", __FILE__, __LINE__, n_items_malloced);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
//printf("%s:%d n_items_malloced=%lld\n", __FILE__, __LINE__, n_items_malloced);
r = toku_cachetable_close(&ct);
assert(r==0);
......
......@@ -27,7 +27,7 @@ static void test1 (void) {
assert(r==0);
assert(pair.call_count==1);
}
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
if (verbose) printf("test1 ok\n");
......
......@@ -41,7 +41,7 @@ static void test2 (int memcheck, int limit) {
}
if (verbose) printf("%s:%d inserted\n", __FILE__, __LINE__);
r = toku_verify_brt(t); assert(r==0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
if (verbose) printf("test2 ok\n");
......
......@@ -31,7 +31,7 @@ static void test3 (int nodesize, int count, int memcheck) {
toku_brt_insert(t, toku_fill_dbt(&k, key, 1+strlen(key)), toku_fill_dbt(&v, val, 1+strlen(val)), null_txn);
}
r = toku_verify_brt(t); assert(r==0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
gettimeofday(&t1, 0);
......
......@@ -31,7 +31,7 @@ static void test4 (int nodesize, int count, int memcheck) {
toku_brt_insert(t, toku_fill_dbt(&k, key, 1+strlen(key)), toku_fill_dbt(&v, val, 1+strlen(val)), null_txn);
}
r = toku_verify_brt(t); assert(r==0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
gettimeofday(&t1, 0);
......
......@@ -49,7 +49,7 @@ static void test5 (void) {
}
if (verbose) printf("\n");
toku_free(values);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
toku_memory_check_all_free();
}
......
......@@ -147,7 +147,7 @@ static void checkpoint_pending(void) {
assert(r == 0);
assert(n_flush == 0 && n_write_me == 0 && n_keep_me == 0);
r = toku_cachefile_close(&cf, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && cf == 0);
r = toku_cachefile_close(&cf, 0, FALSE, ZERO_LSN); assert(r == 0 && cf == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -120,7 +120,7 @@ static void cachetable_checkpoint_test(int n, enum cachetable_dirty dirty) {
assert(r == 0);
assert(n_flush == 0 && n_write_me == 0 && n_keep_me == 0);
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -65,7 +65,7 @@ cachetable_count_pinned_test (int n) {
assert(toku_cachefile_count_pinned(f1, 1) == 0);
toku_cachetable_verify(ct);
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -73,7 +73,7 @@ cachetable_debug_test (int n) {
if (verbose) toku_cachetable_print_hash_histogram();
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -39,7 +39,7 @@ cachetable_fd_test (void) {
r = toku_cachefile_of_filenum(ct, fn, &newcf);
assert(r == ENOENT);
r = toku_cachefile_close(&cf, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && cf == 0);
r = toku_cachefile_close(&cf, 0, FALSE, ZERO_LSN); assert(r == 0 && cf == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -92,8 +92,8 @@ test_cachetable_flush (int n) {
assert(r == 0);
}
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f2, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f2 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f2, 0, FALSE, ZERO_LSN); assert(r == 0 && f2 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -70,7 +70,7 @@ cachetable_getandpin_test (int n) {
}
toku_cachetable_verify(ct);
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -112,7 +112,7 @@ static void cachetable_prefetch_checkpoint_test(int n, enum cachetable_dirty dir
assert(r == 0);
assert(n_flush == 0 && n_write_me == 0 && n_keep_me == 0);
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -55,7 +55,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
// close with the prefetch in progress. the close should block until
// all of the reads and writes are complete.
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -56,7 +56,7 @@ static void cachetable_prefetch_close_leak_test (void) {
// close with the prefetch in progress. the close should block until
// all of the reads and writes are complete.
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -55,7 +55,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
// close with the prefetch in progress. the close should block until
// all of the reads and writes are complete.
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -72,7 +72,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
toku_cachetable_verify(ct);
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -76,7 +76,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
assert(r == 0);
toku_cachetable_verify(ct);
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -66,7 +66,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
assert(r == 0);
toku_cachetable_verify(ct);
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -77,7 +77,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
assert(r == 0);
toku_cachetable_verify(ct);
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -77,7 +77,7 @@ cachetable_put_test (int n) {
r = toku_cachetable_unpin(f1, k, toku_cachetable_hash(f1, k), CACHETABLE_CLEAN, 1);
assert(r != 0);
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -158,7 +158,7 @@ static void test_rename (void) {
r = toku_cachetable_rename(f, okey, nkey);
assert(r != 0);
r = toku_cachefile_close(&f, 0, 0, FALSE, ZERO_LSN);
r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);
assert(r == 0);
r = toku_cachetable_close(&t);
assert(r == 0);
......
......@@ -84,7 +84,7 @@ static void readit (void) {
r=toku_cachetable_get_and_pin(f, key, fullhash, &block, &current_size, f_flush, f_fetch, 0); assert(r==0);
r=toku_cachetable_unpin(f, key, fullhash, CACHETABLE_CLEAN, BLOCKSIZE); assert(r==0);
}
r = toku_cachefile_close(&f, 0, 0, FALSE, ZERO_LSN); assert(r == 0);
r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN); assert(r == 0);
r = toku_cachetable_close(&t); assert(r == 0);
gettimeofday(&end, 0);
toku_os_get_process_times(&end_usertime, &end_systime);
......
......@@ -287,7 +287,7 @@ static void test0 (void) {
expectN(7);
expectN(6);
expectN(1);
r=toku_cachefile_close(&f, 0, 0, FALSE, ZERO_LSN);
r=toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);
assert(r==0);
r=toku_cachetable_close(&t);
assert(r==0);
......@@ -352,7 +352,7 @@ static void test_nested_pin (void) {
r = toku_cachetable_unpin(f, make_blocknum(2), f2hash, CACHETABLE_CLEAN, test_object_size);
assert(r==0);
// toku_os_usleep(1*1000000);
r = toku_cachefile_close(&f, 0, 0, FALSE, ZERO_LSN); assert(r==0);
r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN); assert(r==0);
r = toku_cachetable_close(&t); assert(r==0);
}
......@@ -415,14 +415,14 @@ static void test_multi_filehandles (void) {
r = toku_cachetable_unpin(f1, make_blocknum(1), toku_cachetable_hash(f1, make_blocknum(1)), CACHETABLE_CLEAN, 0); assert(r==0);
r = toku_cachetable_unpin(f1, make_blocknum(2), toku_cachetable_hash(f1, make_blocknum(2)), CACHETABLE_CLEAN, 0); assert(r==0);
r = toku_cachefile_close(&f1, 0, 0, FALSE, ZERO_LSN); assert(r==0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r==0);
r = toku_cachetable_unpin(f2, make_blocknum(1), toku_cachetable_hash(f2, make_blocknum(1)), CACHETABLE_CLEAN, 0); assert(r==0);
r = toku_cachetable_unpin(f2, make_blocknum(2), toku_cachetable_hash(f2, make_blocknum(2)), CACHETABLE_CLEAN, 0); assert(r==0);
r = toku_cachefile_close(&f2, 0, 0, FALSE, ZERO_LSN); assert(r==0);
r = toku_cachefile_close(&f2, 0, FALSE, ZERO_LSN); assert(r==0);
r = toku_cachetable_unpin(f3, make_blocknum(2), toku_cachetable_hash(f3, make_blocknum(2)), CACHETABLE_CLEAN, 0); assert(r==0);
r = toku_cachefile_close(&f3, 0, 0, FALSE, ZERO_LSN); assert(r==0);
r = toku_cachefile_close(&f3, 0, FALSE, ZERO_LSN); assert(r==0);
r = toku_cachetable_close(&t); assert(r==0);
}
......@@ -543,7 +543,7 @@ static void test_dirty(void) {
assert(dirty == 1);
assert(pinned == 0);
r = toku_cachefile_close(&f, 0, 0, FALSE, ZERO_LSN);
r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);
assert(r == 0);
r = toku_cachetable_close(&t);
assert(r == 0);
......@@ -620,7 +620,7 @@ static void test_size_resize(void) {
r = toku_cachetable_unpin(f, key, hkey, CACHETABLE_CLEAN, new_size);
assert(r == 0);
r = toku_cachefile_close(&f, 0, 0, FALSE, ZERO_LSN);
r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);
assert(r == 0);
r = toku_cachetable_close(&t);
assert(r == 0);
......@@ -688,7 +688,7 @@ static void test_size_flush(void) {
assert(r == 0);
}
r = toku_cachefile_close(&f, 0, 0, FALSE, ZERO_LSN);
r = toku_cachefile_close(&f, 0, FALSE, ZERO_LSN);
assert(r == 0);
r = toku_cachetable_close(&t);
assert(r == 0);
......
......@@ -226,13 +226,13 @@ static void test_chaining (void) {
//printf("Close %d (%p), now n_present=%d\n", i, f[i], n_present);
//print_ints();
CACHEFILE oldcf=f[i];
r = toku_cachefile_close(&f[i], 0, 0, FALSE, ZERO_LSN); assert(r==0);
r = toku_cachefile_close(&f[i], 0, FALSE, ZERO_LSN); assert(r==0);
file_is_not_present(oldcf);
r = toku_cachetable_openf(&f[i], ct, fname[i], fname[i], O_RDWR, S_IRWXU|S_IRWXG|S_IRWXO); assert(r==0);
}
}
for (i=0; i<N_FILES; i++) {
r = toku_cachefile_close(&f[i], 0, 0, FALSE, ZERO_LSN); assert(r==0);
r = toku_cachefile_close(&f[i], 0, FALSE, ZERO_LSN); assert(r==0);
}
r = toku_cachetable_close(&ct); assert(r==0);
}
......
......@@ -67,7 +67,7 @@ cachetable_unpin_test (int n) {
r = toku_cachetable_unpin(f1, k, toku_cachetable_hash(f1, k), CACHETABLE_CLEAN, 1);
assert(r != 0);
r = toku_cachefile_close(&f1, NULL_LOGGER, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachefile_close(&f1, 0, FALSE, ZERO_LSN); assert(r == 0 && f1 == 0);
r = toku_cachetable_close(&ct); assert(r == 0 && ct == 0);
}
......
......@@ -50,7 +50,7 @@ static void test_flat (void) {
assert(less>=prevless); prevless=less;
assert(greater<=prevgreater); prevgreater=greater;
}
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......
......@@ -72,7 +72,7 @@ static void test_flat (void) {
assert(equal==0);
assert(less+equal+greater == limit*ilimit);
}
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......
......@@ -54,7 +54,7 @@ static void test_flat (void) {
assert(less>=prevless); prevless = less;
assert(greater<=prevgreater); prevgreater = greater;
}
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......
......@@ -60,7 +60,7 @@ static void test_flat (void) {
assert(equal==0);
assert(less+equal+greater == limit);
}
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......
......@@ -53,7 +53,7 @@ test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute
}
r = toku_brt_cursor_close(cursor); assert(r==0);
r = toku_close_brt(brt, 0, 0); assert(r==0);
r = toku_close_brt(brt, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
return 0;
}
......@@ -46,7 +46,7 @@ doit (void) {
assert(pair.call_count==0);
}
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......
......@@ -30,7 +30,7 @@ test_overflow (void) {
char key[]={(char)('a'+i), 0};
toku_brt_insert(t, toku_fill_dbt(&k, key, 2), toku_fill_dbt(&v,buf,sizeof(buf)), null_txn);
}
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......
......@@ -58,7 +58,7 @@ doit (void) {
assert(r==0);
assert(pair.call_count == 1);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
}
......
......@@ -130,7 +130,7 @@ doit (int ksize __attribute__((__unused__))) {
r = toku_testsetup_root(t, anode);
assert(r==0);
r = toku_close_brt(t, 0, 0); assert(r==0);
r = toku_close_brt(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
//printf("ksize=%d, unused\n", ksize);
......
......@@ -1649,7 +1649,7 @@ int log_compare(const DB_LSN * a, const DB_LSN * b) {
static int
db_close_before_brt(DB *db, u_int32_t UU(flags)) {
char *error_string = 0;
int r1 = toku_close_brt(db->i->brt, db->dbenv->i->logger, &error_string);
int r1 = toku_close_brt(db->i->brt, &error_string);
if (r1) {
db->dbenv->i->is_panicked = r1; // Panicking the whole environment may be overkill, but I'm not sure what else to do.
db->dbenv->i->panic_string = error_string;
......
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