[RocksDB] Preallocate new MANIFEST files

Summary: We don't preallocate MANIFEST file, even though we have an option for that. This diff preallocates manifest file every time we create it

Test Plan: make check

Reviewers: dhruba, haobo

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D17163
This commit is contained in:
Igor Canadi 2014-03-26 09:37:53 -07:00
parent 6b2e7a2a01
commit ad9a39c9b4
1 changed files with 2 additions and 0 deletions

View File

@ -1554,6 +1554,8 @@ Status VersionSet::LogAndApply(VersionEdit* edit, port::Mutex* mu,
DescriptorFileName(dbname_, pending_manifest_file_number_),
&descriptor_file, env_->OptimizeForManifestWrite(storage_options_));
if (s.ok()) {
descriptor_file->SetPreallocationBlockSize(
options_->manifest_preallocation_size);
descriptor_log_.reset(new log::Writer(std::move(descriptor_file)));
s = WriteSnapshot(descriptor_log_.get());
}