mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
Better logs3 (#976)
This commit is contained in:
parent
9091ce62bb
commit
714e5041e2
@ -576,7 +576,6 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, blockNumb
|
||||
if canRunCycleInOneTransaction {
|
||||
tx = ethdb.NewTxDbWithoutTransaction(d.stateDB)
|
||||
defer func() {
|
||||
log.Info("cycle: rollback transaction")
|
||||
tx.Rollback()
|
||||
}()
|
||||
writeDB = tx
|
||||
@ -611,7 +610,6 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, blockNumb
|
||||
return nil
|
||||
}
|
||||
|
||||
log.Info("cycle: begin transaction")
|
||||
var errTx error
|
||||
tx, errTx = tx.Begin()
|
||||
return errTx
|
||||
@ -621,7 +619,7 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, blockNumb
|
||||
return nil
|
||||
}
|
||||
|
||||
log.Info("cycle: commit transaction")
|
||||
log.Info("Commit blocks")
|
||||
_, errTx := tx.Commit()
|
||||
return errTx
|
||||
})
|
||||
@ -635,7 +633,6 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, blockNumb
|
||||
if hasTx, ok := tx.(ethdb.HasTx); ok && hasTx.Tx() != nil {
|
||||
return nil
|
||||
}
|
||||
log.Info("cycle unwind: begin transaction")
|
||||
var errTx error
|
||||
tx, errTx = tx.Begin()
|
||||
return errTx
|
||||
@ -647,7 +644,7 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, blockNumb
|
||||
if hasTx, ok := tx.(ethdb.HasTx); ok && hasTx.Tx() == nil {
|
||||
return nil
|
||||
}
|
||||
log.Info("cycle unwind: commit transaction")
|
||||
log.Info("Commit blocks")
|
||||
_, errCommit := tx.Commit()
|
||||
return errCommit
|
||||
})
|
||||
|
@ -324,8 +324,8 @@ func (db *LmdbKV) Update(ctx context.Context, f func(tx Tx) error) (err error) {
|
||||
}
|
||||
|
||||
commitTook := time.Since(commitTimer)
|
||||
if commitTook > 10*time.Second {
|
||||
log.Info("Batch", "commit", commitTook)
|
||||
if commitTook > 20*time.Second {
|
||||
log.Info("Commit", "took", commitTook)
|
||||
}
|
||||
|
||||
fsyncTimer := time.Now()
|
||||
@ -333,8 +333,8 @@ func (db *LmdbKV) Update(ctx context.Context, f func(tx Tx) error) (err error) {
|
||||
log.Warn("fsync after commit failed: \n", err)
|
||||
}
|
||||
fsyncTook := time.Since(fsyncTimer)
|
||||
if fsyncTook > 10*time.Second {
|
||||
log.Info("Batch", "fsync", fsyncTook)
|
||||
if fsyncTook > 20*time.Second {
|
||||
log.Info("Fsync", "took", fsyncTook)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user