fix: unblock v0.29.1 effective date migration#770
Open
sanchalr wants to merge 1 commit intogarrytan:masterfrom
Open
fix: unblock v0.29.1 effective date migration#770sanchalr wants to merge 1 commit intogarrytan:masterfrom
sanchalr wants to merge 1 commit intogarrytan:masterfrom
Conversation
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.
Summary
executeRawBEGIN/COMMIT/ROLLBACKfrom the effective-date backfill loopWhy
On a Postgres install,
gbrain apply-migrations --yescan remain permanentlyPARTIALfor v0.29.1:createEngine(...)returns an unconnected engine, so Phase B/Phase C can fail withNo database connection: connect() has not been called.BEGINon the postgres.js pooled connection can fail withUNSAFE_TRANSACTION: Only use sql.begin, sql.reserved or max: 1.The backfill is already safe to run as independent updates: it is deterministic, idempotent, skips equal rows, and checkpoints by
backfill.effective_date.last_idafter each batch.Verification
Run locally against a Postgres-backed gbrain install that was stuck on v0.29.1 partial:
Results:
bun run typecheckpassedgbrain apply-migrations --yeschanged v0.29.1 fromPARTIALtocompletegbrain doctor --jsonno longer reportsminions_migrationfailuresync_failuresFK noise from stale source IDsNeed help on this PR? Tag
@codesmithwith what you need.