From ad9a39c9b49b6df97c165130a843899535548826 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Wed, 26 Mar 2014 09:37:53 -0700 Subject: [PATCH] [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 --- db/version_set.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/version_set.cc b/db/version_set.cc index 913263ee0..a97686cda 100644 --- a/db/version_set.cc +++ b/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()); }