Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove overlapped files only after merge save #10511

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions turbo/snapshotsync/freezeblocks/bor_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,21 @@ func (br *BlockRetire) retireBorBlocks(ctx context.Context, minBlockNum uint64,
}

err := merger.Merge(ctx, &snapshots.RoSnapshots, borsnaptype.BorSnapshotTypes(), rangesToMerge, snapshots.Dir(), true /* doIndex */, onMerge, onDelete)

if err != nil {
return blocksRetired, err
}

{
files, _, err := typedSegments(br.borSnapshots().dir, br.borSnapshots().segmentsMin.Load(), borsnaptype.BorSnapshotTypes(), false)
if err != nil {
return blocksRetired, err
}

// this is one off code to fix an issue in 2.49.x->2.52.x which missed
// removal of intermediate segments after a merge operation
removeBorOverlaps(br.borSnapshots().dir, files, br.borSnapshots().BlocksAvailable())
}

return blocksRetired, nil
}

Expand Down Expand Up @@ -204,10 +215,6 @@ func (s *BorRoSnapshots) ReopenFolder() error {
return err
}

// this is one off code to fix an issue in 2.49.x->2.52.x which missed
// removal of intermediate segments after a merge operation
removeBorOverlaps(s.dir, files, s.BlocksAvailable())

list := make([]string, 0, len(files))
for _, f := range files {
_, fName := filepath.Split(f.Path)
Expand Down
Loading