Skip to content

Restore in-memory database from disk on critical sync error #722

@dknopik

Description

@dknopik

Basically, there are two classes of errors in the event processor:

  1. Incorrect event: The event is faulty due to a mistake by the transaction sender, e.g. bad signature in validatorAdded
  2. Internal fault: if e.g. disk space runs out, we wont be able to modify the database.

For the first kind, we should just continue the sync with the next event.

But for the second kind, we should retry, because we must not miss events. But this is tricky: while we can roll back the database transaction, we can not roll back the internal memory cache. But we rely on the internal cache being in the same state as the database.

We need to cope with this. As internal faults should be exceedingly rare, it should be fine to just reload the in-memory database.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions