Repository navigation
fix(backup): prevent restore database name collisions - #5449
Conversation
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 14 seconds. View limit details
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Problem
Restore swaps of different databases on the same PostgreSQL cluster can fail when they start in the same second. The main CI run hit the collision in the plugin provisioning restore test. An earlier run hit it in the command test for restoring an older schema. Main CI run · Earlier CI run
Related issue: N/A
Validation tasks: none
Other clients: N/A (no client-visible change)
Approach
Include the live database's OID in the restore identifier so each swap gets its own database names and journal. The PostgreSQL regression test restores several databases at one fixed time and keeps the previous databases until the cases finish.
Validation
Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-5449/
The PostgreSQL runs verified the patch in commit
c6ecba782a.Risks
Operators use the full identifier printed by the restore command with
--recover. A recovery reads the names from its authenticated journal, including journals written before this change.Checklist
AI Disclosure
gpt-6.2-solNote
Fix restore database name collisions by adding live database OID to restore identifier
RestoreSwapin swap.go now builds the restore identifier from the UTC timestamp plus the live database OID, so restores of different databases on the same PostgreSQL server no longer collide when they start in the same second.swapPreflightintoRestoreSwap, which now runs them before opening swap stores.swapPreflightreturns only an error.swapStampexpects the OID suffix, and restore helpers no longer force one-second spacing between restores.RestoreSwapnow fails before opening swap stores if the live database OID cannot be read or the database is missing; theJournaledcallback inSwapOptionsreceives the restore identifier, not a time value.Macroscope summarized c6ecba7.