erigon3: cli command to force merge snapshots (#672)

This commit is contained in:
Alex Sharov 2022-10-10 09:47:05 +07:00 committed by GitHub
parent 1ce5610eea
commit 91cc20a34b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -280,6 +280,15 @@ func (a *Aggregator22) buildFilesInBackground(step uint64, collation Agg22Collat
}()
a.integrateFiles(sf, step*a.aggregationStep, (step+1)*a.aggregationStep)
log.Info("[snapshots] history build done", "step", fmt.Sprintf("%d-%d", step, step+1))
if err := a.Merge(); err != nil {
return nil
}
closeAll = false
return nil
}
func (a *Aggregator22) Merge() error {
closeAll := true
maxSpan := uint64(32) * a.aggregationStep
for r := a.findMergeRange(a.maxTxNum.Load(), maxSpan); r.any(); r = a.findMergeRange(a.maxTxNum.Load(), maxSpan) {
outs := a.staticFilesInRange(r)
@ -302,7 +311,6 @@ func (a *Aggregator22) buildFilesInBackground(step uint64, collation Agg22Collat
return err
}
}
closeAll = false
return nil
}