RocksDB Options file format and its serialization / deserialization.
Summary:
This patch defines the format of RocksDB options file, which
follows the INI file format, and implements functions for its
serialization and deserialization. An example RocksDB options
file can be found in examples/rocksdb_option_file_example.ini.
A typical RocksDB options file has three sections, which are
Version, DBOptions, and more than one CFOptions. The RocksDB
options file in general follows the basic INI file format
with the following extensions / modifications:
* Escaped characters
We escaped the following characters:
- \n -- line feed - new line
- \r -- carriage return
- \\ -- backslash \
- \: -- colon symbol :
- \# -- hash tag #
* Comments
We support # style comments. Comments can appear at the ending
part of a line.
* Statements
A statement is of the form option_name = value.
Each statement contains a '=', where extra white-spaces
are supported. However, we don't support multi-lined statement.
Furthermore, each line can only contain at most one statement.
* Section
Sections are of the form [SecitonTitle "SectionArgument"],
where section argument is optional.
* List
We use colon-separated string to represent a list.
For instance, n1:n2:n3:n4 is a list containing four values.
Below is an example of a RocksDB options file:
[Version]
rocksdb_version=4.0.0
options_file_version=1.0
[DBOptions]
max_open_files=12345
max_background_flushes=301
[CFOptions "default"]
[CFOptions "the second column family"]
[CFOptions "the third column family"]
Test Plan: Added many tests in options_test.cc
Reviewers: igor, IslamAbdelRahman, sdong, anthony
Reviewed By: anthony
Subscribers: maykov, dhruba, leveldb
Differential Revision: https://reviews.facebook.net/D46059
2015-09-29 23:42:40 +02:00
|
|
|
# This is a RocksDB option file.
|
|
|
|
#
|
2015-12-09 01:17:06 +01:00
|
|
|
# A typical RocksDB options file has four sections, which are
|
2015-12-01 03:10:00 +01:00
|
|
|
# Version section, DBOptions section, at least one CFOptions
|
|
|
|
# section, and one TableOptions section for each column family.
|
|
|
|
# The RocksDB options file in general follows the basic INI
|
|
|
|
# file format with the following extensions / modifications:
|
RocksDB Options file format and its serialization / deserialization.
Summary:
This patch defines the format of RocksDB options file, which
follows the INI file format, and implements functions for its
serialization and deserialization. An example RocksDB options
file can be found in examples/rocksdb_option_file_example.ini.
A typical RocksDB options file has three sections, which are
Version, DBOptions, and more than one CFOptions. The RocksDB
options file in general follows the basic INI file format
with the following extensions / modifications:
* Escaped characters
We escaped the following characters:
- \n -- line feed - new line
- \r -- carriage return
- \\ -- backslash \
- \: -- colon symbol :
- \# -- hash tag #
* Comments
We support # style comments. Comments can appear at the ending
part of a line.
* Statements
A statement is of the form option_name = value.
Each statement contains a '=', where extra white-spaces
are supported. However, we don't support multi-lined statement.
Furthermore, each line can only contain at most one statement.
* Section
Sections are of the form [SecitonTitle "SectionArgument"],
where section argument is optional.
* List
We use colon-separated string to represent a list.
For instance, n1:n2:n3:n4 is a list containing four values.
Below is an example of a RocksDB options file:
[Version]
rocksdb_version=4.0.0
options_file_version=1.0
[DBOptions]
max_open_files=12345
max_background_flushes=301
[CFOptions "default"]
[CFOptions "the second column family"]
[CFOptions "the third column family"]
Test Plan: Added many tests in options_test.cc
Reviewers: igor, IslamAbdelRahman, sdong, anthony
Reviewed By: anthony
Subscribers: maykov, dhruba, leveldb
Differential Revision: https://reviews.facebook.net/D46059
2015-09-29 23:42:40 +02:00
|
|
|
#
|
|
|
|
# * Escaped characters
|
|
|
|
# We escaped the following characters:
|
|
|
|
# - \n -- line feed - new line
|
|
|
|
# - \r -- carriage return
|
|
|
|
# - \\ -- backslash \
|
|
|
|
# - \: -- colon symbol :
|
|
|
|
# - \# -- hash tag #
|
|
|
|
# * Comments
|
|
|
|
# We support # style comments. Comments can appear at the ending
|
|
|
|
# part of a line.
|
|
|
|
# * Statements
|
|
|
|
# A statement is of the form option_name = value.
|
|
|
|
# Each statement contains a '=', where extra white-spaces
|
|
|
|
# are supported. However, we don't support multi-lined statement.
|
|
|
|
# Furthermore, each line can only contain at most one statement.
|
2015-12-01 03:10:00 +01:00
|
|
|
# * Sections
|
RocksDB Options file format and its serialization / deserialization.
Summary:
This patch defines the format of RocksDB options file, which
follows the INI file format, and implements functions for its
serialization and deserialization. An example RocksDB options
file can be found in examples/rocksdb_option_file_example.ini.
A typical RocksDB options file has three sections, which are
Version, DBOptions, and more than one CFOptions. The RocksDB
options file in general follows the basic INI file format
with the following extensions / modifications:
* Escaped characters
We escaped the following characters:
- \n -- line feed - new line
- \r -- carriage return
- \\ -- backslash \
- \: -- colon symbol :
- \# -- hash tag #
* Comments
We support # style comments. Comments can appear at the ending
part of a line.
* Statements
A statement is of the form option_name = value.
Each statement contains a '=', where extra white-spaces
are supported. However, we don't support multi-lined statement.
Furthermore, each line can only contain at most one statement.
* Section
Sections are of the form [SecitonTitle "SectionArgument"],
where section argument is optional.
* List
We use colon-separated string to represent a list.
For instance, n1:n2:n3:n4 is a list containing four values.
Below is an example of a RocksDB options file:
[Version]
rocksdb_version=4.0.0
options_file_version=1.0
[DBOptions]
max_open_files=12345
max_background_flushes=301
[CFOptions "default"]
[CFOptions "the second column family"]
[CFOptions "the third column family"]
Test Plan: Added many tests in options_test.cc
Reviewers: igor, IslamAbdelRahman, sdong, anthony
Reviewed By: anthony
Subscribers: maykov, dhruba, leveldb
Differential Revision: https://reviews.facebook.net/D46059
2015-09-29 23:42:40 +02:00
|
|
|
# Sections are of the form [SecitonTitle "SectionArgument"],
|
|
|
|
# where section argument is optional.
|
|
|
|
# * List
|
|
|
|
# We use colon-separated string to represent a list.
|
|
|
|
# For instance, n1:n2:n3:n4 is a list containing four values.
|
|
|
|
#
|
|
|
|
# Below is an example of a RocksDB options file:
|
|
|
|
[Version]
|
2015-12-09 01:17:06 +01:00
|
|
|
rocksdb_version=4.3.0
|
2015-10-11 21:17:42 +02:00
|
|
|
options_file_version=1.1
|
|
|
|
|
RocksDB Options file format and its serialization / deserialization.
Summary:
This patch defines the format of RocksDB options file, which
follows the INI file format, and implements functions for its
serialization and deserialization. An example RocksDB options
file can be found in examples/rocksdb_option_file_example.ini.
A typical RocksDB options file has three sections, which are
Version, DBOptions, and more than one CFOptions. The RocksDB
options file in general follows the basic INI file format
with the following extensions / modifications:
* Escaped characters
We escaped the following characters:
- \n -- line feed - new line
- \r -- carriage return
- \\ -- backslash \
- \: -- colon symbol :
- \# -- hash tag #
* Comments
We support # style comments. Comments can appear at the ending
part of a line.
* Statements
A statement is of the form option_name = value.
Each statement contains a '=', where extra white-spaces
are supported. However, we don't support multi-lined statement.
Furthermore, each line can only contain at most one statement.
* Section
Sections are of the form [SecitonTitle "SectionArgument"],
where section argument is optional.
* List
We use colon-separated string to represent a list.
For instance, n1:n2:n3:n4 is a list containing four values.
Below is an example of a RocksDB options file:
[Version]
rocksdb_version=4.0.0
options_file_version=1.0
[DBOptions]
max_open_files=12345
max_background_flushes=301
[CFOptions "default"]
[CFOptions "the second column family"]
[CFOptions "the third column family"]
Test Plan: Added many tests in options_test.cc
Reviewers: igor, IslamAbdelRahman, sdong, anthony
Reviewed By: anthony
Subscribers: maykov, dhruba, leveldb
Differential Revision: https://reviews.facebook.net/D46059
2015-09-29 23:42:40 +02:00
|
|
|
[DBOptions]
|
2015-10-11 21:17:42 +02:00
|
|
|
stats_dump_period_sec=600
|
|
|
|
max_manifest_file_size=18446744073709551615
|
2015-12-09 01:17:06 +01:00
|
|
|
bytes_per_sync=8388608
|
|
|
|
delayed_write_rate=2097152
|
2015-10-11 21:17:42 +02:00
|
|
|
WAL_ttl_seconds=0
|
|
|
|
WAL_size_limit_MB=0
|
|
|
|
max_subcompactions=1
|
|
|
|
wal_dir=
|
|
|
|
wal_bytes_per_sync=0
|
|
|
|
db_write_buffer_size=0
|
2015-12-09 01:17:06 +01:00
|
|
|
keep_log_file_num=1000
|
|
|
|
table_cache_numshardbits=4
|
2015-10-11 21:17:42 +02:00
|
|
|
max_file_opening_threads=1
|
2015-12-09 01:17:06 +01:00
|
|
|
writable_file_max_buffer_size=1048576
|
|
|
|
random_access_max_buffer_size=1048576
|
2015-10-11 21:17:42 +02:00
|
|
|
use_fsync=false
|
2015-12-09 01:17:06 +01:00
|
|
|
max_total_wal_size=0
|
|
|
|
max_open_files=-1
|
|
|
|
skip_stats_update_on_db_open=false
|
|
|
|
max_background_compactions=16
|
2015-10-11 21:17:42 +02:00
|
|
|
manifest_preallocation_size=4194304
|
2015-12-09 01:17:06 +01:00
|
|
|
max_background_flushes=7
|
2015-10-11 21:17:42 +02:00
|
|
|
is_fd_close_on_exec=true
|
|
|
|
max_log_file_size=0
|
|
|
|
advise_random_on_open=true
|
|
|
|
create_missing_column_families=false
|
|
|
|
paranoid_checks=true
|
|
|
|
delete_obsolete_files_period_micros=21600000000
|
|
|
|
log_file_time_to_roll=0
|
|
|
|
compaction_readahead_size=0
|
2015-12-09 01:17:06 +01:00
|
|
|
create_if_missing=false
|
|
|
|
use_adaptive_mutex=false
|
|
|
|
enable_thread_tracking=false
|
|
|
|
allow_fallocate=true
|
|
|
|
error_if_exists=false
|
|
|
|
recycle_log_file_num=0
|
2015-10-11 21:17:42 +02:00
|
|
|
db_log_dir=
|
2022-01-28 10:45:10 +01:00
|
|
|
skip_log_error_on_recovery=false
|
2015-12-09 01:17:06 +01:00
|
|
|
new_table_reader_for_compaction_inputs=true
|
2016-12-22 21:51:29 +01:00
|
|
|
allow_mmap_reads=false
|
2015-10-11 21:17:42 +02:00
|
|
|
allow_mmap_writes=false
|
2016-12-22 21:51:29 +01:00
|
|
|
use_direct_reads=false
|
|
|
|
use_direct_writes=false
|
|
|
|
|
2015-10-11 21:17:42 +02:00
|
|
|
|
RocksDB Options file format and its serialization / deserialization.
Summary:
This patch defines the format of RocksDB options file, which
follows the INI file format, and implements functions for its
serialization and deserialization. An example RocksDB options
file can be found in examples/rocksdb_option_file_example.ini.
A typical RocksDB options file has three sections, which are
Version, DBOptions, and more than one CFOptions. The RocksDB
options file in general follows the basic INI file format
with the following extensions / modifications:
* Escaped characters
We escaped the following characters:
- \n -- line feed - new line
- \r -- carriage return
- \\ -- backslash \
- \: -- colon symbol :
- \# -- hash tag #
* Comments
We support # style comments. Comments can appear at the ending
part of a line.
* Statements
A statement is of the form option_name = value.
Each statement contains a '=', where extra white-spaces
are supported. However, we don't support multi-lined statement.
Furthermore, each line can only contain at most one statement.
* Section
Sections are of the form [SecitonTitle "SectionArgument"],
where section argument is optional.
* List
We use colon-separated string to represent a list.
For instance, n1:n2:n3:n4 is a list containing four values.
Below is an example of a RocksDB options file:
[Version]
rocksdb_version=4.0.0
options_file_version=1.0
[DBOptions]
max_open_files=12345
max_background_flushes=301
[CFOptions "default"]
[CFOptions "the second column family"]
[CFOptions "the third column family"]
Test Plan: Added many tests in options_test.cc
Reviewers: igor, IslamAbdelRahman, sdong, anthony
Reviewed By: anthony
Subscribers: maykov, dhruba, leveldb
Differential Revision: https://reviews.facebook.net/D46059
2015-09-29 23:42:40 +02:00
|
|
|
[CFOptions "default"]
|
2015-10-11 21:17:42 +02:00
|
|
|
compaction_style=kCompactionStyleLevel
|
|
|
|
compaction_filter=nullptr
|
2015-12-09 01:17:06 +01:00
|
|
|
num_levels=6
|
2015-10-11 21:17:42 +02:00
|
|
|
table_factory=BlockBasedTable
|
|
|
|
comparator=leveldb.BytewiseComparator
|
|
|
|
max_sequential_skip_in_iterations=8
|
2015-12-09 01:17:06 +01:00
|
|
|
max_bytes_for_level_base=1073741824
|
2015-10-11 21:17:42 +02:00
|
|
|
memtable_prefix_bloom_probes=6
|
|
|
|
memtable_prefix_bloom_bits=0
|
|
|
|
memtable_prefix_bloom_huge_page_tlb_size=0
|
|
|
|
max_successive_merges=0
|
2015-12-09 01:17:06 +01:00
|
|
|
arena_block_size=16777216
|
|
|
|
min_write_buffer_number_to_merge=1
|
2015-10-11 21:17:42 +02:00
|
|
|
target_file_size_multiplier=1
|
|
|
|
source_compaction_factor=1
|
2015-12-09 01:17:06 +01:00
|
|
|
max_bytes_for_level_multiplier=8
|
2016-09-14 06:12:43 +02:00
|
|
|
max_bytes_for_level_multiplier_additional=2:3:5
|
2015-10-11 21:17:42 +02:00
|
|
|
compaction_filter_factory=nullptr
|
2015-12-09 01:17:06 +01:00
|
|
|
max_write_buffer_number=8
|
|
|
|
level0_stop_writes_trigger=20
|
2015-10-11 21:17:42 +02:00
|
|
|
compression=kSnappyCompression
|
2015-12-09 01:17:06 +01:00
|
|
|
level0_file_num_compaction_trigger=4
|
2022-01-27 07:02:02 +01:00
|
|
|
purge_redundant_kvs_while_flush=true
|
Refactor trimming logic for immutable memtables (#5022)
Summary:
MyRocks currently sets `max_write_buffer_number_to_maintain` in order to maintain enough history for transaction conflict checking. The effectiveness of this approach depends on the size of memtables. When memtables are small, it may not keep enough history; when memtables are large, this may consume too much memory.
We are proposing a new way to configure memtable list history: by limiting the memory usage of immutable memtables. The new option is `max_write_buffer_size_to_maintain` and it will take precedence over the old `max_write_buffer_number_to_maintain` if they are both set to non-zero values. The new option accounts for the total memory usage of flushed immutable memtables and mutable memtable. When the total usage exceeds the limit, RocksDB may start dropping immutable memtables (which is also called trimming history), starting from the oldest one.
The semantics of the old option actually works both as an upper bound and lower bound. History trimming will start if number of immutable memtables exceeds the limit, but it will never go below (limit-1) due to history trimming.
In order the mimic the behavior with the new option, history trimming will stop if dropping the next immutable memtable causes the total memory usage go below the size limit. For example, assuming the size limit is set to 64MB, and there are 3 immutable memtables with sizes of 20, 30, 30. Although the total memory usage is 80MB > 64MB, dropping the oldest memtable will reduce the memory usage to 60MB < 64MB, so in this case no memtable will be dropped.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5022
Differential Revision: D14394062
Pulled By: miasantreble
fbshipit-source-id: 60457a509c6af89d0993f988c9b5c2aa9e45f5c5
2019-08-23 22:54:09 +02:00
|
|
|
max_write_buffer_size_to_maintain=0
|
2015-10-11 21:17:42 +02:00
|
|
|
memtable_factory=SkipListFactory
|
2015-12-09 01:17:06 +01:00
|
|
|
max_grandparent_overlap_factor=8
|
2015-10-11 21:17:42 +02:00
|
|
|
expanded_compaction_factor=25
|
2015-12-09 01:17:06 +01:00
|
|
|
hard_pending_compaction_bytes_limit=137438953472
|
2015-10-11 21:17:42 +02:00
|
|
|
inplace_update_num_locks=10000
|
2015-12-09 01:17:06 +01:00
|
|
|
level_compaction_dynamic_level_bytes=true
|
|
|
|
level0_slowdown_writes_trigger=12
|
2015-10-11 21:17:42 +02:00
|
|
|
filter_deletes=false
|
|
|
|
verify_checksums_in_compaction=true
|
|
|
|
min_partial_merge_operands=2
|
|
|
|
paranoid_file_checks=false
|
2015-12-09 01:17:06 +01:00
|
|
|
target_file_size_base=134217728
|
2015-10-11 21:17:42 +02:00
|
|
|
optimize_filters_for_hits=false
|
2015-12-09 01:17:06 +01:00
|
|
|
merge_operator=PutOperator
|
|
|
|
compression_per_level=kNoCompression:kNoCompression:kNoCompression:kSnappyCompression:kSnappyCompression:kSnappyCompression
|
2015-10-11 21:17:42 +02:00
|
|
|
compaction_measure_io_stats=false
|
|
|
|
prefix_extractor=nullptr
|
|
|
|
bloom_locality=0
|
|
|
|
write_buffer_size=134217728
|
|
|
|
disable_auto_compactions=false
|
|
|
|
inplace_update_support=false
|
2016-12-22 21:51:29 +01:00
|
|
|
|
2015-10-11 21:17:42 +02:00
|
|
|
[TableOptions/BlockBasedTable "default"]
|
2015-12-09 01:17:06 +01:00
|
|
|
format_version=2
|
2015-10-11 21:17:42 +02:00
|
|
|
whole_key_filtering=true
|
|
|
|
no_block_cache=false
|
|
|
|
checksum=kCRC32c
|
2015-12-09 01:17:06 +01:00
|
|
|
filter_policy=rocksdb.BuiltinBloomFilter
|
2015-10-11 21:17:42 +02:00
|
|
|
block_size_deviation=10
|
2015-12-09 01:17:06 +01:00
|
|
|
block_size=8192
|
2015-10-11 21:17:42 +02:00
|
|
|
block_restart_interval=16
|
|
|
|
cache_index_and_filter_blocks=false
|
Adding pin_l0_filter_and_index_blocks_in_cache feature and related fixes.
Summary:
When a block based table file is opened, if prefetch_index_and_filter is true, it will prefetch the index and filter blocks, putting them into the block cache.
What this feature adds: when a L0 block based table file is opened, if pin_l0_filter_and_index_blocks_in_cache is true in the options (and prefetch_index_and_filter is true), then the filter and index blocks aren't released back to the block cache at the end of BlockBasedTableReader::Open(). Instead the table reader takes ownership of them, hence pinning them, ie. the LRU cache will never push them out. Meanwhile in the table reader, further accesses will not hit the block cache, thus avoiding lock contention.
Test Plan:
'export TEST_TMPDIR=/dev/shm/ && DISABLE_JEMALLOC=1 OPT=-g make all valgrind_check -j32' is OK.
I didn't run the Java tests, I don't have Java set up on my devserver.
Reviewers: sdong
Reviewed By: sdong
Subscribers: andrewkr, dhruba
Differential Revision: https://reviews.facebook.net/D56133
2016-04-01 19:42:39 +02:00
|
|
|
pin_l0_filter_and_index_blocks_in_cache=false
|
2018-06-23 00:14:05 +02:00
|
|
|
pin_top_level_index_and_filter=false
|
2015-10-11 21:17:42 +02:00
|
|
|
index_type=kBinarySearch
|
|
|
|
flush_block_policy_factory=FlushBlockBySizePolicyFactory
|