mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
Properly remove borspans snapshots after merges (#8647)
This commit is contained in:
parent
2aab8f496c
commit
1ffa3fcf94
@ -374,7 +374,7 @@ func DumpBorEvents(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, w
|
||||
return nil
|
||||
}
|
||||
|
||||
// DumpBorEvents - [from, to)
|
||||
// DumpBorSpans - [from, to)
|
||||
func DumpBorSpans(ctx context.Context, db kv.RoDB, blockFrom, blockTo uint64, workers int, lvl log.Lvl, logger log.Logger, collect func([]byte) error) error {
|
||||
logEvery := time.NewTicker(20 * time.Second)
|
||||
defer logEvery.Stop()
|
||||
@ -1163,8 +1163,7 @@ func (m *BorMerger) Merge(ctx context.Context, snapshots *BorRoSnapshots, mergeR
|
||||
return err
|
||||
}
|
||||
}
|
||||
time.Sleep(1 * time.Second) // i working on blocking API - to ensure client does not use old snapsthos - and then delete them
|
||||
for _, t := range snaptype.BlockSnapshotTypes {
|
||||
for _, t := range []snaptype.Type{snaptype.BorEvents, snaptype.BorSpans} {
|
||||
m.removeOldFiles(toMerge[t], snapDir)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user