Skip to content

Implement retry batch creation - #5685

Merged
johnsimons merged 1 commit into
masterfrom
john/retry_batches
Aug 3, 2026
Merged

Implement retry batch creation#5685
johnsimons merged 1 commit into
masterfrom
john/retry_batches

Conversation

@johnsimons

Copy link
Copy Markdown
Member

Retry batch creation for the SQL Server and PostgreSQL persisters: create a batch, claim its, move it to staging, adopt orphans, rebuild operation state. Staging and forwarding follow the next PR.

Decisions worth a look

  • No membership table. A message belongs to at most one batch, so FailedMessageRetries.RetryBatchId the membership and FailureRetries is a query over it.
  • Claiming is one statement, insert if absent via the provider dialect, the same seam ingestion for known endpoints. The database decides who wins a contested message.
  • The forwarding pointer stays. After a crash a batch can carry Forwarding status without the one in flight, so the pointer is what recovery trusts.
  • Unparseable message ids are skipped, since they arrive from the API and cannot match anything. ids come from CreateBatch, so those throw.
  • Renames: IRetryBatchStore and members named for what they do. GetBatchesFor* returned no, so they are now ForEach* over messages, minus three parameters dead in both persisters.
    GetCurrentForwardingBatchreturns aForwardingRetryBatch` rather than a batch with an empty list.

@johnsimons johnsimons self-assigned this Aug 3, 2026
Base automatically changed from john/message_redirects to master August 3, 2026 07:55
Adds RetryBatches and RetryBatchNowForwarding, and swaps the string RetryId on
FailedMessageRetries for a Guid RetryBatchId plus StageAttempts.

Membership is not stored twice: a message belongs to at most one batch, so
RetryBatchId is the membership and FailureRetries is a query over it. Claiming
is one insert if absent through the provider dialect, so there is no conflict
to recover from in code.

Renames the contract to IRetryBatchStore, away from document vocabulary.
@johnsimons
johnsimons merged commit 1d1b6cc into master Aug 3, 2026
37 checks passed
@johnsimons
johnsimons deleted the john/retry_batches branch August 3, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants