-
Notifications
You must be signed in to change notification settings - Fork 20k
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
"Head state missing, repairing chain" I lost many blocks , how can I get them back? #19124
Comments
Geth keeps the state in memory (and garbage collects in memory) and only flushes every hour or so. If Geth crashes, whatever was in memory is lost. In your case the block data is still there, just the historical states got lost so the chain rolled back. Normally this is not a big of an issue as when you reconnect to the network, Geth reprocesses from a past block. If you run a single node however, there might be no remote peer with the data. Long term I think we should fix Geth so that it reprocesses the blocks locally instead of reaching out to the network. Short term that won't help you, but you could try to do a |
This only affects blocks right? Not the keystore etc? |
yes, It only affects blocks. acctually, I can still get the Transactions in the higher blocks , but when it starts mining , the blockNumber is increasing from the lower number 422522. on the other hand, the storages in the contract were back to the status in the blockNumber 422522 . while i need the status in the 1110002 can I find some way to solve this problem? |
I wrote in my previous comment that you could have exported your chain and fixed it that way. If you started mining on top, it's probably way too messy now to try and extract the correct blocks. @hito This only affects the state, yes. |
Thank you so much , I think it's a great way to save all the data .
here is my block
I used the following steps to recover my data, is there something wrong with it ?
|
…th-persistent-disks ETH Deployment: kill StatefulSets Every now and again we were losing the entire chain state in our `keep-dev` env. After tracking things down (see thread), determined it happens when all of our participating eth nodes get shot by Kube. This shouldn't matter since were using persistent disks with the eth `datadir` set there. It turns out this isn't enough. We lose state in memory when the geth process is terminated. Per ethereum/go-ethereum#19124. This is normally fine because there's at least one other node on the real networks that can fill in the blanks when you come back up. In our case there's not always another node, we were running only 2. Now we're running 6 to try and hedge against all getting shot at once. Here we've removed the `StatefulSet` deployments because they're doing us no good.
I get this as well every time I restart the node via docker compose
Or if it restarts due to some fault, I lost a day or 2 of blocks. |
@BeOleg I see that you've opened #19504 , so let's continue that one there. @relaxbao yes, something is wrong with it! It seems to have lost track of the canon chain, and there's a discrepancy in the chain. This is very interesting, however, since you're on a very old version |
…th-persistent-disks ETH Deployment: kill StatefulSets Every now and again we were losing the entire chain state in our `keep-dev` env. After tracking things down (see thread), determined it happens when all of our participating eth nodes get shot by Kube. This shouldn't matter since were using persistent disks with the eth `datadir` set there. It turns out this isn't enough. We lose state in memory when the geth process is terminated. Per ethereum/go-ethereum#19124. This is normally fine because there's at least one other node on the real networks that can fill in the blanks when you come back up. In our case there's not always another node, we were running only 2. Now we're running 6 to try and hedge against all getting shot at once. Here we've removed the `StatefulSet` deployments because they're doing us no good.
Hi,
I run geth using
supervisor
on Ubuntu as a privatechain, the geth crashed at yesterday because generating DAG file need more CPU than our serverwhen it started , we lost many blocks , the blocknumber is from
1110002
back to422522
.I need the lost blocks ,can I find them back?
looking forward to your response, thank you ~
System information
Geth version:
1.8.11
OS & Version: Linux Ubuntu
Expected behaviour
the height is 1110002
Actual behaviour
now the blockNumber is 422522, it shold be 1110002, how can I back to 1110002.
here is the log
Steps to reproduce the behaviour
I restarted geth , but it's just the same
The text was updated successfully, but these errors were encountered: