How to recover from corrupt state
This guide shows you how to roll back your cluster to the last valid data state following a corruption.
Steps
- Type and run
dqlite-utils --dir /path/to/dqlite/dir. You will see thedqlite-utilsrepl start. - Type and run the
.opencommand. You will see the open shell at the ‘latest’ data version. - The open shell supports arbitrary SQL. Inspect the data to identify the corruption.
- Use the
.set-indexcommand to travel back in time to log entry before the corruption occurred. See how to check data-integrity. - Create a backup a dqlite cluster of the valid data.
- Create a snapshot containing the backup.
- Restart your cluster starting from the just-created snapshot.
You will now see your cluster operating normally, starting on the data immediately before the corruption.