You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(recommendations): EC2 tenancy and platform missing from the recommendations natural key and rec ID #806
The recommendations natural key (account_key, provider, service, region, resource_type, engine, term, payment_option, migrations 000032/000043) and recommendationID (internal/scheduler/scheduler.go:1076) omit EC2 tenancy and platform, which live only in the payload Details blob. Two EC2 recs for the same type and term that differ only by tenancy or platform (for example linux vs windows) land on the same key.
persistCollection (scheduler.go:391) upserts all providers' recs in one transaction, so two such recs in one batch raise ON CONFLICT DO UPDATE command cannot affect row a second time and the whole collection write fails, not just one rec. Same failure shape as the AZ case in #792.
Fix
Expand/contract, as planned for #792 (prod runs with auto_migrate=false, migration is a manual database-migration.yml dispatch): add tenancy and platform columns with backfill from payload and a wider unique index (keep the old one), then code writes the columns and conflicts on the wider key, then a later release drops the old index. recIdentityKey (internal/api/purchase_pricing.go:124) and recommendationID must adopt the same fields. Needs a store test with two recs differing only by tenancy/platform.
Deliberately split out of #792 to keep that change scoped. Related: #792.
Verified against actual DEV after deployment using the existing approved read-only route: schema version 119, dirty=false; the legacy nine-column index is absent; recommendations_natural_key_az_tp_idx is unique and valid with all eleven intended columns. Armed multi-step Savings Plan count remains zero. The query used BEGIN READ ONLY and ROLLBACK and completed successfully, including tunnel cleanup. No application invocation, manual migration, database write or provider purchase was performed for verification.
The independently reviewed head's required CI passed before merge. All four post-merge workflows succeeded: full CI 38648834550, automatic AWS deployment 38648834630, pre-commit 38648834662 and frontend 38648834739. Every watcher reached its terminal result. Native PostgreSQL 17 fixture verification additionally passed the production runner's 118 -> 119 -> 118 -> 119 path, coexistence, exact-duplicate rejection and rollback deduplication.
The recommendation-index issue is resolved in DEV. The separate pre-existing transaction/recovery comment inaccuracies are tracked in #874. The migration's accepted cache-lock trade-off and the test-assertion review disposition are documented on PR #821's inline threads.
Activity
feat(db): add generated platform and tenancy columns and 11-column re…
test(api): send Details in the recommendation identity integration te…
fix(purchase): carry EC2 platform and tenancy in rec ID, identity key…
fix(frontend): include platform and tenancy in EC2 recommendation cel…
fix(config): upsert recommendations on the 11-column index with platf…
fix(db): drop the 9-column recommendations natural key index (#806)
fix(db): drop the 9-column recommendations natural key index (#806)
fix(db): drop the 9-column recommendations natural key index (#806) (#…
cristim commentedon Oct 14, 2026
Deployed: PR #821 merged normally at a3bc552. Automatic AWS deployment 38648834630 succeeded.
Verified against actual DEV after deployment using the existing approved read-only route: schema version 119, dirty=false; the legacy nine-column index is absent; recommendations_natural_key_az_tp_idx is unique and valid with all eleven intended columns. Armed multi-step Savings Plan count remains zero. The query used BEGIN READ ONLY and ROLLBACK and completed successfully, including tunnel cleanup. No application invocation, manual migration, database write or provider purchase was performed for verification.
The independently reviewed head's required CI passed before merge. All four post-merge workflows succeeded: full CI 38648834550, automatic AWS deployment 38648834630, pre-commit 38648834662 and frontend 38648834739. Every watcher reached its terminal result. Native PostgreSQL 17 fixture verification additionally passed the production runner's 118 -> 119 -> 118 -> 119 path, coexistence, exact-duplicate rejection and rollback deduplication.
The recommendation-index issue is resolved in DEV. The separate pre-existing transaction/recovery comment inaccuracies are tracked in #874. The migration's accepted cache-lock trade-off and the test-assertion review disposition are documented on PR #821's inline threads.