etcdserver: fix corruption check when server has just been compacted

Signed-off-by: kkkkun <scuzk373x@gmail.com>
This commit is contained in:
kkkkun
2023-06-11 22:26:55 +08:00
parent ffcde60e67
commit 8cffdbafba
2 changed files with 56 additions and 10 deletions

View File

@@ -175,7 +175,7 @@ func (s *store) hashByRev(rev int64) (hash KeyValueHash, currentRev int64, err e
compactRev, currentRev = s.compactMainRev, s.currentRev
s.revMu.RUnlock()
if rev > 0 && rev <= compactRev {
if rev > 0 && rev < compactRev {
s.mu.RUnlock()
return KeyValueHash{}, 0, ErrCompacted
} else if rev > 0 && rev > currentRev {