mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
[lmdb] Stop force sync for ReadOnly mode (#1088)
* fix warning * fix log
This commit is contained in:
parent
fd9c7c3b2d
commit
bdb7832a59
@ -450,10 +450,10 @@ func (tx *lmdbTx) Commit(ctx context.Context) error {
|
|||||||
log.Info("Batch", "commit", commitTook)
|
log.Info("Batch", "commit", commitTook)
|
||||||
}
|
}
|
||||||
|
|
||||||
if !tx.isSubTx { // call fsync only after main transaction commit
|
if !tx.isSubTx && !tx.db.opts.readOnly { // call fsync only after main transaction commit
|
||||||
fsyncTimer := time.Now()
|
fsyncTimer := time.Now()
|
||||||
if err := tx.db.env.Sync(true); err != nil {
|
if err := tx.db.env.Sync(true); err != nil {
|
||||||
log.Warn("fsync after commit failed: \n", err)
|
log.Warn("fsync after commit failed", "err", err)
|
||||||
}
|
}
|
||||||
fsyncTook := time.Since(fsyncTimer)
|
fsyncTook := time.Since(fsyncTimer)
|
||||||
if fsyncTook > 20*time.Second {
|
if fsyncTook > 20*time.Second {
|
||||||
|
Loading…
Reference in New Issue
Block a user