Commit c5cded63 authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:2892] Improve comments.

git-svn-id: file:///svn/toku/tokudb@25736 c7de825b-a66e-492c-adef-691d508d4ae1
parent 51ec08ee
......@@ -22,6 +22,7 @@ toku_log_upgrade_get_footprint(void) {
#define FOOTPRINTCAPTURE footprint+=function_footprint;
// return 0 if clean shutdown, TOKUDB_UPGRADE_FAILURE if not clean shutdown
static int
verify_clean_shutdown_of_log_version_current(const char *log_dir, LSN * last_lsn) {
int rval = TOKUDB_UPGRADE_FAILURE;
......@@ -51,6 +52,7 @@ verify_clean_shutdown_of_log_version_current(const char *log_dir, LSN * last_lsn
}
// return 0 if clean shutdown, TOKUDB_UPGRADE_FAILURE if not clean shutdown
static int
verify_clean_shutdown_of_log_version_old(const char *log_dir, LSN * last_lsn) {
int rval = TOKUDB_UPGRADE_FAILURE;
......@@ -67,7 +69,8 @@ verify_clean_shutdown_of_log_version_old(const char *log_dir, LSN * last_lsn) {
char *basename;
TOKULOGCURSOR cursor;
struct log_entry *entry;
//Only look at newest log
// Only look at newest log
// basename points to first char after last / in file pathname
basename = strrchr(logfiles[n_logfiles-1], '/') + 1;
int version;
long long index = -1;
......@@ -103,7 +106,6 @@ verify_clean_shutdown_of_log_version_old(const char *log_dir, LSN * last_lsn) {
static int
verify_clean_shutdown_of_log_version(const char *log_dir, uint32_t version, LSN *last_lsn) {
// return 0 if clean shutdown, TOKUDB_UPGRADE_FAILURE if not clean shutdown
// examine logfile at logfilenum and possibly logfilenum-1
int r = 0;
FOOTPRINTSETUP(1000);
......@@ -121,6 +123,7 @@ verify_clean_shutdown_of_log_version(const char *log_dir, uint32_t version, LSN
}
// Actually create a log file of the current version, making the environment be of the current version.
static int
upgrade_log(const char *env_dir, const char *log_dir, LSN last_lsn) { // the real deal
int r;
......@@ -163,7 +166,8 @@ upgrade_log(const char *env_dir, const char *log_dir, LSN last_lsn) { // the rea
return 0;
}
// If log on disk is old (environment is old) and clean shutdown, then create log of current version,
// which will make the environment of the current version (and delete the old logs).
int
toku_maybe_upgrade_log(const char *env_dir, const char *log_dir, LSN * lsn_of_clean_shutdown, BOOL * upgrade_in_progress) {
int 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