Repository navigation
Restore test: compare with the database as it was during the dump - #100
Merged
Merged
Conversation
After #99 the Deploy's restore test failed: it counted the live rows after restoring, and the site (now with the chat in use) had written meanwhile. The live counts are now taken just before and just after the dump; when they differ the backup is made again, at most 3 times. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Deploy of #99 (chat basics) went live (migrations, services and health check all green), but its last step, Backup and restore test, failed:
restore test FAILED: … differs from the live database.Cause
backup.sh restore-testmade the dump, restored it (~12 s), and only then counted the rows of the live database. Anything written in between makes the counts differ, even though the dump is fine. Right after the chat went live, people used it (messages, read marks), so the live database had changed.Fix
pg_dump. When they're equal, nothing changed during the dump, and the restored database must hold exactly those counts.docs/backups.mdand the changelog explain this.Tested locally
In the test database container (
postgres:16):restore test passed;Merging this runs the Deploy (and the restore test) again.
🤖 Generated with Claude Code