Skip to content

Commit

Permalink
[SYS-5319] Don't allocate buffer for WALs in CloudFileSystem (#274)
Browse files Browse the repository at this point in the history
Summary:
Each WAL file by default allocates 64KB buffer in which it holds pending
writes. Our use of RocksDB-Cloud doesn't utilize WALs, so this memory is
wasted. This PR sets the buffer size to 0 in
CloudFileSystemImpl::OptimizeForLogWrite.

Test Plan:
db_cloud_test

Reviewers:
  • Loading branch information
igorcanadi authored Jul 21, 2023
1 parent 4832b6e commit 0d2b895
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cloud/cloud_file_system_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ class CloudFileSystemImpl : public CloudFileSystem {
}
FileOptions OptimizeForLogWrite(const FileOptions& file_options,
const DBOptions& db_options) const override {
return base_fs_->OptimizeForLogWrite(file_options, db_options);
auto fo = base_fs_->OptimizeForLogWrite(file_options, db_options);
if (!fo.use_direct_writes) {
// RocksDB-Cloud doesn't use WALs, so don't waste memory on allocating
// their buffers.
fo.writable_file_max_buffer_size = 0;
}
return fo;
}
FileOptions OptimizeForManifestWrite(
const FileOptions& file_options) const override {
Expand Down

0 comments on commit 0d2b895

Please sign in to comment.