storage: ensure that desired compaction is persisted

It needs to persist the desired compaction, so it won't forget the compaction
if it crashes later.
release-2.2
Yicheng Qin 2015-08-22 16:47:19 -07:00
parent 353f10ca2b
commit 6d97dcaf3f
1 changed files with 2 additions and 0 deletions

View File

@ -171,6 +171,8 @@ func (s *store) Compact(rev int64) error {
tx.Lock()
tx.UnsafePut(metaBucketName, scheduledCompactKeyName, rbytes)
tx.Unlock()
// ensure that desired compaction is persisted
s.b.ForceCommit()
keep := s.kvindex.Compact(rev)