Commit 70c82da3 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#3293 fix the maybe trim logfile boundary condition refs[t:3293]

git-svn-id: file:///svn/toku/tokudb@28522 c7de825b-a66e-492c-adef-691d508d4ae1
parent 8fd0bcee
...@@ -715,7 +715,7 @@ int toku_logger_maybe_trim_log(TOKULOGGER logger, LSN trim_lsn) ...@@ -715,7 +715,7 @@ int toku_logger_maybe_trim_log(TOKULOGGER logger, LSN trim_lsn)
uint32_t log_version; uint32_t log_version;
lf_info = toku_logfilemgr_get_oldest_logfile_info(lfm); lf_info = toku_logfilemgr_get_oldest_logfile_info(lfm);
log_version = lf_info->version; log_version = lf_info->version;
if ( lf_info->maxlsn.lsn > trim_lsn.lsn ) { if ( lf_info->maxlsn.lsn >= trim_lsn.lsn ) {
// file contains an open LSN, can't delete this or any newer log files // file contains an open LSN, can't delete this or any newer log files
break; break;
} }
......
...@@ -146,7 +146,7 @@ test_main (int argc, const char *argv[]) { ...@@ -146,7 +146,7 @@ test_main (int argc, const char *argv[]) {
r = toku_logger_open(dname, logger); assert(r==0); r = toku_logger_open(dname, logger); assert(r==0);
r = toku_logger_maybe_trim_log(logger, trim_lsn); r = toku_logger_maybe_trim_log(logger, trim_lsn);
assert( toku_logfilemgr_num_logfiles(logger->logfilemgr) == 3 ); // untrimmed log, empty log, plus newly openned log assert( toku_logfilemgr_num_logfiles(logger->logfilemgr) == 4 ); // untrimmed log, empty log, plus newly openned log
r = toku_logger_close(&logger); r = toku_logger_close(&logger);
} }
......
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