Don't use version in the error message
Summary: We use object `v` in the error message, which is not initialized if the edit is column family manipulation. This doesn't provide much useful info, so this diff is removing it. Instead, it dumps actual VersionEdit contents. Test Plan: compiles. would be great to get tests in version_set_test.cc that cover cases where a file write fails Reviewers: sdong, yhchiang, andrewkr Reviewed By: andrewkr Subscribers: andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D56349
This commit is contained in:
parent
d02eb8d00b
commit
ab4c62332e
@ -2336,11 +2336,14 @@ Status VersionSet::LogAndApply(ColumnFamilyData* column_family_data,
|
|||||||
manifest_file_size_ = new_manifest_file_size;
|
manifest_file_size_ = new_manifest_file_size;
|
||||||
prev_log_number_ = edit->prev_log_number_;
|
prev_log_number_ = edit->prev_log_number_;
|
||||||
} else {
|
} else {
|
||||||
|
std::string version_edits;
|
||||||
|
for (auto& e : batch_edits) {
|
||||||
|
version_edits = version_edits + "\n" + e->DebugString(true);
|
||||||
|
}
|
||||||
Log(InfoLogLevel::ERROR_LEVEL, db_options_->info_log,
|
Log(InfoLogLevel::ERROR_LEVEL, db_options_->info_log,
|
||||||
"Error in committing version %lu to [%s]",
|
"[%s] Error in committing version edit to MANIFEST: %s",
|
||||||
(unsigned long)v->GetVersionNumber(),
|
column_family_data ? column_family_data->GetName().c_str() : "<null>",
|
||||||
column_family_data ? column_family_data->GetName().c_str()
|
version_edits.c_str());
|
||||||
: "<null>");
|
|
||||||
delete v;
|
delete v;
|
||||||
if (new_descriptor_log) {
|
if (new_descriptor_log) {
|
||||||
Log(InfoLogLevel::INFO_LEVEL, db_options_->info_log,
|
Log(InfoLogLevel::INFO_LEVEL, db_options_->info_log,
|
||||||
|
Loading…
Reference in New Issue
Block a user