Repository navigation
Conversation
#2302 merged 20270201001200 after staging's global goose version was already 20270202000000, and goose is built without WithAllowMissing, so a build from main refused to start there. Rename it to 20270202000100; both ALTERs are ADD COLUMN IF NOT EXISTS, so a database that ran it under the old version re-runs it as a no-op. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
kanat
left a comment
There was a problem hiding this comment.
VERDICT: GO
Reviewed at dcbab46 (already contains current main). CI: CodeQL, labeler and GitGuardian pass; go and integration are skipped while the PR is a draft and run at ready.
Checked and sound:
- goose v3.27.3 treats as missing only a file older than the newest applied version that is not applied. An applied version with no file is ignored, and
checkHistoryrefuses only unknown versions older than the squashed one. A database that ran the file under its old version therefore starts. - Two builds against one database: a build from before #2302 migrates it to
20270202000000, then a build from currentmainis refused (missing20270201001200). That is the staging stop. This head then starts and records20270202000100, and the build from before #2302 still starts on the result. A database first migrated by currentmain(old version applied) starts on this head and gets20270202000100as a no-op. A fresh database migrates. Builds frommainbetween #2302 and this PR cannot start on a database migrated by this head, but no release tag contains #2302. - Content unchanged, expand-only (
ADD COLUMN IF NOT EXISTS).schema/global.sqlholds no version, and no other file refers to the old version. - Mutations of the new test: the file back at the old version, the file at a version between the two, and
ADD COLUMNwithoutIF NOT EXISTSeach fail it. TestEveryHotTableIsReadByIndexfails the same planner subtests on base and on head when run locally one after the other, so this PR does not cause it.
One Nit, inline. It does not block the merge.
Verdict: approve (GO).
| s.Require().NoError(err) | ||
|
|
||
| s.Require().NoError(db.Migrate(s.ctx)) | ||
| s.True(hasColumns()) |
There was a problem hiding this comment.
[Nit] R1.1 This asserts the two columns the test added by hand at line 155, so it holds whatever Migrate does. Drop it, or assert the staging path: a database at 20270202000000 with no sync_hash columns and no old row has both columns after Migrate.
There was a problem hiding this comment.
Fixed in 9f064dc: the old-row case no longer asserts the hand-added columns; a new case TestTheSyncHashMigrationAddsTheColumnsToAGlobalDatabaseAt20270202000000 starts at 20270202000000 with no columns and no old row and asserts Migrate adds both. Mutation (migration body replaced by SELECT 1): the new test fails, the old assertion passed.
…e at 20270202000000 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Closing: #2420 (AI-3799, merged as 015271b) made the same re-slot to 20270202000100, and its migration uses ADD COLUMN IF NOT EXISTS, so a database that ran it under 20270201001200 applies it again as a no-op. The two tests here pin that one historical slot only; staging's goose order is checked by the deployer before each tag. Nothing else in this PR is left to land. |
kanat
left a comment
There was a problem hiding this comment.
VERDICT: GO
Delta round 2 on 9f064dc (previous reviewed dcbab46). The delta is test-only: acceleration/internal/store/migrate_test.go.
R1.1 (Nit): fixed. The old test keeps only the recorded-row check after Migrate. The new test TestTheSyncHashMigrationAddsTheColumnsToAGlobalDatabaseAt20270202000000 starts at 20270202000000 with neither column and asserts Migrate adds both columns and records 20270202000100.
Mutations:
- Migration Up body replaced by
SELECT 1;: the new test fails (migrate_test.go:162), the old test passes. Restored. ADD COLUMN IF NOT EXISTSchanged toADD COLUMN: the old-row test fails with SQLSTATE 42701 on the re-run (migrate_test.go:152). The new test passes. Restored.
Checks: -run TestStoreSuite -testify.m SyncHash passes 2/2 on head and 2/2 on head merged onto origin/main 32f4de2. go vet -tags integration ./internal/store/ is clean.
The full store package times out in Redis tests on head and on current main alike (machine load 35-46). It is not caused by this PR and does not block this delta.
CI: draft, so the integration and go jobs are skipped; Analyze, CodeQL, labeler and GitGuardian pass.
Details: scratchpad/2422/reviewer-2.md
Why
#2302 merged
20270201001200_connector_router_sync_hash.sqlafter staging's global goose version was already20270202000000(applied by an older build from main).goose.NewProvideris built withoutWithAllowMissing(acceleration/internal/store/migrate.go:97), so any build from main refused to start on staging: goose reports a migration older than the newest applied one as missing.The change
git mvthe file to20270202000100_connector_router_sync_hash.sql: newer than20270202000000, older than the open PRs'20270301000900+. Content unchanged.connector_definition.go,router_config.go) point at the new name. No other reference to the old version existed.ADD COLUMN IF NOT EXISTS, so a database that applied it under the old version runs it again as a no-op (goose records20270202000100next to the old row).TestTheSyncHashMigrationSortsAfterAGlobalVersionStagingHad: a database at20270202000000has nosync_hashcolumn; with the old row and the columns present,Migratesucceeds and records20270202000100.Checks
go build ./...,go vet ./...,go vet -tags integration ./...inacceleration/: clean.-tags integration, own test database, both suites): pass, including the new test andTestMigrateIsIdempotent(fresh database).20270201001200fails the new test (the columns exist at20270202000000).🤖 Generated with Claude Code