mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
Restarting a node mid-snap-sync can crash-loop during startup chain repair. On a restart mid-sync the pathdb is disabled (`waitSync`), so repair rewinds the stateless head to genesis and asks `StateRecoverable` if it can roll back there. `Recoverable` doesn't check `waitSync`, so it reports genesis as recoverable, but `Recover` does and refuses with `waiting for sync`, tripping a `log.Crit`. The flag is persisted, so the node crash-loops on every restart. CRIT Failed to recover state number=0 hash=37fcdc..6edf0b err="waiting for sync" The fix is to make `Recoverable` return false while a sync is running, so it agrees with `Recover`. Repair then falls through to the existing "wait state sync" path. |
||
|---|---|---|
| .. | ||
| database | ||
| hashdb | ||
| internal | ||
| pathdb | ||
| database.go | ||
| generate.go | ||
| generate_test.go | ||
| history.go | ||
| preimages.go | ||
| preimages_test.go | ||
| states.go | ||