streamingfast / node-manager

Wrapping process to operate blockchain nodes.
https://dfuse.io
Apache License 2.0
7 stars 9 forks source link

Support restarts when using merge_archiver #9

Closed abourget closed 4 years ago

abourget commented 4 years ago

Problem: Because we keep the 100 blocks destined to a merged block file in RAM, when we shutdown the process, the mindreader behind will have moved ahead, and we will have lost up to 100 blocks. This forces us to reset the underlying node, which can be time consuming, and can bring us back thousands of blocks earlier.

Solution: have the merge archiver write to a temporary location on disk, and be able to continue from that location when it restarts. It needs solid bound checking, to make sure it has contiguity between what was already written, and what is about to be written.

Then, the temporary file can be uploaded as a merged bundle.