From: Yueh-Hsuan Chiang Date: Mon, 16 Jun 2014 23:26:46 +0000 (-0700) Subject: Include max_write_buffer_number >= 2 to SanitizeOptions. X-Git-Tag: rocksdb-3.2~2^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e6e259b8abbe2b275237c4f6ebd749f71f5768dc;p=rocksdb.git Include max_write_buffer_number >= 2 to SanitizeOptions. 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 --- diff --git a/db/column_family.cc b/db/column_family.cc index 45a3e9a8..c4132b36 100644 --- a/db/column_family.cc +++ b/db/column_family.cc @@ -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(); diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index d8e25072..d32e95ae 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -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;