Only get the manifest file size if there is no error

Summary:
I came across this while working on column families. CorruptionTest::RecoverWriteError threw a SIGSEG because the descriptor_log_->file() was nullptr. I'm not sure why it doesn't happen in master, but better safe than sorry.

@kailiu, can we get this in release, too?

Test Plan: make check

Reviewers: kailiu, dhruba, haobo

Reviewed By: haobo

CC: leveldb, kailiu

Differential Revision: https://reviews.facebook.net/D15513
This commit is contained in:
Igor Canadi 2014-01-28 16:02:51 -08:00
parent e5ec7384a0
commit 5d2c62822e

View File

@ -1547,8 +1547,10 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu,
}
}
// find offset in manifest file where this version is stored.
new_manifest_file_size = descriptor_log_->file()->GetFileSize();
if (s.ok()) {
// find offset in manifest file where this version is stored.
new_manifest_file_size = descriptor_log_->file()->GetFileSize();
}
LogFlush(options_->info_log);
mu->Lock();