diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 3fa9e8f28..72e033905 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -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 }) diff --git a/ethdb/kv_lmdb.go b/ethdb/kv_lmdb.go index c5530aef3..1113f80cc 100644 --- a/ethdb/kv_lmdb.go +++ b/ethdb/kv_lmdb.go @@ -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 }