Skip to content

fix(submitqueue): repair terminal request status on retry - #1039

Merged
sbalabanov merged 1 commit into
mainfrom
wt/sqc009
Nov 14, 2026
Merged

sbalabanov merged 1 commit into
mainfrom
wt/sqc009

Conversation

@sbalabanov

@sbalabanov sbalabanov commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: Rejected or cancelled requests reach their final displayed status even when publishing the terminal log initially fails.

Summary

A rejected or cancelled request can be finished internally but still look unfinished if its final status update fails to send. A retry now resends the final status without repeating validation, cancellation, or a state change. Repairs identify the consistency resend and warn that original details may be unavailable; the first attempt can still include its available reason.

Repro

  1. Submit a request that is rejected during validation, or cancel a request before it joins a batch.
  2. Let the final state write succeed, fail the final status publication, then retry the same queued message after publication works again.
  3. Before this change, the retry skips the update and the request still looks unfinished. With this change, it resends the final status and warns that original details may be unavailable, without changing the request state or version again.

Test Plan

  • Controller tests cover initial status publication, publication failures, and halted requests.
  • Shared termination tests cover same-state replay, leaving a different terminal winner untouched, and first-attempt error and cancellation details.

Focused request/controller unit targets and affected library builds passed locally; formatting, lint, Gazelle, and module checks passed.

Rollout

Replace old consumers so matching terminal retries reach status repair.

Revert Plan

Revert this PR to restore the earlier guard behavior; terminal retries may again leave the displayed status unfinished.

Issue Links

None; repository audit work, no external ticket.

@sbalabanov sbalabanov changed the title fix(submitqueue): replay persisted terminal request logs fix(submitqueue): repair terminal request status on retry Nov 10, 2026
@cla-assistant

cla-assistant Bot commented Nov 12, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
@cla-assistant

cla-assistant Bot commented Nov 12, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@sbalabanov sbalabanov left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

address comments, republish PR, make it ready for review

@sbalabanov
sbalabanov marked this pull request as ready for review November 12, 2026 23:58
@sbalabanov
sbalabanov requested review from a team and behinddwalls as code owners November 12, 2026 23:58
@sbalabanov
sbalabanov changed the base branch from wt/sqc010 to main November 13, 2026 21:16
sbalabanov pushed a commit that referenced this pull request Nov 13, 2026
**TL;DR:** Report failed submissions as Error even when no Request was saved.

## Summary
The start DLQ reports failures that occurred before a Request was saved by publishing an Error request log with request version 0. Saved Requests retain batch ownership, terminal winners and observed-version conditional writes. The DLQ publishes no normal-work command.

Builds on #1039.

## Repro
1. Accept a valid submission, but let its initial Request save fail until the message reaches `start_dlq`.
2. Process the dead letter while the Request is absent.
3. An Error request log with version 0 reports the failed submission.

## Test Plan
- Existing DLQ tests cover version-zero failure logs for missing Requests, repeated delivery and publication failures, identity validation, and saved-row ownership, terminal and conditional-write behavior.
- The messagequeue, primary Start, orchestrator and DLQ unit-test targets passed uncached. `make lint`, `make check-gazelle` and `make check-tidy` passed.

## Revert Plan
Revert this PR; existing Request data and request-log history remain intact.

## Issue Links
None — repository audit remediation without an external tracker ticket.
sbalabanov pushed a commit that referenced this pull request Nov 14, 2026
**TL;DR:** Report failed submissions as Error even when no Request was saved.

## Summary
The start DLQ reports failures that occurred before a Request was saved by publishing an Error request log with request version 0. Saved Requests retain batch ownership, terminal winners and observed-version conditional writes. The DLQ publishes no normal-work command.

Builds on #1039.

## Repro
1. Accept a valid submission, but let its initial Request save fail until the message reaches `start_dlq`.
2. Process the dead letter while the Request is absent.
3. An Error request log with version 0 reports the failed submission.

## Test Plan
- Existing DLQ tests cover version-zero failure logs for missing Requests, repeated delivery and publication failures, identity validation, saved-row ownership, terminal and conditional-write behavior, and error counting on every failed delivery.
- The messagequeue, primary Start, orchestrator and DLQ unit-test targets passed uncached. `make lint`, `make check-gazelle` and `make check-tidy` passed.

## Revert Plan
Revert this PR; existing Request data and request-log history remain intact.

## Issue Links
None — repository audit remediation without an external tracker ticket.
@sbalabanov
sbalabanov merged commit db69357 into main Nov 14, 2026
20 of 21 checks passed
@sbalabanov
sbalabanov deleted the wt/sqc009 branch November 14, 2026 02:12
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.

3 participants