Some error conditions in the Segment Store might prevent the journal from being updated. After a restart the system will be rolled back to the latest version persisted in the journal. Every change performed after the system stopped updating the journal appears to be lost.
Unless some deep inconsistencies are found in the segments, it might be possible to recover from an outdated journal by performing the following steps:
- Backup the previous journal.
- Scan the segments for node records representing super-roots.
- Order the found records by segment creation date (ascending) and record number (ascending).
- Create a new journal with the ordered entries.
- Perform a sanity check of the journal (as the "check" tool does).
We should have a tool executing these steps. Being a "porcelain" tool, it should have a small and stable command-line interface, be safe in the face of unexpected error conditions, and be friendly when communicating to the user both in case of success and in case of errors.