Back to blog

Guardian Restored an Older Version of My Work

Guardian came back after a database failure, but two recent rewrites did not. A restore test needs to check which versions returned.

reliabilitybackupsGuardian

A restored database has healthy rows while recent document versions remain missing outlines.

When the SQLite database behind Guardian, my personal memory-and-task system, failed, I got it running again that night. The task records came back. Two tasks' recent rewrites didn't. They had reverted to earlier versions.

Guardian runs a daily restore job. It opens a backup, checks that it isn't corrupt, and makes sure enough rows came back. It sends a pass or fail alert. The incident record doesn't establish whether those checks ran or passed during this recovery, or whether the missing rewrites happened after the backup was taken. I can't turn the loss into proof of a failure I didn't document.

Now I want every restore test to compare a few records I edited recently.

An earlier version of a task is a valid database record. It can help satisfy a row-count check. It can live inside a structurally sound database. Neither check tells me that the version I care about came back.

For a practice restore, I'd take a few recently edited records and save their identifiers, current values, and edit times outside the live database. Then I'd restore the backup into a separate test database and compare those exact records.

My live task said “Call on Friday.” If the restored copy says “Call on Thursday,” I have a version mismatch. The restore worked, and the task exists. Now I can ask when Thursday became Friday.

If the edit happened after the backup, the backup is doing what I expected. The comparison has measured the amount of recent work the schedule would lose. If the edit happened before the backup, the restored value needs investigation. The timestamps tell me which problem I have.

I have found that a practice restore only tells me what that backup contains. It can't include work saved after the backup ran.

I want the recovery report to tell me which version came back and how much newer work would be missing. I can make that call while the live database is still there.

If Friday became Thursday in the restore, I want that in the report before the live copy is gone.

Source: SQLite integrity checking.