mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
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.
This commit is contained in:
parent
353f10ca2b
commit
6d97dcaf3f
@ -171,6 +171,8 @@ func (s *store) Compact(rev int64) error {
|
|||||||
tx.Lock()
|
tx.Lock()
|
||||||
tx.UnsafePut(metaBucketName, scheduledCompactKeyName, rbytes)
|
tx.UnsafePut(metaBucketName, scheduledCompactKeyName, rbytes)
|
||||||
tx.Unlock()
|
tx.Unlock()
|
||||||
|
// ensure that desired compaction is persisted
|
||||||
|
s.b.ForceCommit()
|
||||||
|
|
||||||
keep := s.kvindex.Compact(rev)
|
keep := s.kvindex.Compact(rev)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user