Update documentation about dynamic options (#4653)

Summary:
Updated the comments around all options which are currently dynamic.
Without explicitly specifying in the comments around the options, its hard for RocksDB users to know if an option is dynamically changeable or not unless they dig into the implementation details.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4653

Differential Revision: D12966735

Pulled By: sagar0

fbshipit-source-id: 1a01acbf6fe506b989e71629ce223f9803ebae27
main
Sagar Vemuri 6 years ago committed by Facebook Github Bot
parent dc3528077a
commit 0c4678fd1b
  1. 20
      include/rocksdb/advanced_options.h
  2. 41
      include/rocksdb/options.h

@ -502,19 +502,25 @@ struct AdvancedColumnFamilyOptions {
// threshold. But it's not guaranteed. // threshold. But it's not guaranteed.
// Value 0 will be sanitized. // Value 0 will be sanitized.
// //
// Default: result.target_file_size_base * 25 // Default: target_file_size_base * 25
//
// Dynamically changeable through SetOptions() API
uint64_t max_compaction_bytes = 0; uint64_t max_compaction_bytes = 0;
// All writes will be slowed down to at least delayed_write_rate if estimated // All writes will be slowed down to at least delayed_write_rate if estimated
// bytes needed to be compaction exceed this threshold. // bytes needed to be compaction exceed this threshold.
// //
// Default: 64GB // Default: 64GB
//
// Dynamically changeable through SetOptions() API
uint64_t soft_pending_compaction_bytes_limit = 64 * 1073741824ull; uint64_t soft_pending_compaction_bytes_limit = 64 * 1073741824ull;
// All writes are stopped if estimated bytes needed to be compaction exceed // All writes are stopped if estimated bytes needed to be compaction exceed
// this threshold. // this threshold.
// //
// Default: 256GB // Default: 256GB
//
// Dynamically changeable through SetOptions() API
uint64_t hard_pending_compaction_bytes_limit = 256 * 1073741824ull; uint64_t hard_pending_compaction_bytes_limit = 256 * 1073741824ull;
// The compaction style. Default: kCompactionStyleLevel // The compaction style. Default: kCompactionStyleLevel
@ -526,13 +532,17 @@ struct AdvancedColumnFamilyOptions {
CompactionPri compaction_pri = kByCompensatedSize; CompactionPri compaction_pri = kByCompensatedSize;
// The options needed to support Universal Style compactions // The options needed to support Universal Style compactions
//
// Dynamically changeable through SetOptions() API
// Dynamic change example:
// SetOptions("compaction_options_universal", "{size_ratio=2;}")
CompactionOptionsUniversal compaction_options_universal; CompactionOptionsUniversal compaction_options_universal;
// The options for FIFO compaction style // The options for FIFO compaction style
// //
// Dynamically changeable through SetOptions() API // Dynamically changeable through SetOptions() API
// Dynamic change example: // Dynamic change example:
// SetOption("compaction_options_fifo", "{max_table_files_size=100;ttl=2;}") // SetOptions("compaction_options_fifo", "{max_table_files_size=100;ttl=2;}")
CompactionOptionsFIFO compaction_options_fifo; CompactionOptionsFIFO compaction_options_fifo;
// An iteration->Next() sequentially skips over keys with the same // An iteration->Next() sequentially skips over keys with the same
@ -602,7 +612,10 @@ struct AdvancedColumnFamilyOptions {
bool optimize_filters_for_hits = false; bool optimize_filters_for_hits = false;
// After writing every SST file, reopen it and read all the keys. // After writing every SST file, reopen it and read all the keys.
//
// Default: false // Default: false
//
// Dynamically changeable through SetOptions() API
bool paranoid_file_checks = false; bool paranoid_file_checks = false;
// In debug mode, RocksDB run consistency checks on the LSM every time the LSM // In debug mode, RocksDB run consistency checks on the LSM every time the LSM
@ -612,7 +625,10 @@ struct AdvancedColumnFamilyOptions {
bool force_consistency_checks = false; bool force_consistency_checks = false;
// Measure IO stats in compactions and flushes, if true. // Measure IO stats in compactions and flushes, if true.
//
// Default: false // Default: false
//
// Dynamically changeable through SetOptions() API
bool report_bg_io_stats = false; bool report_bg_io_stats = false;
// Non-bottom-level files older than TTL will go through the compaction // Non-bottom-level files older than TTL will go through the compaction

@ -188,8 +188,7 @@ struct ColumnFamilyOptions : public AdvancedColumnFamilyOptions {
// Dynamically changeable through SetOptions() API // Dynamically changeable through SetOptions() API
size_t write_buffer_size = 64 << 20; size_t write_buffer_size = 64 << 20;
// Compress blocks using the specified compression algorithm. This // Compress blocks using the specified compression algorithm.
// parameter can be changed dynamically.
// //
// Default: kSnappyCompression, if it's supported. If snappy is not linked // Default: kSnappyCompression, if it's supported. If snappy is not linked
// with the library, the default is kNoCompression. // with the library, the default is kNoCompression.
@ -212,6 +211,8 @@ struct ColumnFamilyOptions : public AdvancedColumnFamilyOptions {
// - kZlibCompression: Z_DEFAULT_COMPRESSION (currently -1) // - kZlibCompression: Z_DEFAULT_COMPRESSION (currently -1)
// - kLZ4HCCompression: 0 // - kLZ4HCCompression: 0
// - For all others, we do not specify a compression level // - For all others, we do not specify a compression level
//
// Dynamically changeable through SetOptions() API
CompressionType compression; CompressionType compression;
// Compression algorithm that will be used for the bottommost level that // Compression algorithm that will be used for the bottommost level that
@ -416,7 +417,10 @@ struct DBOptions {
// files opened are always kept open. You can estimate number of files based // files opened are always kept open. You can estimate number of files based
// on target_file_size_base and target_file_size_multiplier for level-based // on target_file_size_base and target_file_size_multiplier for level-based
// compaction. For universal-style compaction, you can usually set it to -1. // compaction. For universal-style compaction, you can usually set it to -1.
//
// Default: -1 // Default: -1
//
// Dynamically changeable through SetDBOptions() API.
int max_open_files = -1; int max_open_files = -1;
// If max_open_files is -1, DB will open all files on DB::Open(). You can // If max_open_files is -1, DB will open all files on DB::Open(). You can
@ -431,7 +435,10 @@ struct DBOptions {
// [sum of all write_buffer_size * max_write_buffer_number] * 4 // [sum of all write_buffer_size * max_write_buffer_number] * 4
// This option takes effect only when there are more than one column family as // This option takes effect only when there are more than one column family as
// otherwise the wal size is dictated by the write_buffer_size. // otherwise the wal size is dictated by the write_buffer_size.
//
// Default: 0 // Default: 0
//
// Dynamically changeable through SetDBOptions() API.
uint64_t max_total_wal_size = 0; uint64_t max_total_wal_size = 0;
// If non-null, then we should collect metrics about database operations // If non-null, then we should collect metrics about database operations
@ -492,13 +499,23 @@ struct DBOptions {
// value is 6 hours. The files that get out of scope by compaction // value is 6 hours. The files that get out of scope by compaction
// process will still get automatically delete on every compaction, // process will still get automatically delete on every compaction,
// regardless of this setting // regardless of this setting
//
// Default: 6 hours
//
// Dynamically changeable through SetDBOptions() API.
uint64_t delete_obsolete_files_period_micros = 6ULL * 60 * 60 * 1000000; uint64_t delete_obsolete_files_period_micros = 6ULL * 60 * 60 * 1000000;
// Maximum number of concurrent background jobs (compactions and flushes). // Maximum number of concurrent background jobs (compactions and flushes).
//
// Default: 2
//
// Dynamically changeable through SetDBOptions() API.
int max_background_jobs = 2; int max_background_jobs = 2;
// NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the // NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the
// value of max_background_jobs. This option is ignored. // value of max_background_jobs. This option is ignored.
//
// Dynamically changeable through SetDBOptions() API.
int base_background_compactions = -1; int base_background_compactions = -1;
// NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the // NOT SUPPORTED ANYMORE: RocksDB automatically decides this based on the
@ -513,7 +530,10 @@ struct DBOptions {
// If you're increasing this, also consider increasing number of threads in // If you're increasing this, also consider increasing number of threads in
// LOW priority thread pool. For more information, see // LOW priority thread pool. For more information, see
// Env::SetBackgroundThreads // Env::SetBackgroundThreads
//
// Default: -1 // Default: -1
//
// Dynamically changeable through SetDBOptions() API.
int max_background_compactions = -1; int max_background_compactions = -1;
// This value represents the maximum number of threads that will // This value represents the maximum number of threads that will
@ -642,7 +662,10 @@ struct DBOptions {
bool skip_log_error_on_recovery = false; bool skip_log_error_on_recovery = false;
// if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec // if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
//
// Default: 600 (10 min) // Default: 600 (10 min)
//
// Dynamically changeable through SetDBOptions() API.
unsigned int stats_dump_period_sec = 600; unsigned int stats_dump_period_sec = 600;
// If set true, will hint the underlying file system that the file // If set true, will hint the underlying file system that the file
@ -709,6 +732,8 @@ struct DBOptions {
// true. // true.
// //
// Default: 0 // Default: 0
//
// Dynamically changeable through SetDBOptions() API.
size_t compaction_readahead_size = 0; size_t compaction_readahead_size = 0;
// This is a maximum buffer size that is used by WinMmapReadableFile in // This is a maximum buffer size that is used by WinMmapReadableFile in
@ -735,6 +760,8 @@ struct DBOptions {
// write requests if the logical sector size is unusual // write requests if the logical sector size is unusual
// //
// Default: 1024 * 1024 (1 MB) // Default: 1024 * 1024 (1 MB)
//
// Dynamically changeable through SetDBOptions() API.
size_t writable_file_max_buffer_size = 1024 * 1024; size_t writable_file_max_buffer_size = 1024 * 1024;
@ -757,17 +784,23 @@ struct DBOptions {
// to smooth out write I/Os over time. Users shouldn't rely on it for // to smooth out write I/Os over time. Users shouldn't rely on it for
// persistency guarantee. // persistency guarantee.
// Issue one request for every bytes_per_sync written. 0 turns it off. // Issue one request for every bytes_per_sync written. 0 turns it off.
// Default: 0
// //
// You may consider using rate_limiter to regulate write rate to device. // You may consider using rate_limiter to regulate write rate to device.
// When rate limiter is enabled, it automatically enables bytes_per_sync // When rate limiter is enabled, it automatically enables bytes_per_sync
// to 1MB. // to 1MB.
// //
// This option applies to table files // This option applies to table files
//
// Default: 0, turned off
//
// Dynamically changeable through SetDBOptions() API.
uint64_t bytes_per_sync = 0; uint64_t bytes_per_sync = 0;
// Same as bytes_per_sync, but applies to WAL files // Same as bytes_per_sync, but applies to WAL files
//
// Default: 0, turned off // Default: 0, turned off
//
// Dynamically changeable through SetDBOptions() API.
uint64_t wal_bytes_per_sync = 0; uint64_t wal_bytes_per_sync = 0;
// A vector of EventListeners which callback functions will be called // A vector of EventListeners which callback functions will be called
@ -794,6 +827,8 @@ struct DBOptions {
// Unit: byte per second. // Unit: byte per second.
// //
// Default: 0 // Default: 0
//
// Dynamically changeable through SetDBOptions() API.
uint64_t delayed_write_rate = 0; uint64_t delayed_write_rate = 0;
// By default, a single write thread queue is maintained. The thread gets // By default, a single write thread queue is maintained. The thread gets

Loading…
Cancel
Save