diff --git a/ft/logger.cc b/ft/logger.cc index fcc08b5d681..5dcf7287d25 100644 --- a/ft/logger.cc +++ b/ft/logger.cc @@ -200,9 +200,7 @@ toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, bool create) // so it will always be clean (!h->dirty) when about to be closed. // Rollback log can only be closed when there are no open transactions, // so it will always be empty (no data blocks) when about to be closed. -// TODO: can't fail -int -toku_logger_close_rollback(TOKULOGGER logger) { +void toku_logger_close_rollback(TOKULOGGER logger) { CACHEFILE cf = logger->rollback_cachefile; // stored in logger at rollback cachefile open if (cf) { FT_HANDLE ft_to_close; @@ -226,7 +224,6 @@ toku_logger_close_rollback(TOKULOGGER logger) { //Set as dealt with already. logger->rollback_cachefile = NULL; } - return 0; } // No locks held on entry diff --git a/ft/logger.h b/ft/logger.h index 8be9526f7e8..256c6198c9a 100644 --- a/ft/logger.h +++ b/ft/logger.h @@ -26,7 +26,7 @@ int toku_logger_open_with_last_xid(const char *directory, TOKULOGGER logger, TXN void toku_logger_shutdown(TOKULOGGER logger); int toku_logger_close(TOKULOGGER *loggerp); int toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, bool create); -int toku_logger_close_rollback(TOKULOGGER logger); +void toku_logger_close_rollback(TOKULOGGER logger); bool toku_logger_rollback_is_open (TOKULOGGER); // return true iff the rollback is open. void toku_logger_fsync (TOKULOGGER logger); diff --git a/ft/recover.cc b/ft/recover.cc index 1497795a5b2..ddc8563e3e9 100644 --- a/ft/recover.cc +++ b/ft/recover.cc @@ -232,8 +232,7 @@ static void recover_env_cleanup (RECOVER_ENV renv) { file_map_destroy(&renv->fmap); if (renv->destroy_logger_at_end) { - r = toku_logger_close_rollback(renv->logger); - assert(r==0); + toku_logger_close_rollback(renv->logger); r = toku_logger_close(&renv->logger); assert(r == 0); } else { diff --git a/ft/tests/is_empty.cc b/ft/tests/is_empty.cc index d41ac7c5fc9..40fca390e5c 100644 --- a/ft/tests/is_empty.cc +++ b/ft/tests/is_empty.cc @@ -109,7 +109,7 @@ static void test_it (int N) { r = toku_close_ft_handle_nolsn(brt, NULL); CKERR(r); r = toku_checkpoint(cp, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT); CKERR(r); - toku_logger_close_rollback(logger); CKERR(r); + toku_logger_close_rollback(logger); r = toku_checkpoint(cp, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT); CKERR(r); toku_cachetable_close(&ct); r = toku_logger_close(&logger); assert(r==0); diff --git a/ft/tests/le-cursor-provdel.cc b/ft/tests/le-cursor-provdel.cc index 06821759ee4..deba7234370 100644 --- a/ft/tests/le-cursor-provdel.cc +++ b/ft/tests/le-cursor-provdel.cc @@ -89,7 +89,6 @@ create_populate_tree(const char *logdir, const char *fname, int n) { assert(error == 0); toku_logger_close_rollback(logger); - assert(error == 0); error = toku_checkpoint(cp, logger, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT); assert(error == 0); @@ -193,7 +192,6 @@ test_provdel(const char *logdir, const char *fname, int n) { assert(error == 0); toku_logger_close_rollback(logger); - assert(error == 0); error = toku_logger_close(&logger); assert(error == 0); diff --git a/ft/tests/test-ft-txns.h b/ft/tests/test-ft-txns.h index a64339ada47..be05c160be8 100644 --- a/ft/tests/test-ft-txns.h +++ b/ft/tests/test-ft-txns.h @@ -80,8 +80,7 @@ static inline void clean_shutdown(TOKULOGGER *loggerp, CACHETABLE *ctp) { r = toku_checkpoint(cp, *loggerp, NULL, NULL, NULL, NULL, SHUTDOWN_CHECKPOINT); CKERR(r); - r = toku_logger_close_rollback(*loggerp); - CKERR(r); + toku_logger_close_rollback(*loggerp); r = toku_checkpoint(cp, *loggerp, NULL, NULL, NULL, NULL, SHUTDOWN_CHECKPOINT); CKERR(r); @@ -95,11 +94,9 @@ static inline void clean_shutdown(TOKULOGGER *loggerp, CACHETABLE *ctp) { } static inline void shutdown_after_recovery(TOKULOGGER *loggerp, CACHETABLE *ctp) { - int r; - r = toku_logger_close_rollback(*loggerp); - CKERR(r); + toku_logger_close_rollback(*loggerp); toku_cachetable_close(ctp); - r = toku_logger_close(loggerp); + int r = toku_logger_close(loggerp); CKERR(r); } diff --git a/src/ydb.cc b/src/ydb.cc index 1f4ff068749..55ef7e4ffc6 100644 --- a/src/ydb.cc +++ b/src/ydb.cc @@ -1041,12 +1041,7 @@ env_close(DB_ENV * env, uint32_t flags) { toku_ydb_do_error(env, r, "%s", err_msg); goto panic_and_quit_early; } - r = toku_logger_close_rollback(env->i->logger); - if (r) { - err_msg = "Cannot close environment (error during closing rollback cachefile)\n"; - toku_ydb_do_error(env, r, "%s", err_msg); - goto panic_and_quit_early; - } + toku_logger_close_rollback(env->i->logger); //Do a second checkpoint now that the rollback cachefile is closed. r = toku_checkpoint(cp, env->i->logger, NULL, NULL, NULL, NULL, SHUTDOWN_CHECKPOINT); if (r) {