mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
add more logs
This commit is contained in:
parent
ec7e7c48fe
commit
dcdac9f549
2 changed files with 4 additions and 3 deletions
|
|
@ -173,7 +173,8 @@ func New(diskdb ethdb.Database, config *Config) *Database {
|
|||
// it's not aligned with the disk layer.
|
||||
pruned, err := truncateFromHead(db.diskdb, freezer, db.tree.bottom().stateID())
|
||||
if err != nil {
|
||||
log.Crit("Failed to truncate extra state histories", "err", err)
|
||||
persistentID := rawdb.ReadPersistentStateID(db.diskdb)
|
||||
log.Crit("Failed to truncate extra state histories", "persistentID", persistentID, "diskID", db.tree.bottom().stateID(), "err", err)
|
||||
}
|
||||
if pruned != 0 {
|
||||
log.Warn("Truncated extra state histories", "number", pruned)
|
||||
|
|
|
|||
|
|
@ -596,7 +596,7 @@ func truncateFromHead(db ethdb.Batcher, freezer *rawdb.ResettableFreezer, nhead
|
|||
// Load the meta objects in range [nhead+1, ohead]
|
||||
blobs, err := rawdb.ReadStateHistoryMetaList(freezer, nhead+1, ohead-nhead)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
return 0, fmt.Errorf("%w, start: %d, count: %d, tail: %d, head: %d", err, nhead+1, ohead-nhead, otail, ohead)
|
||||
}
|
||||
batch := db.NewBatch()
|
||||
for _, blob := range blobs {
|
||||
|
|
@ -611,7 +611,7 @@ func truncateFromHead(db ethdb.Batcher, freezer *rawdb.ResettableFreezer, nhead
|
|||
}
|
||||
ohead, err = freezer.TruncateHead(nhead)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
return 0, fmt.Errorf("%w, target: %d, tail: %d, head: %d", err, nhead, otail, ohead)
|
||||
}
|
||||
return int(ohead - nhead), nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue