Skip to content

Commit

Permalink
revert the change for keep
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
  • Loading branch information
ahrtr committed Jun 13, 2024
1 parent 891e412 commit 30eaf12
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/storage/mvcc/key_index.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,14 @@ func (ki *keyIndex) keep(atRev int64, available map[Revision]struct{}) {
return
}

ki.doCompact(atRev, available)
genIdx, revIndex := ki.doCompact(atRev, available)
g := &ki.generations[genIdx]
if !g.isEmpty() {
// remove any tombstone
if revIndex == len(g.revs)-1 && genIdx != len(ki.generations)-1 {
delete(available, g.revs[revIndex])
}
}
}

func (ki *keyIndex) doCompact(atRev int64, available map[Revision]struct{}) (genIdx int, revIndex int) {
Expand Down

0 comments on commit 30eaf12

Please sign in to comment.