logging_when_create_and_delete_manifest
Summary: 1. logging when create and delete manifest file 2. fix formating in table/format.cc Test Plan: make all check run db_bench, track the LOG file. Reviewers: ljin, yhchiang, igor, yufei.zhu, sdong Reviewed By: sdong Subscribers: leveldb Differential Revision: https://reviews.facebook.net/D21009
This commit is contained in:
parent
5e3d5c5f6e
commit
1129921e9b
@ -450,6 +450,7 @@ Status DBImpl::NewDB() {
|
|||||||
new_db.SetNextFile(2);
|
new_db.SetNextFile(2);
|
||||||
new_db.SetLastSequence(0);
|
new_db.SetLastSequence(0);
|
||||||
|
|
||||||
|
Log(options_.info_log, "Creating manifest 1 \n");
|
||||||
const std::string manifest = DescriptorFileName(dbname_, 1);
|
const std::string manifest = DescriptorFileName(dbname_, 1);
|
||||||
unique_ptr<WritableFile> file;
|
unique_ptr<WritableFile> file;
|
||||||
Status s = env_->NewWritableFile(
|
Status s = env_->NewWritableFile(
|
||||||
|
@ -1881,6 +1881,9 @@ Status VersionSet::LogAndApply(ColumnFamilyData* column_family_data,
|
|||||||
// This is fine because everything inside of this block is serialized --
|
// This is fine because everything inside of this block is serialized --
|
||||||
// only one thread can be here at the same time
|
// only one thread can be here at the same time
|
||||||
if (new_descriptor_log) {
|
if (new_descriptor_log) {
|
||||||
|
// create manifest file
|
||||||
|
Log(options_->info_log,
|
||||||
|
"Creating manifest %" PRIu64 "\n", pending_manifest_file_number_);
|
||||||
unique_ptr<WritableFile> descriptor_file;
|
unique_ptr<WritableFile> descriptor_file;
|
||||||
s = env_->NewWritableFile(
|
s = env_->NewWritableFile(
|
||||||
DescriptorFileName(dbname_, pending_manifest_file_number_),
|
DescriptorFileName(dbname_, pending_manifest_file_number_),
|
||||||
@ -2002,6 +2005,9 @@ Status VersionSet::LogAndApply(ColumnFamilyData* column_family_data,
|
|||||||
column_family_data->GetName().c_str());
|
column_family_data->GetName().c_str());
|
||||||
delete v;
|
delete v;
|
||||||
if (new_descriptor_log) {
|
if (new_descriptor_log) {
|
||||||
|
Log(options_->info_log,
|
||||||
|
"Deleting manifest %" PRIu64 " current manifest %" PRIu64 "\n",
|
||||||
|
manifest_file_number_, pending_manifest_file_number_);
|
||||||
descriptor_log_.reset();
|
descriptor_log_.reset();
|
||||||
env_->DeleteFile(
|
env_->DeleteFile(
|
||||||
DescriptorFileName(dbname_, pending_manifest_file_number_));
|
DescriptorFileName(dbname_, pending_manifest_file_number_));
|
||||||
|
@ -208,9 +208,8 @@ Status ReadFooterFromFile(RandomAccessFile* file,
|
|||||||
// contents is the result of reading.
|
// contents is the result of reading.
|
||||||
// According to the implementation of file->Read, contents may not point to buf
|
// According to the implementation of file->Read, contents may not point to buf
|
||||||
Status ReadBlock(RandomAccessFile* file, const Footer& footer,
|
Status ReadBlock(RandomAccessFile* file, const Footer& footer,
|
||||||
const ReadOptions& options, const BlockHandle& handle,
|
const ReadOptions& options, const BlockHandle& handle,
|
||||||
Slice* contents, // result of reading,
|
Slice* contents, /* result of reading */ char* buf) {
|
||||||
char* buf) {
|
|
||||||
size_t n = static_cast<size_t>(handle.size());
|
size_t n = static_cast<size_t>(handle.size());
|
||||||
|
|
||||||
PERF_TIMER_AUTO(block_read_time);
|
PERF_TIMER_AUTO(block_read_time);
|
||||||
@ -256,8 +255,8 @@ Status ReadBlock(RandomAccessFile* file, const Footer& footer,
|
|||||||
// Decompress a block according to params
|
// Decompress a block according to params
|
||||||
// May need to malloc a space for cache usage
|
// May need to malloc a space for cache usage
|
||||||
Status DecompressBlock(BlockContents* result, size_t block_size,
|
Status DecompressBlock(BlockContents* result, size_t block_size,
|
||||||
bool do_uncompress, const char* buf,
|
bool do_uncompress, const char* buf,
|
||||||
const Slice& contents, bool use_stack_buf) {
|
const Slice& contents, bool use_stack_buf) {
|
||||||
Status s;
|
Status s;
|
||||||
size_t n = block_size;
|
size_t n = block_size;
|
||||||
const char* data = contents.data();
|
const char* data = contents.data();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user