Repository navigation
fix(restore): a commit that fails is a restore that failed - #671
Merged
Merged
Conversation
The transaction's own outcome was discarded — `let _ = COMMIT`. So a restore could report "complete — 400 statements" with nothing committed, and a rollback that itself failed was still reported as "rolled back — the database is as it was". Now: a failed COMMIT is its own error in the summary, saying that the statements ran and none of them took effect; a failed ROLLBACK clears `rolledBack` and sets `partiallyApplied`, because a rollback that did not happen cannot be claimed to have undone anything. The backup's snapshot COMMIT is only closing a read transaction, so it cannot lose data — but it is logged rather than discarded, since a connection going back to the pool inside a transaction is what #658 was. Found by the review sweep for discarded Results, in code this same release added.
EVWorth
force-pushed
the
fix/restore-commit-check
branch
from
September 12, 2026 13:04
514a2f0 to
c833a8a
Compare
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.
From the full-project review — a sweep for discarded
Results, which found one in code this same release added. Stacked on #669.The restore's transaction outcome was thrown away:
So:
Now a failed COMMIT is its own error in the summary — "The statements ran but could not be committed, so none of them took effect" — and a failed ROLLBACK clears
rolledBackand setspartiallyApplied, because a rollback that did not happen cannot be claimed to have undone anything.The backup's snapshot COMMIT only closes a read transaction and cannot lose data, but it is logged rather than discarded: a connection going back to the pool inside a transaction is exactly what #658 was.
+1 unit test on the summary shape, +1 live-server test that cuts the session mid-restore and asserts a clean summary is never reported over a database that received nothing. Both servers green.