From: songqing Date: Tue, 21 Nov 2023 17:34:59 +0000 (-0800) Subject: Fix compact_files_example (#12084) X-Git-Tag: v8.9.1~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d3e015fe06a6ba01e0c93687416deb1d70c57769;p=rocksdb.git 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 --- 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;