From 9d4f63d9e27a2a18dc0158243652b4afdb5da4f5 Mon Sep 17 00:00:00 2001 From: Radu Berinde Date: Wed, 6 Sep 2023 09:14:20 -0700 Subject: [PATCH] db: minor improvements to Options comments --- options.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/options.go b/options.go index 7575bcbdc7..bcc6ebfa14 100644 --- a/options.go +++ b/options.go @@ -797,12 +797,18 @@ type Options struct { // writing the contents of the old one in the // background. MemTableStopWritesThreshold places a hard limit on the size of // the queued MemTables. + // + // The default value is 4MB. MemTableSize uint64 - // Hard limit on the size of queued of MemTables. Writes are stopped when the - // sum of the queued memtable sizes exceeds - // MemTableStopWritesThreshold*MemTableSize. This value should be at least 2 - // or writes will stop whenever a MemTable is being flushed. + // Hard limit on the number of queued of MemTables. Writes are stopped when + // the sum of the queued memtable sizes exceeds: + // MemTableStopWritesThreshold * MemTableSize. + // + // This value should be at least 2 or writes will stop whenever a MemTable is + // being flushed. + // + // The default value is 2. MemTableStopWritesThreshold int // Merger defines the associative merge operation to use for merging values @@ -1045,7 +1051,7 @@ func (o *Options) EnsureDefaults() *Options { o.MaxOpenFiles = 1000 } if o.MemTableSize <= 0 { - o.MemTableSize = 4 << 20 + o.MemTableSize = 4 << 20 // 4 MB } if o.MemTableStopWritesThreshold <= 0 { o.MemTableStopWritesThreshold = 2