Skip to content

fix(submitqueue): replay persisted terminal request logs - #1039

Draft
sbalabanov wants to merge 1 commit into
wt/sqc010from
wt/sqc009
Draft

sbalabanov wants to merge 1 commit into
wt/sqc010from
wt/sqc009

Conversation

@sbalabanov

@sbalabanov sbalabanov commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Persist terminal timestamp, error, and metadata with the winning request snapshot. Replay matching terminal logs from validation, conflict-signal, and cancellation retries without another transition or provider call. Incomplete legacy repairs cannot erase known gateway diagnostics. Builds on #1037.

Reproduction

  1. Reject or cancel a request, allowing its terminal CAS to succeed but failing log publication.
  2. Redeliver the validation, conflict-signal, or cancellation message, including a changed incidental reason/result.
  3. The retry must publish the original terminal facts without another terminal write; a different terminal winner remains untouched.

Test Plan

Extended existing Process regressions compare identical original diagnostics, timestamps, and versions after failed publication and retry. TestTerminateRequest_ReplaysWinningFactsAfterPublishFailure also covers changed retry diagnostics and duplicate delivery. TestRequestTerminalDetailsMigration proves the real MySQL migration, legacy NULL fallback, diagnostic roundtrip, and malformed-detail rejection. Materializer tests prove history/mapping repair without diagnostic loss.

./tool/bazel test //submitqueue/... --test_output=errors: 59 targets passed. MySQL integration and 12 impacted targets after rebasing also passed; repository mechanical checks passed.

Rollout

Apply the additive migration first. Deploy gateway legacy protection before fallback publishers, then replace old consumers.

Revert Plan

Revert code but retain the additive column and persisted facts. Retain failed deliveries for replay; reverting Process repair reopens missing logs.

Issue Links

None; repository audit work, no external ticket.

Summary:
Persist the terminal timestamp, error, and metadata in the winning request snapshot. Retry matching terminal outcomes without another transition or provider call, and prevent incomplete legacy repairs from erasing known diagnostics.

Reproduction:
1. Reject or cancel a request while the terminal state write succeeds and its log publication fails.
2. Redeliver the original validation, conflict-signal, or cancellation message.
3. Confirm the retry publishes the original terminal facts without another terminal write; a different terminal winner remains unchanged.

Test Plan:
The existing Process regression tests exercise failed publication followed by successful replay and compare the original diagnostics, timestamp, and request version. TestTerminateRequest_ReplaysWinningFactsAfterPublishFailure also covers changed retry diagnostics and duplicate delivery.

TestRequestTerminalDetailsMigration demonstrates the explicit additive migration, readable legacy NULL details, preserved new diagnostics, and rejection of malformed non-NULL details against MySQL. Materializer tests verify history/mapping repair without overwriting known diagnostics.

Verified with ./tool/bazel test //submitqueue/... --test_output=errors (59 targets), the MySQL storage integration target, focused coverage, and repository formatting/lint/module/build/mock checks.

Revert Plan:
Revert the code while retaining the additive terminal_details column and its persisted facts. Retain failed deliveries for replay; reverting terminal Process repair reopens the missing-log failure.

This branch has not been deployed

No deployments
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