Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
db-sync: Log an error if excessive rollback is required on startup
Since version 6.0.0, db-sync has two data stores; PostgreSQL and a snapshot of ledger state stored on disk. There are a couple of potential problems with this: * If the 'db-sync' software version changes, the ledger state written by the old version may not be readable by the new version. * If the ledger state is missing (eg accidentally deleted). In both of these cases 'db-sync' will try to rollback the database to block zero. Unfortunately, the current version of the Haskell/Persistent library is unable to do fast efficient rollbacks, and rolling back from mainnet tip to block zero is likely to take several days. This commit logs an error message when the rollback is likely to be slow. It does not halt the rollback, just logs the following error: Rollback block count is high and therefore rollback is likley to be incredibly slow. Dropping the database and resyncing from scratch will be faster. It is up to the operator to drop the database and restart.
- Loading branch information
Showing
3 changed files
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters