Author

Topic: [solved] block catch up after power outage (Read 137 times)

legendary
Activity: 4634
Merit: 1851
Linux since 1997 RedHat 4
August 20, 2021, 08:36:06 PM
#5
Consider it the other way around Smiley

There are 10's of thousands of copies out there of the blockchain.
It's like running RAID1 with over 10,000 mirrors Smiley
Performance is important in core (well I'd say it's the most important thing, since I run a pool)
It's not hard to get that data back if anything goes wrong, but something going wrong should be rare not common.

The only file on your node that is critical and possibly irreplaceable is the wallet file, if you have a wallet on the node.
staff
Activity: 3458
Merit: 6793
Just writing some code
August 19, 2021, 11:19:34 PM
#4
interesting. so does the cache get written to disk only when there is a proper shutdown or at some preset intervals?  maybe based on the amount RAM the system has?
All of the above. If it's been too long since a flush, it will be flushed. If the cache is near or past its maximum (controlled by the -dbcache option, which can be dependent on available RAM), it will be flushed. And of course it's always flushed during the clean shutdown process.
jr. member
Activity: 45
Merit: 22
August 19, 2021, 09:25:14 PM
#3
It likely wasn't re-downloading anything (unless you are saying you observed network activity). Rather it was re-applying the chainstate updates that were lost during the power loss. These chainstate updates are cached in memory before being committed to disk, so a sudden power loss will lose those updates. These updates are the effect of processing blocks - it's really just re-processing those blocks. The caching is done for performance since waiting for things to flush to disk can be a significant bottleneck in syncing.

interesting. so does the cache get written to disk only when there is a proper shutdown or at some preset intervals?  maybe based on the amount RAM the system has?
staff
Activity: 3458
Merit: 6793
Just writing some code
August 19, 2021, 08:55:12 PM
#2
It likely wasn't re-downloading anything (unless you are saying you observed network activity). Rather it was re-applying the chainstate updates that were lost during the power loss. These chainstate updates are cached in memory before being committed to disk, so a sudden power loss will lose those updates. These updates are the effect of processing blocks - it's really just re-processing those blocks. The caching is done for performance since waiting for things to flush to disk can be a significant bottleneck in syncing.
jr. member
Activity: 45
Merit: 22
August 19, 2021, 08:34:20 PM
#1
running v.0.21.0 on my raspberry pi4.  had to pull the power supply because the OS froze for some reason.  after it booted back up and i restarted bitcoin core  i noticed it was re-downloading about 200 or so blocks to get current.  i was only down for maybe 15 minutes.  does bitcoin core not save recent block history?
Jump to: