Skip to content

Commit

Permalink
Force KeepL0InMemory to be true when InMemory is true (#1375)
Browse files Browse the repository at this point in the history
InMemory mode would create L0 sst tables when KeepL0InMemory
was false as mentioned in #1374 This commit will keep L0 in
memory if either KeepL0InMemory is set or InMemory is set.

On running ` go test .`
Before: sst files were visible for a second 
Now: sst files won't created/visible

Fixes #1374
  • Loading branch information
yashkothari42 authored Jun 19, 2020
1 parent dd332b0 commit 3f4761d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ func Open(opt Options) (db *DB, err error) {
if opt.Compression == options.ZSTD && !y.CgoEnabled {
return nil, y.ErrZstdCgo
}
// Keep L0 in memory if either KeepL0InMemory is set or if InMemory is set.
opt.KeepL0InMemory = opt.KeepL0InMemory || opt.InMemory

// Compact L0 on close if either it is set or if KeepL0InMemory is set. When
// keepL0InMemory is set we need to compact L0 on close otherwise we might lose data.
Expand Down

0 comments on commit 3f4761d

Please sign in to comment.