Skip to content

Commit

Permalink
e3: commit earlier (#6271)
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov authored Dec 10, 2022
1 parent b4fd07b commit e21b1b6
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions eth/stagedsync/exec3.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,14 @@ func ExecV3(ctx context.Context,

stepsInDB := idxStepsInDB(tx)
progress.Log(rs, rwsLen, uint64(queueSize), rs.DoneCount(), inputBlockNum.Load(), outputBlockNum.Load(), outputTxNum.Load(), repeatCount.Load(), uint64(resultsSize.Load()), resultCh, stepsInDB)
case <-pruneEvery.C:
if rs.SizeEstimate() < commitThreshold {
if err = agg.Flush(tx); err != nil {
panic(err)
}
if err = agg.PruneWithTiemout(ctx, 1*time.Second); err != nil {
panic(err)
}
break
}

Expand Down Expand Up @@ -352,13 +359,7 @@ func ExecV3(ctx context.Context,
panic(err)
}
log.Info("Committed", "time", time.Since(commitStart), "drain", t1, "rs.flush", t2, "agg.flush", t3, "tx.commit", t4)
case <-pruneEvery.C:
if err = agg.Flush(tx); err != nil {
panic(err)
}
if err = agg.PruneWithTiemout(ctx, 1*time.Second); err != nil {
panic(err)
}

}
}
if err = rs.Flush(tx); err != nil {
Expand Down

0 comments on commit e21b1b6

Please sign in to comment.