]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Include max_write_buffer_number >= 2 to SanitizeOptions.
authorYueh-Hsuan Chiang <yhchiang@fb.com>
Mon, 16 Jun 2014 23:26:46 +0000 (16:26 -0700)
committerYueh-Hsuan Chiang <yhchiang@fb.com>
Mon, 16 Jun 2014 23:26:46 +0000 (16:26 -0700)
Summary: Include max_write_buffer_number >= 2 to SanitizeOptions.

Test Plan: make all check

Reviewers: haobo, sdong, igor, ljin

Reviewed By: ljin

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D19077

db/column_family.cc
include/rocksdb/options.h

index 45a3e9a82addfda0cb0615208f0930d500b2b6ef..c4132b367c0070360d6c42fb28d3a5a676338057 100644 (file)
@@ -92,6 +92,9 @@ ColumnFamilyOptions SanitizeOptions(const InternalKeyComparator* icmp,
   if (result.soft_rate_limit > result.hard_rate_limit) {
     result.soft_rate_limit = result.hard_rate_limit;
   }
+  if (result.max_write_buffer_number < 2) {
+    result.max_write_buffer_number = 2;
+  }
   if (!result.prefix_extractor) {
     assert(result.memtable_factory);
     Slice name = result.memtable_factory->Name();
index d8e25072170c93398a1089edef08098800a46877..d32e95aefd83bd45ec490ee702e000dbf53135dc 100644 (file)
@@ -184,8 +184,9 @@ struct ColumnFamilyOptions {
   size_t write_buffer_size;
 
   // The maximum number of write buffers that are built up in memory.
-  // The default is 2, so that when 1 write buffer is being flushed to
-  // storage, new writes can continue to the other write buffer.
+  // The default and the minimum number is 2, so that when 1 write buffer
+  // is being flushed to storage, new writes can continue to the other
+  // write buffer.
   // Default: 2
   int max_write_buffer_number;