Просмотр исходного кода

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.
Yicheng Qin 10 лет назад
Родитель
Сommit
6d97dcaf3f
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      storage/kvstore.go

+ 2 - 0
storage/kvstore.go

@@ -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)