Commit 8cb37c07 authored by Leif Walsh's avatar Leif Walsh Committed by Yoni Fogel

[t:3203] remove ineffectual DB_CLOSE_DONT_TRIM_LOG

git-svn-id: file:///svn/toku/tokudb@34485 c7de825b-a66e-492c-adef-691d508d4ae1
parent a493050e
......@@ -244,7 +244,6 @@ typedef enum {
#define DB_INIT_LOCK 4096
#define DB_INIT_LOG 8192
#define DB_INIT_MPOOL 16384
#define DB_CLOSE_DONT_TRIM_LOG 1048576
#define DB_INIT_TXN 32768
#define DB_KEYEXIST -30997
#define DB_LOCK_DEADLOCK -30996
......
......@@ -244,7 +244,6 @@ typedef enum {
#define DB_INIT_LOCK 8192
#define DB_INIT_LOG 16384
#define DB_INIT_MPOOL 32768
#define DB_CLOSE_DONT_TRIM_LOG 1048576
#define DB_INIT_TXN 131072
#define DB_KEYEXIST -30996
#define DB_LOCK_DEADLOCK -30995
......
......@@ -244,7 +244,6 @@ typedef enum {
#define DB_INIT_LOCK 16384
#define DB_INIT_LOG 32768
#define DB_INIT_MPOOL 65536
#define DB_CLOSE_DONT_TRIM_LOG 1048576
#define DB_INIT_TXN 262144
#define DB_KEYEXIST -30996
#define DB_LOCK_DEADLOCK -30995
......
......@@ -244,7 +244,6 @@ typedef enum {
#define DB_INIT_LOCK 32768
#define DB_INIT_LOG 65536
#define DB_INIT_MPOOL 131072
#define DB_CLOSE_DONT_TRIM_LOG 1048576
#define DB_INIT_TXN 524288
#define DB_KEYEXIST -30996
#define DB_LOCK_DEADLOCK -30995
......
This diff is collapsed.
......@@ -120,7 +120,6 @@ static void print_defines (void) {
dodefine(DB_INIT_LOCK);
dodefine(DB_INIT_LOG);
dodefine(DB_INIT_MPOOL);
printf("#define DB_CLOSE_DONT_TRIM_LOG 1048576\n"); // tokudb
dodefine(DB_INIT_TXN);
//dodefine(DB_KEYEMPTY); /// KEYEMPTY is no longer used. We just use DB_NOTFOUND
......
......@@ -244,7 +244,6 @@ typedef enum {
#define DB_INIT_LOCK 131072
#define DB_INIT_LOG 262144
#define DB_INIT_MPOOL 524288
#define DB_CLOSE_DONT_TRIM_LOG 1048576
#define DB_INIT_TXN 2097152
#define DB_KEYEXIST -30996
#define DB_LOCK_DEADLOCK -30995
......
......@@ -12,11 +12,6 @@ const char *namea=NAMEA;
#define NAMEB_HINT "b_db"
const char *nameb=NAMEB;
// needed to get .bdb versions to compile
#ifndef DB_CLOSE_DONT_TRIM_LOG
#define DB_CLOSE_DONT_TRIM_LOG 0
#endif
static void run_test (void) {
int r;
r = system("rm -rf " ENVDIR);
......
......@@ -11,11 +11,6 @@ const char *namea=NAMEA;
#define NAMEB "b.db"
const char *nameb=NAMEB;
// needed to get .bdb versions to compile
#ifndef DB_CLOSE_DONT_TRIM_LOG
#define DB_CLOSE_DONT_TRIM_LOG 0
#endif
static void run_test (void) {
int r;
r = system("rm -rf " ENVDIR);
......
......@@ -9,11 +9,6 @@ const int envflags = DB_INIT_MPOOL|DB_CREATE|DB_THREAD |DB_INIT_LOCK|DB_INIT_LOG
char *namea="a.db";
char *nameb="b.db";
// needed to get .bdb versions to compile
#ifndef DB_CLOSE_DONT_TRIM_LOG
#define DB_CLOSE_DONT_TRIM_LOG 0
#endif
static void run_test (void) {
int r;
r = system("rm -rf " ENVDIR);
......@@ -26,12 +21,12 @@ static void run_test (void) {
// create logfile 0
r = db_env_create(&env, 0); CKERR(r);
r = env->open(env, ENVDIR, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = env->close(env, DB_CLOSE_DONT_TRIM_LOG); CKERR(r);
r = env->close(env, 0); CKERR(r);
// create logfile 1
r = db_env_create(&env, 0); CKERR(r);
r = env->open(env, ENVDIR, envflags, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
r = env->close(env, DB_CLOSE_DONT_TRIM_LOG); CKERR(r);
r = env->close(env, 0); CKERR(r);
// create logfile 2
r = db_env_create(&env, 0); CKERR(r);
......
......@@ -1066,9 +1066,7 @@ toku_env_close(DB_ENV * env, u_int32_t flags) {
toku_ydb_unlock(); // ydb lock must not be held when shutting down minicron
toku_cachetable_minicron_shutdown(env->i->cachetable);
if (env->i->logger) {
if ( flags && DB_CLOSE_DONT_TRIM_LOG ) {
toku_logger_trim_log_files(env->i->logger, FALSE);
}
toku_logger_trim_log_files(env->i->logger, FALSE);
r = toku_checkpoint(env->i->cachetable, env->i->logger, NULL, NULL, NULL, NULL);
if (r) {
err_msg = "Cannot close environment (error during checkpoint)\n";
......@@ -1152,7 +1150,7 @@ toku_env_close(DB_ENV * env, u_int32_t flags) {
env->i = NULL;
toku_free(env);
env = NULL;
if ((flags!=0) && !(flags==DB_CLOSE_DONT_TRIM_LOG))
if (flags!=0)
r = EINVAL;
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