Repository navigation
fix(recfilter): dedupe Redis OSS and Valkey ElastiCache nodes directionally - #208
Conversation
…onally Duplicate detection collapsed valkey into redis for both recent reservations and recommendations, so a recent Valkey reservation could suppress an uncovered Redis OSS recommendation. AWS documents the coverage as one-way: Redis OSS reserved nodes also apply to running Valkey nodes, Valkey reserved nodes apply only to Valkey nodes. https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.Reserved.html#reserved-nodes-upgrade-to-valkey Keep each engine in its own budget and let a Valkey recommendation consume Valkey, then Redis OSS, then unknown-engine reservations. Redis OSS, Memcached and other engines consume their own budget, then unknown-engine reservations, as before. Closes #189
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. 📝 WalkthroughWalkthroughElastiCache reservation deduplication now distinguishes Redis, Valkey, and unknown engines. Matching uses engine-specific coverage order, while other providers and non-cache services retain their existing normalization behavior. ChangesElastiCache Deduplication
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The change makes ElastiCache reservation matching directional between Redis OSS and Valkey, and no concrete merge-blocking risk remains. The CLI duplicate-check path and the GCP provider tests were not run locally, so rely on CI for those. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
What
pkg/recfilterduplicate detection mappedvalkeytoredisfor both recent ElastiCache reservations and recommendations. Both engines therefore shared one budget, so a recent Valkey reservation could suppress an uncovered Redis OSS recommendation (the issue's minimal scenario: Valkeycache.r6g.largereservation, Redis recommendation for the same node type and region; the Redis recommendation was filtered).This PR keeps each engine in its own budget and adds one directional rule,
coveringElastiCacheEngines:Provider/service scoping, deployment and region keys, single-use budget accounting and the fail-closed wildcard for reservations with a missing engine are unchanged.
Why (authoritative contract)
AWS ElastiCache reserved nodes, Upgrading nodes from Redis OSS to Valkey:
How verified
dedupe_test.go: the old casevalkey covers redisasserted the reverse direction AWS does not offer; it is replaced byvalkey does not cover redis, with the doc link. New cases:valkey covers valkey,valkey and wildcard partial redis,valkey before redis for valkey,redis rec first keeps valkey for valkey,valkey overflow onto redis. Existing Memcached, wildcard andfamily consumed oncecases still pass unchanged.Before the fix (new tests on origin/main code):
Mutations, each reverted:
--- FAIL: .../valkey_before_redis_for_valkey--- FAIL: .../valkey_does_not_cover_redis,.../valkey_and_wildcard_partial_redisAfter, with
GOTOOLCHAIN=go1.26.6 GOFLAGS='-p=2 -count=1' AWS_EC2_METADATA_DISABLED=true:pkg(GOWORK=off):go build ./...,go vet ./...,go test -race ./...: 1082 passed in 13 packages.providers/aws(workspace mode, pkg is unpublishedv0.0.0):go test -race ./...: 1585 passed in 14 packages, including the ElastiCache client tests that driveAdjustRecommendationsForExisting.golangci-lint run ./recfilter/...inpkg: no issues.providers/gcp. The machine ran out of disk at the link step. GCP computeengine implementsFilterRecommendationsForRecentCommitmentsand never reaches this code path. CI covers it.Not run: the CLI duplicate-check path against controlled provider responses, which the issue asks for. The CLI pins a pkg revision, so that check belongs with the CLI bump.
Out of scope
Closes #189
Summary by CodeRabbit