Conversation
A batch is written by a single run, but batch numbers are global in the shared _sutegi_migrations table — so an app sharing a database with another could pick the OTHER app's newest batch as its rollback victim and die in preflight on 'no such migration in code' (surfaced as cross-suite interference in the live-PG tests, which share one history table by design). Candidate batches now must contain at least one version the rolling-back migrator defines; a code-deleted migration inside our own batch still errors up front.
This branch has not been deployed
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.
Follow-up to #17 — this commit (
22c071a) was pushed to the branch right as the PR was merged, so it missed the merge.The bug: a batch is written by a single run, but batch numbers are global in the shared
_sutegi_migrationstable. An app sharing a database with another could pick the other app's newest batch as itsrollback(1)victim and die in preflight with "no such migration in code". This is also exactly the flake CI caught on #17's first run: the live-PG suites share one history table by design, andpg_rollback_of_a_failing_down_is_atomicpicked up the concurrent no-transaction test's batch.The fix: candidate batches must contain at least one version the rolling-back migrator defines. A code-deleted migration inside our own batch still errors up front (that's a real can't-roll-back situation); another app's batches are simply out of scope.
Adds
rollback_targets_only_this_migrators_batches(two migrators sharing one in-memory DB: B's rollback undoes B's batch, A's newer batch stays applied) and the CHANGELOG line.cargo test -p sutegi-orm --all-featureswith live PG is green, including six consecutive runs of thepg_migratesuite that previously flaked.(#17's other red check was the perf gate flagging
query_builder_wide+14.2% with head CV at 14% — the diff doesn't touchbuilder.rs; that's the gate's documented machine-noise sensitivity, and this run should re-measure it.)