Skip to content

Redshift: two identical-tuple recommendations in one execution buy one node #1809

Open

Description

@cristim

Summary

An execution that selects two Redshift recommendations with an identical purchase tuple (same region, node type, term, payment and count, same account) buys one reserved node, not two. The second purchase call adopts the node bought by the first.

Current behaviour

For every tokenized purchase, the Redshift client in cloud-commitments-go first looks for an owned node with the same offering and node count that started at or after RequestedAt minus 5 minutes, and adopts it if found. Both recommendations in one execution share the execution's RequestedAt. So the second call finds the node the first call just bought, reports success, and buys nothing. This is the third MEDIUM entry in known_issues/39_redshift_dedupe_window.md.

Steps to verify the gap

  1. Create a purchase whose selection holds two Redshift recommendations with an identical tuple for the same account.
  2. Execute it against a provider fake that counts PurchaseCommitment calls that actually buy.
  3. Both recommendations report success, but only one node is bought.

Expected behaviour

Either both nodes are bought, or the purchase is refused before submission with a clear message.

Proposed fix

Refuse before submission when one execution selects two Redshift recommendations with an identical tuple and account. This is a cheap check next to the Redshift dispatch gate (internal/purchase/redshift_lineage.go), with a fixed, allowlisted refusal text. A go-side fix (excluding nodes already claimed by another token through the attempt journal) is being discussed with the cloud-commitments-go journal work.

References

Severity

Medium (money path: under-buy, with the commitment attributed twice).

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions