Repository navigation
Conversation
…orm and tenancy Point the recommendations upsert ON CONFLICT arbiter at recommendations_natural_key_az_tp_idx (the 9 existing key columns plus the generated platform and tenancy columns from migration 000111). The insert column list is unchanged and the generated columns are never written or updated. Add TestPostgresStore_UpsertRecommendations_PlatformTenancyArbiter (same-key re-upsert in place, regional non-EC2 rows with empty platform/tenancy, pre-PR-C row found). Give the legacy-row case in the AZ arbiter test the platform and tenancy the old collector always stored in details. Bump the Azure pricing integration test from migration 109 to 111, the only pinned-schema test that calls the recommendations store. Refs #806 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Migration 000112 drops recommendations_natural_key_az_idx so EC2 recs that differ only by platform or tenancy coexist; the 11-column index from 000111 is the upsert arbiter since PR-C. Down collapses platform/tenancy-only duplicates (keeps newest collected_at) and recreates the 9-column index as 000109 defined it. Adds store, persistCollection and migration tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
Warning Review limit reached
This review includes 7 billable files and costs up to $1.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 41 minutes for your next included review. View limit details
Comment |
This was referenced Oct 12, 2026
Merged
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.
Closes #806
Last PR of the chain (#815 migration 000111, #817 PR-B, #818 frontend, #819 PR-C ON CONFLICT on 11 columns). Do not merge before #819 is merged and deployed to dev.
What
Migration
000112drops the 9-column unique indexrecommendations_natural_key_az_idx. With the 11-columnrecommendations_natural_key_az_tp_idxas the only arbiter, EC2 recs that differ only by platform or tenancy coexist in one batch and across runs (no more transitional SQLSTATE 23505).collected_at, then highestid), then recreates the index exactly as 000109 defined it.TestPersistCollectionPlatformTenancyInOneBatchusing the realconvertRecommendations.The branch is stacked on #819 (head 3ca3721); this PR's own diff is the single commit on top. Rebase onto main after #819 merges.
Migration number
000112 was the next free number on origin/main when this was written. platform#118 ladder work also plans a 000112; whichever of the two lands second renumbers.
Prod runbook (order matters)
database-migration.ymlfor 000111 withstepslimited to the true count of pending migrations up to and including 000111 only. The workflow default (stepsempty or 0) isalland would also apply 000112.ON CONFLICTon the 9 columns needs the index and every collection write would fail.Dev
Merge to main only after PR-C is deployed to dev. Dev auto-migrates all pending migrations at startup. Old instances overlapping the rollout keep a valid arbiter only until this migration runs.
Rollback
downis only safe together with a code rollback. PR-C code needs the 11-column arbiter, and once the 9-column index is gone, rolling back PR-C code needsdownof this migration (steps=1) first. Down collapses platform/tenancy-only duplicates; the next collection repopulates them.Review gate: independent review, CI, and local verification evidence to be recorded on this PR before merge.
🤖 Generated with Claude Code