Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geth is stuck at Head state missing, repairing #29156

Closed
rjl493456442 opened this issue Mar 4, 2024 · 1 comment · Fixed by #29196
Closed

Geth is stuck at Head state missing, repairing #29156

rjl493456442 opened this issue Mar 4, 2024 · 1 comment · Fixed by #29196
Labels

Comments

@rjl493456442
Copy link
Member

rjl493456442 commented Mar 4, 2024

Geth has a mechanism to recover from the potential unclean shutdown. Specifically, the associated chain head state might be unreachable due to the data loss caused by unclean shutdown. Therefore, a recovery mechanism is necessary to rewind the chain head until a reachable state is found. Besides, in order to avoid rebuilding the state snapshot completely, an additional trick is added that the rewound state must below the state snapshot disk layer. If so, once the chain is synced up, the leftover state snapshot can be picked up again.

During the whole rewinding, an assumption is held the starting point must above the state snapshot disk layer. Usually it's always held but can't be not true under some circumstances. For instance:

The chain is rewound to a block below the state snapshot disk layer, and snapshot is waiting for picking up. If we kill the geth node before the chain is fully recovered, then the chain head will below the state snapshot. In this case Geth will be stuck at state rewinding in the next startup as the state corresponds to state snapshot disk layer will never be found.


@sysvm
Copy link
Contributor

sysvm commented Mar 8, 2024

I also meet this problem in syncing: I use geth to import block to 40W+, then I use kill -9 and restart geth, it's hanging in setHeadBeyondRoot function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants