mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
Revert "trie/triedb/pathdb: make shutdown journal log friendlier (#27905)"
This reverts commit e7bebb9200.
This commit is contained in:
parent
b3a35f84e7
commit
414953c066
1 changed files with 1 additions and 10 deletions
|
|
@ -21,7 +21,6 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/core/rawdb"
|
"github.com/ethereum/go-ethereum/core/rawdb"
|
||||||
|
|
@ -342,14 +341,6 @@ func (db *Database) Journal(root common.Hash) error {
|
||||||
if l == nil {
|
if l == nil {
|
||||||
return fmt.Errorf("triedb layer [%#x] missing", root)
|
return fmt.Errorf("triedb layer [%#x] missing", root)
|
||||||
}
|
}
|
||||||
disk := db.tree.bottom()
|
|
||||||
if l, ok := l.(*diffLayer); ok {
|
|
||||||
log.Info("Persisting dirty state to disk", "head", l.block, "root", root, "layers", l.id-disk.id+disk.buffer.layers)
|
|
||||||
} else { // disk layer only on noop runs (likely) or deep reorgs (unlikely)
|
|
||||||
log.Info("Persisting dirty state to disk", "root", root, "layers", disk.buffer.layers)
|
|
||||||
}
|
|
||||||
start := time.Now()
|
|
||||||
|
|
||||||
// Run the journaling
|
// Run the journaling
|
||||||
db.lock.Lock()
|
db.lock.Lock()
|
||||||
defer db.lock.Unlock()
|
defer db.lock.Unlock()
|
||||||
|
|
@ -382,6 +373,6 @@ func (db *Database) Journal(root common.Hash) error {
|
||||||
|
|
||||||
// Set the db in read only mode to reject all following mutations
|
// Set the db in read only mode to reject all following mutations
|
||||||
db.readOnly = true
|
db.readOnly = true
|
||||||
log.Info("Persisted dirty state to disk", "size", common.StorageSize(journal.Len()), "elapsed", common.PrettyDuration(time.Since(start)))
|
log.Info("Stored journal in triedb", "disk", diskroot, "size", common.StorageSize(journal.Len()))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue