Repository navigation
fix(purchase): refuse two same-pool ElastiCache recs in one execution - #1902
Conversation
Each rec gets its own idempotency token and the per-rec recent-reservation checks run concurrently and ignore the execution's own reservations, so two selected recs for the same account, region, node type and engine both bought. Refuse the whole selection before submission, like the Redshift duplicate-tuple refusal, with a fixed allowlisted note that also covers a plan-step root. Term, payment and count are not part of the pool, as in the go library's key. Refs #1867 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ocument the dedupe The scenario that asserted both same-pool recs buy now asserts the refusal through the real executor path, with a control where an unselected twin buys once. Add the ElastiCache dedupe known-issues entry (recent-reservation check, same-pool refusal, the Redis plus Valkey allowance, plan-step churn). Closes #1867 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 12 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
CHANGES REQUESTED 8ec320a by claude-nibblets The production change is sound (details below), but Unit Tests and CI Success are red at this head, and the failure is in this PR's own new test file. Blocker: Review of the change itself (closes #1867; +266/-10, money path; 0 behind main): two selected AWS ElastiCache recs for the same pool in one execution both bought, because each rec gets its own index-derived token and the per-rec recent-reservation checks run concurrently and drop the execution's own reservation ids. Scoped probes (go test -run ElastiCache|ErrNote|ServerNote|Sanitiz|PreExecution|RequestedAt|Redshift in internal/purchase, scratch worktree at this head, baseline ok), each killed: duplicate-pool check not called (four tests incl. TestElastiCacheScenarios_SamePoolTwiceInOneExecutionIsRefused); account dropped from the key (TestElastiCacheDuplicatePool_Detection, _FanOutDifferentAccountsNotRefused; my first version did not compile and was redone); engine dropped; node type dropped; unselected recs counted (also TestElastiCacheScenarios_SamePoolTwinUnselectedBuysOnce); zero-count rec counted; engine not trimmed or normalized; allowlist entry dropped (TestSanitizeStoredError_AllowlistedNotesPassThroughVerbatim). I will re-approve at the head that fixes the guard failure once Unit Tests is green. |
…ariable The repo-wide vacuous-assertion guard in internal/mocks resolves only plain identifiers as AssertCalled receivers and failed CI on run.store.AssertCalled. Refs #1867 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Closes #1867
What
Two selected AWS ElastiCache recommendations for the same pool inside one execution both bought. Each rec gets its own index-derived idempotency token, so the library's guard sees two different reservation ids, and the per-rec recent-reservation checks (#1863) run concurrently under the fan-out and drop the execution's own reservation ids from their listing, so neither sees the other's purchase.
The whole selection is now refused before submission (the same shape as the Redshift duplicate-tuple refusal from #1895):
hasDuplicateElastiCachePoolruns inpreExecutionRefusal, the single funnel every executor entry point goes through, and returns abeforeSubmissionerror with a fixed, allowlisted note. The row ends failed withno_submissionstamped.Decisions made with safe defaults (owner can override)
known_issues/42_elasticache_dedupe.md.How it is proven
elasticachevs canonicalcacheslug, rec account vs execution account, node type case) and an end-to-end test throughexecuteAndFinalize: zero purchase calls, status failed,no_submissionstamped, the stored note equals the fixed text and survivesSanitizeStoredError.executeAndFinalize, because the old path cannot see the refusal), with a control where an unselected twin buys once.internal/purchase, 0 findings in changed files; gocyclo clean); the whole purchase package passes on the rebased tree.Notes
Two commits (203 and 80 changed lines). Cross-execution duplicates remain the #1863 recent check's job.
🤖 Generated with Claude Code