]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fix compact_files_example (#12084)
authorsongqing <zhangsongqing164@163.com>
Tue, 21 Nov 2023 17:34:59 +0000 (09:34 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 21 Nov 2023 17:34:59 +0000 (09:34 -0800)
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

examples/compact_files_example.cc

index 1ecf8c794744fb9c2847d102444aa23aab152ea3..544adf8ae6ac179b120a9a5c35e424e44a061a2b 100644 (file)
@@ -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;