Skip to content

Commit

Permalink
Test snapshot deletion - phase 1 (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
outofforest authored Dec 23, 2024
1 parent 5b98e1c commit 02103b6
Show file tree
Hide file tree
Showing 2 changed files with 425 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,6 @@ func deleteSnapshot(
}
snapshotInfo := snapshotSpace.ReadKey(&snapshotInfoValue)

snapshotSpace.DeleteKey(&snapshotInfoValue, tx)

var nextSnapshotInfoValue space.Entry[types.SnapshotID, types.SnapshotInfo]
snapshotSpace.Find(&nextSnapshotInfoValue, snapshotInfo.NextSnapshotID, space.StageData)

Expand Down Expand Up @@ -677,6 +675,8 @@ func deleteSnapshot(
}
}

snapshotSpace.DeleteKey(&snapshotInfoValue, tx)

nextSnapshotInfo.DeallocationRoot = snapshotInfo.DeallocationRoot
nextSnapshotInfo.PreviousSnapshotID = snapshotInfo.PreviousSnapshotID
if err := snapshotSpace.SetKey(&nextSnapshotInfoValue, tx, volatileAllocator, nextSnapshotInfo); err != nil {
Expand Down
Loading

0 comments on commit 02103b6

Please sign in to comment.