Skip to content

Commit

Permalink
DefaultOptions: Set KeepL0InMemory to false (#1345)
Browse files Browse the repository at this point in the history
This commit sets the default value of KeepL0InMemory to false. There
have been multiple reports of slow value log replays which is a side
effect of keeping level 0 tables in memory.
  • Loading branch information
Ibrahim Jarif committed Jun 1, 2020
1 parent e7b6e76 commit 079f5ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions options.go
Expand Up @@ -133,7 +133,7 @@ func DefaultOptions(path string) Options {
SyncWrites: true,
NumVersionsToKeep: 1,
CompactL0OnClose: true,
KeepL0InMemory: true,
KeepL0InMemory: false,
VerifyValueChecksum: false,
Compression: options.None,
MaxCacheSize: 0,
Expand Down Expand Up @@ -464,6 +464,7 @@ func (opt Options) WithNumCompactors(val int) Options {
// CompactL0OnClose determines whether Level 0 should be compacted before closing the DB.
// This ensures that both reads and writes are efficient when the DB is opened later.
// CompactL0OnClose is set to true if KeepL0InMemory is set to true.
//
// The default value of CompactL0OnClose is true.
func (opt Options) WithCompactL0OnClose(val bool) Options {
opt.CompactL0OnClose = val
Expand Down Expand Up @@ -511,7 +512,7 @@ func (opt Options) WithEncryptionKeyRotationDuration(d time.Duration) Options {
// will take longer to complete since memtables and all level 0 tables will have to be recreated.
// This option also sets CompactL0OnClose option to true.
//
// The default value of KeepL0InMemory is true.
// The default value of KeepL0InMemory is false.
func (opt Options) WithKeepL0InMemory(val bool) Options {
opt.KeepL0InMemory = val
return opt
Expand Down

0 comments on commit 079f5ae

Please sign in to comment.