storage: reject to compact on future rev

Compaction on future rev is unreasonable.
release-2.2
Yicheng Qin 2015-08-22 16:44:39 -07:00
parent 47b243be5d
commit 353f10ca2b
1 changed files with 3 additions and 0 deletions

View File

@ -158,6 +158,9 @@ func (s *store) Compact(rev int64) error {
if rev <= s.compactMainRev {
return ErrCompacted
}
if rev > s.currentRev.main {
return ErrFutureRev
}
s.compactMainRev = rev