This commit is contained in:
alex.sharov 2023-03-10 12:20:50 +07:00
parent 99f5be5e21
commit 8189fdd587

View File

@ -328,12 +328,10 @@ func ExecV3(ctx context.Context,
case <-pruneEvery.C: case <-pruneEvery.C:
if rs.SizeEstimate() < commitThreshold { if rs.SizeEstimate() < commitThreshold {
if agg.CanPrune(tx) { if agg.CanPrune(tx) {
log.Warn("Aggressive prune")
if err = agg.Prune(ctx, ethconfig.HistoryV3AggregationStep/10); err != nil { // prune part of retired data, before commit if err = agg.Prune(ctx, ethconfig.HistoryV3AggregationStep/10); err != nil { // prune part of retired data, before commit
panic(err) panic(err)
} }
} else { } else {
log.Warn("No aggressive prune")
if err = agg.Flush(ctx, tx); err != nil { if err = agg.Flush(ctx, tx); err != nil {
return err return err
} }