Repository navigation
fix(recfilter): EC2 size flexibility and RDS Multi-AZ units in the duplicate guard - #576
Conversation
|
Warning Review limit reached
This review includes 11 billable files and costs up to $2.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 56 minutes for your next included review. View limit details
Comment |
The table lived in pkg/exchange; the duplicate guard in pkg/recfilter needs it for EC2 size flexibility (#323), as it needs the RDS table from pkg/common/rds_size.go. Export it as common.EC2NormalizationFactor and have pkg/exchange use it. Metal stays absent (#552). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The EC2 dedupe keyed on the exact instance type, so a recent regional Linux/Unix default-tenancy m5.xlarge reservation did not suppress an m5.large recommendation and the guard could buy a duplicate (#323). Such entries now also join a family and region budget in normalized units (common.EC2NormalizationFactor), spent by recommendations that are exactly Linux/Unix and default tenancy. Zonal, other platforms, dedicated tenancy, metal and unknown sizes stay exact-type. Wildcard entries still suppress their exact type but never join the flex budget, and wildcard recommendations never spend it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dedupeKey includes the deployment, so a Multi-AZ size-flexible RDS reservation never counted against Single-AZ demand of its family and the guard could buy a duplicate (#323). For size-flexible engines a Multi-AZ node now counts as twice the size units on both sides, and a Single-AZ recommendation also spends the Multi-AZ budget of its family after the Single-AZ one. Single-AZ still does not cover Multi-AZ, and exact-class engines keep their key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A flex entry's leftover units were rounded up to a whole node for the exact-type path, so one xlarge reservation suppressed a large and an xlarge recommendation (12 units from 8). The remaining units are now the only state and the exact path spends whole nodes of floor(units / node). AWS excludes G4ad, G4dn, G5, G5g, G6, G6e, G6f, Gr6, Gr6f, hpc7a, P5, Inf1, Inf2, u7i-6tb and u7i-8tb from size flexibility; those families stay exact-type (common.EC2SizeFlexibleFamily). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…i-AZ Size-flexible benefits apply to both deployment options, so a Single-AZ reservation also pays for Multi-AZ demand at twice the units per node. Single-AZ and Multi-AZ now share one family budget; any other deployment (Aurora's empty one) keeps its own pool, and exact-class engines keep their key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gate note (claude-cc-libs)Rebased onto main after the overlapping PRs merged. The only conflict was CHANGELOG.md, resolved by keeping both entries. Excluding CHANGELOG.md, |
da95981 to
7e86db9
Compare
Merge gate verdict (claude-cc-libs)Every gate holds at head 7e86db9:
CodeRabbit is waived as a merge gate under the 2026-10-19 decision. Squash-merging. |
Closes #323
Remaining dedupe-key gaps in
pkg/recfilter, by dimension:What changes
refactor(common): the EC2 normalization-factor table moves frompkg/exchangetocommon.EC2NormalizationFactor;pkg/exchangeuses it, andexchange.NormalizationFactorForSizestill works for providers. Metal stays absent (fix(exchange): reshape treats "metal" as a 192-unit size, producing nonexistent or oversized targets #552).fix(recfilter): regional Linux/Unix default-tenancy EC2 entries also join a family+region budget in normalized units, spent by recommendations that are exactly Linux/Unix and default tenancy. Zonal, other platforms, dedicated, metal and unknown sizes stay exact-type. Wildcard entries still suppress their exact type but never join the flex budget, and wildcard recommendations never spend it.fix(recfilter): for size-flexible RDS engines a Multi-AZ node counts as 2x units, and a Single-AZ recommendation also spends the Multi-AZ budget of its family. Single-AZ never covers Multi-AZ; exact-class engines (SQL Server, Oracle, Db2) keep their key.Verification
Table tests for each rule; each rule has a mutation probe that makes a test fail (reverted). pkg build, vet, tests,
-raceon recfilter, golangci-lint and the git-secrets allowlist test pass with and withoutGOWORK=off; providers/aws builds, vets and passes the ec2 tests both ways.Not required (left as follow-ups)
consume(a leftover budget below one rec-size node is not credited; conservative).elastiCacheCoverto a neutral name (cosmetic).🤖 Generated with Claude Code