diff options
author | songqing <zhangsongqing164@163.com> | 2023-11-21 09:34:59 -0800 |
---|---|---|
committer | Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> | 2023-11-21 09:34:59 -0800 |
commit | d3e015fe06a6ba01e0c93687416deb1d70c57769 (patch) | |
tree | 38ca514f538585839f04878f4d2f574c6efdedcc /examples | |
parent | 04cbc77b907e484f50b0b52eaed8878457d23095 (diff) |
Fix compact_files_example (#12084)
Summary:
The option "write_buffer_size" has changed from 4MB for 64MB by default, and the compact_files_example will not work as expected, as the test data written is only about 50MB and will not trigger compaction.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/12084
Reviewed By: cbi42
Differential Revision: D51499959
Pulled By: ajkr
fbshipit-source-id: 4f4b25ebc4b6bb568501adc8e97813edcddceea8
Diffstat (limited to 'examples')
-rw-r--r-- | examples/compact_files_example.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/compact_files_example.cc b/examples/compact_files_example.cc index 1ecf8c794..544adf8ae 100644 --- a/examples/compact_files_example.cc +++ b/examples/compact_files_example.cc @@ -144,6 +144,8 @@ int main() { options.create_if_missing = true; // Disable RocksDB background compaction. options.compaction_style = ROCKSDB_NAMESPACE::kCompactionStyleNone; + // Small write buffer size for generating more sst files in level 0. + options.write_buffer_size = 4 << 20; // Small slowdown and stop trigger for experimental purpose. options.level0_slowdown_writes_trigger = 3; options.level0_stop_writes_trigger = 5; |