Skip to content

Commit 0b433a8

Browse files
call db.sync during compaction
1 parent e9ee9dc commit 0b433a8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

store/store.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,10 @@ func (s *Store) Partition() {
320320
if fe := sc.db.Flatten(32); fe != nil {
321321
return ErrGarbageCollectDB(fe)
322322
}
323+
// call db.Sync() to sync both the logs, the active memtable's WAL and the vLog
324+
if se := sc.db.Sync(); se != nil {
325+
return ErrGarbageCollectDB(se)
326+
}
323327
// unset isGarbageCollecting once complete
324328
defer s.isGarbageCollecting.Store(false)
325329
// trigger garbage collector to prune keys

0 commit comments

Comments
 (0)