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

Rotating chain state backups #499

Closed
theoreticalbts opened this issue Jan 5, 2016 · 0 comments
Closed

Rotating chain state backups #499

theoreticalbts opened this issue Jan 5, 2016 · 0 comments

Comments

@theoreticalbts
Copy link
Contributor

  • Dump the whole chain state to disk every maintenance interval, not just on shutdown.
  • Dump into new subdirectory, then delete all but the most recent N dumps (where N is configurable but defaults to 2).

This way we will hopefully be able to replay only from the last maintenance interval in case of a crash.

On UNIX-like systems, we may be able to do the saving in a fork'ed process which dies after saving, which allows us to hide the latency of disk access (processing blocks can resume in the main process, while the in-memory chain state of the forked process never advances regardless of what the main process does, and most of the memory is shared between the two processes because most of the main process's state doesn't change quickly).

If every node dumps at the same time, this will also help us diagnose inconsistency bugs, and also allow us to serve the state file over HTTP or IPFS or something to help bootstrap new nodes.

The recovery from the recent chain crash was slowed due to several witnesses having to replay multiple times due to #492 and replay times will only increase in the future as the blockchain grows.

Note, full replay from genesis would still be necessary if we update DB_VERSION, if user is running a different plugin set, or if user is paranoid and cannot find a trustworthy state download.

A recent state download hash should be included in the binary, along with hardcoded checkpoints, and we should encourage persistent mirroring of these states.

@vikramrajkumar
Copy link
Contributor

This issue was moved to bitshares/bitshares-core#142

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

No branches or pull requests

2 participants