Add suggestion for btrfs user to disable preallocation (#8646)

Summary:
Add comment for `options.allow_fallocate` that btrfs
preallocated space are not freed and a suggestion to disable
preallocation.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8646

Test Plan: No code change

Reviewed By: ajkr

Differential Revision: D30240050

Pulled By: jay-zhuang

fbshipit-source-id: 75b7190bc8276ce8d8ac2d0cb9064b386cbf4768
main
Jay Zhuang 3 years ago committed by Facebook GitHub Bot
parent e3a96c4823
commit 87e2358736
  1. 1
      HISTORY.md
  2. 10
      include/rocksdb/options.h

@ -14,6 +14,7 @@
* Insert warm blocks (data blocks, uncompressed dict blocks, index and filter blocks) in Block cache during flush under option BlockBasedTableOptions.prepopulate_block_cache. Previously it was enabled for only data blocks. * Insert warm blocks (data blocks, uncompressed dict blocks, index and filter blocks) in Block cache during flush under option BlockBasedTableOptions.prepopulate_block_cache. Previously it was enabled for only data blocks.
* BlockBasedTableOptions.prepopulate_block_cache can be dynamically configured using DB::SetOptions. * BlockBasedTableOptions.prepopulate_block_cache can be dynamically configured using DB::SetOptions.
* Add CompactionOptionsFIFO.age_for_warm, which allows RocksDB to move old files to warm tier in FIFO compactions. Note that file temperature is still an experimental feature. * Add CompactionOptionsFIFO.age_for_warm, which allows RocksDB to move old files to warm tier in FIFO compactions. Note that file temperature is still an experimental feature.
* Add a comment to suggest btrfs user to disable file preallocation by setting `options.allow_fallocate=false`.
### Performance Improvements ### Performance Improvements
* Try to avoid updating DBOptions if `SetDBOptions()` does not change any option value. * Try to avoid updating DBOptions if `SetDBOptions()` does not change any option value.

@ -740,7 +740,15 @@ struct DBOptions {
// Not supported in ROCKSDB_LITE mode! // Not supported in ROCKSDB_LITE mode!
bool use_direct_io_for_flush_and_compaction = false; bool use_direct_io_for_flush_and_compaction = false;
// If false, fallocate() calls are bypassed // If false, fallocate() calls are bypassed, which disables file
// preallocation. The file space preallocation is used to increase the file
// write/append performance. By default, RocksDB preallocates space for WAL,
// SST, Manifest files, the extra space is truncated when the file is written.
// Warning: if you're using btrfs, we would recommend setting
// `allow_fallocate=false` to disable preallocation. As on btrfs, the extra
// allocated space cannot be freed, which could be significant if you have
// lots of files. More details about this limitation:
// https://github.com/btrfs/btrfs-dev-docs/blob/471c5699336e043114d4bca02adcd57d9dab9c44/data-extent-reference-counts.md
bool allow_fallocate = true; bool allow_fallocate = true;
// Disable child process inherit open files. Default: true // Disable child process inherit open files. Default: true

Loading…
Cancel
Save