Skip to content

Commit

Permalink
db: minor improvements to Options comments
Browse files Browse the repository at this point in the history
  • Loading branch information
RaduBerinde committed Sep 5, 2023
1 parent 7ffe773 commit ba62e0c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 int

// 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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ba62e0c

Please sign in to comment.