[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
main
Igor Canadi 11 years ago
parent 6b2e7a2a01
commit ad9a39c9b4
  1. 2
      db/version_set.cc

@ -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());
}

Loading…
Cancel
Save