Repository navigation
feat(redshift): journal purchase attempts around the reserved-node purchase - #701
Conversation
Part of #107. Pins providers/aws to the pkg revision that adds the AttemptJournal contract, so the Redshift journal can use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #107. Adds an in-test AttemptJournal that enforces the documented transition table, plus the first tests for the journalled purchase flow. They fail until the flow lands in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Offering Part of #107. With an idempotency token and an AttemptJournal, the purchase reads the earlier attempts first and adopts a node an earlier attempt recorded, records a sending attempt before the call (no record, no buy), and records purchased or outcome_unknown afterwards on a context detached from the caller's cancellation. A node that exists but could not be recorded is never reported as a success: the error names the reservation ID, wraps ErrOutcomeUnknown and CommitmentID stays set. Another execution's unresolved attempt under a different or unknown offering refuses. Without a journal or a token the flow is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #107. Notes the journal path on PurchaseCommitment and states the settle-wait caller contract next to the window dedupe it complements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt on a failed record Part of #107. Co-Authored-By: Claude Opus 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 30 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. |
|
@coderabbitai review |
Action not completed
|
|
APPROVED 5f629e6 by claude-cc-libs Cold, non-author review against the closed go-107 plan and the #696 contract ( Blocking: none. Read this first: the settle period is the caller's job. go reads no clock and records carry no timestamp ( Non-blocking
Checked
Mutation probes: 23 run, 23 killed. They included skipping the possibly-sent refusal, the offering-change branch, the own-execution branch, the window skew, the zero Commands (from |
|
APPROVED 5f629e6 by claude-qa-ui-3 Cold review of the full diff (money path), checked against the closed go#107 plan. Its authoritative flow is in Revision 13, as amended by R14 to R16. Pin. Flow vs. the R13 table (
Attacks
Mutation probes (each fails named tests)
Local verification (macOS, at this SHA,
|
|
APPROVED ced337a by claude-cc-libs Merge-only delta since my approval at 5f629e6.
|
|
APPROVED ced337a by claude-qa-ui-3 Merge-only delta since my approval at 5f629e6. Checked
My evidence at 5f629e6 carries over unchanged: the tests, vet, lint and 11 mutation probes, all killed. |
|
Merge gate at ced337a:
|
|
APPROVED 727fea7 by claude-cc-libs Merge-only delta since my approval at ced337a.
|
|
APPROVED 727fea7 by claude-qa-ui-3 Merge-only delta since my approval at ced337a. Checked
My evidence at 5f629e6 carries over unchanged: the tests, vet, lint and 11 mutation probes, all killed. |
Part of #107. This follows #696, which added the
AttemptJournalcontract.The Redshift reserved-node purchase uses
PurchaseOptions.AttemptJournalwhen the caller sets one along with an idempotency token. With no journal or no token, behaviour is exactly as before.What
chore(aws): bumpsproviders/aws'spkgpin to the feat(common): add a purchase attempt journal contract #696 merge.Before any AWS call:
PriorAttempts;purchasedrow when it adopts;sending. If that write fails, the purchase is refused and nothing is sent.Every refusal before the send wraps
ErrRefusedBeforePurchase, except the unresolved-attempt refusals, which wrapErrOutcomeUnknown.After the single purchase call, all writes use
context.WithoutCancelplus the existing 30s budget:purchased;outcome_unknown, and the classified error is returned (a 4xx passes through unchanged).purchasedwrite fails, the result is never Success.CommitmentIDkeeps the node ID,ExistingCommitmentis false, the error text starts with the node ID, and it wrapsErrOutcomeUnknown.The offering ID is written once per attempt. Tokens in errors and logs are masked.
The comments in
client.goanddedupe.godescribe the journal.Tests (
journal_test.go)AssertNotCalled, because the shared mocks are optional.Verification
sendingwrite;purchasedwrite;GOWORK=off, build, vet andgo test ./services/redshift/... ./internal/...pass. golangci-lint (the CI version) reports 0 issues, and gitleaks finds no leaks.Follow-up: #700 (skip nodes another lineage recorded).
🤖 Generated with Claude Code