Skip to content

Commit

Permalink
fix bug in auto-compact
Browse files Browse the repository at this point in the history
  • Loading branch information
WIZARD-CXY committed Mar 16, 2018
1 parent 15926e0 commit b8769eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compactor/periodic.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ func (t *Periodic) Run() {
}
plog.Noticef("Starting auto-compaction at revision %d (retention: %v)", rev, t.period)
_, err := t.c.Compact(t.ctx, &pb.CompactionRequest{Revision: rev})

if err == nil || err == mvcc.ErrCompacted {
t.revs = remaining
// update the last compaction time
last = clock.Now()
plog.Noticef("Finished auto-compaction at revision %d", rev)
} else {
plog.Noticef("Failed auto-compaction at revision %d (%v)", rev, err)
Expand Down

0 comments on commit b8769eb

Please sign in to comment.