Skip to content

Commit

Permalink
disable SetPreallocationBlockSize for WAL
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhe-bytedance committed Oct 14, 2014
1 parent cd9ec20 commit 6848c4a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4299,8 +4299,9 @@ Status DBImpl::MakeRoomForWrite(
if (s.ok()) {
// Our final size should be less than write_buffer_size
// (compression, etc) but err on the side of caution.
lfile->SetPreallocationBlockSize(1.1 *
cfd->options()->write_buffer_size);
// TODO: temporarily disable preallocation to save write_wal_time
//lfile->SetPreallocationBlockSize(1.1 *
//cfd->options()->write_buffer_size);
new_log = new log::Writer(std::move(lfile));
}
}
Expand Down Expand Up @@ -4732,7 +4733,8 @@ Status DB::Open(const DBOptions& db_options, const std::string& dbname,
LogFileName(impl->options_.wal_dir, new_log_number), &lfile,
impl->options_.env->OptimizeForLogWrite(soptions));
if (s.ok()) {
lfile->SetPreallocationBlockSize(1.1 * max_write_buffer_size);
// TODO: temporarily disable preallocation to save write_wal_time
//lfile->SetPreallocationBlockSize(1.1 * max_write_buffer_size);
impl->logfile_number_ = new_log_number;
impl->log_.reset(new log::Writer(std::move(lfile)));

Expand Down

0 comments on commit 6848c4a

Please sign in to comment.