Skip to content

Commit

Permalink
Merge pull request #764 from jarifibrahim/readonly-compaction
Browse files Browse the repository at this point in the history
Do not perform compaction in read only mode
  • Loading branch information
jarifibrahim authored Apr 16, 2019
2 parents 851e462 + cce40af commit 4f863b3
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 @@ -185,6 +185,8 @@ func Open(opt Options) (db *DB, err error) {
if opt.ReadOnly {
// Can't truncate if the DB is read only.
opt.Truncate = false
// Do not perform compaction in read only mode.
opt.CompactL0OnClose = false
}

for _, path := range []string{opt.Dir, opt.ValueDir} {
Expand Down

0 comments on commit 4f863b3

Please sign in to comment.