Skip to content

Commit 0aebfe9

Browse files
committed
go/storage/mkvs/db/pathbadger: Fix pruning
1 parent a5f223c commit 0aebfe9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

go/storage/mkvs/db/pathbadger/pathbadger.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,11 @@ func (d *badgerNodeDB) Prune(version uint64) error {
555555

556556
// Delete data for all root types that cannot have children.
557557
for _, rootType := range api.RootTypesWithPolicy(func(p *api.RootPolicy) bool { return p.NoChildRoots }) {
558-
// Delete all finalized nodes.
558+
// Delete all finalized nodes for this version.
559559
wtx := d.db.NewTransactionAt(versionToTs(version), false)
560560
defer wtx.Discard()
561561

562-
prefix := finalizedNodeKeyFmt.Encode(byte(rootType))
562+
prefix := finalizedNodeKeyFmt.Encode(byte(rootType), encodeVersionKey(version))
563563
it := wtx.NewIterator(badger.IteratorOptions{Prefix: prefix})
564564
defer it.Close()
565565

0 commit comments

Comments
 (0)