Skip to content

feat(submitqueue): request projection cleanup - write to timestamp-based lookup table - #799

Merged
mnoah1 merged 1 commit into
mainfrom
mnoah1/submitqueue-list-receipt
Oct 7, 2026
Merged

mnoah1 merged 1 commit into
mainfrom
mnoah1/submitqueue-list-receipt

Conversation

@mnoah1

@mnoah1 mnoah1 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

First step toward keeping one full request projection in request_summary, with a small time-based lookup instead of duplicating lifecycle data for List. All required response data and receipt time are already captured.

Changes

  • Add request_receipt with only (queue, received_at_ms, request_id), its immutable storage contract, and gateway wiring.
  • Ensure receipt keys after public projection writes, including unchanged/stale-log retries. Keep accepting receipts hidden and surface partial-write failures for existing retry handling.
  • Keep List reads and the existing queue-summary projection writes in place for a safe cutover.
  • Add storage, materializer, and integration coverage.

Migration plan

Rollout from this PR (CD)

CD deploys the additive request_receipt table and gateway receipt-store/materializer changes, with the table available before receipt writes begin. Public request projections populate receipt keys alongside the existing queue-summary projection. List reads remain unchanged.

Next

  1. Next PR will switch List to scan receipt keys and point-read request_summary. Preserve the API, time bounds, ordering, and page tokens; check page latency and retain old projection writes during the rollback window.
  2. Once cutover is stable, land last PR in the stack: stop duplicate projection writes, remove RequestQueueSummary and its store/mapper, and retire request_summary_by_queue after the rollback window.

Test Plan

After rollout, confirm newly public requests have matching receipt keys while List continues using the existing projection.

Revert Plan

Revert the writer rollout; List still uses the existing projection. Leave the additive table in place until no writers depend on it.

API Changes

No RPC/proto changes. Gateway storage implementations must provide the new RequestReceiptStore accessor.

Issue Links

LINEAR-CODEM-561 — https://linear.app/uber/issue/CODEM-561/clean-up-duplicate-request-projection-in-submitqueue-code

Stack

  1. @ feat(submitqueue): request projection cleanup - write to timestamp-based lookup table #799
  2. feat(submitqueue): request projection cleanup - get requests list by timestamp and then get request_summary rows #800
  3. refactor(submitqueue): request projection cleanup - remove queue-based request projection table and all usage #801

@mnoah1
mnoah1 added this pull request to stack #803 October 7, 2026 17:35
@mnoah1 mnoah1 changed the title feat(submitqueue): add immutable receipt lookup feat(submitqueue): request projection cleanup - begin storing requests for timestamp-based lookup Oct 7, 2026
@mnoah1 mnoah1 changed the title feat(submitqueue): request projection cleanup - begin storing requests for timestamp-based lookup feat(submitqueue): request projection cleanup - timestamp-based lookup table Oct 7, 2026
@mnoah1 mnoah1 changed the title feat(submitqueue): request projection cleanup - timestamp-based lookup table feat(submitqueue): request projection cleanup - write to timestamp-based lookup table Oct 7, 2026
@mnoah1
mnoah1 marked this pull request as ready for review October 7, 2026 17:57
@mnoah1
mnoah1 requested review from a team, behinddwalls and sbalabanov as code owners October 7, 2026 17:57
@mnoah1
mnoah1 force-pushed the mnoah1/submitqueue-list-receipt branch from 2331282 to e241aaf Compare October 7, 2026 17:58
Summary:
First step toward keeping one full request projection in request_summary, with a small time-based lookup instead of duplicating lifecycle data for List. All required response data and receipt time are already captured.

### Changes

- Add request_receipt with only (queue, received_at_ms, request_id), its immutable storage contract, and gateway wiring.
- Ensure receipt keys after public projection writes, including unchanged/stale-log retries. Keep accepting receipts hidden and surface partial-write failures for existing retry handling.
- Keep List reads and the existing queue-summary projection writes in place for a safe cutover.
- Add storage, materializer, and integration coverage; document the transition in the RFC.

### Migration plan

1. Deploy the additive table before rolling out these writes. This PR populates receipt keys alongside the existing projection; it does not switch List reads.
2. Upgrade all writers, then backfill existing List membership from request_summary_by_queue keys. Validate keys against public authoritative summaries, exclude accepting receipts, and verify coverage before cutover.
3. In a follow-up, switch List to scan receipt keys and point-read request_summary. Preserve the API, time bounds, ordering, and page tokens; check page latency and keep old projection writes during the rollback window.
4. Once cutover is stable, stop duplicate projection writes, remove RequestQueueSummary and its store/mapper, and retire request_summary_by_queue after the rollback window. The final model stores one full projection plus immutable lookup keys.

Backfill tooling, read cutover, and duplicate-data removal are follow-up work. This preserves currently listed history without reconstructing requests predating the original read-model rollout.

Test Plan:
Before the internal rollout, provision the new table and confirm newly public requests produce matching receipt keys while List continues serving the old projection. Existing automated tests cover retries, concurrency, hidden receipts, and pagination.

Revert Plan:
Revert the writer rollout; List still uses the existing projection. Leave the additive table in place until no writers depend on it.

API Changes:
No RPC/proto changes. Gateway storage implementations must provide the new RequestReceiptStore accessor.
@mnoah1
mnoah1 force-pushed the mnoah1/submitqueue-list-receipt branch from e241aaf to 74e3cc3 Compare October 7, 2026 18:05
@mnoah1
mnoah1 added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit c392f27 Oct 7, 2026
16 checks passed
@mnoah1
mnoah1 deleted the mnoah1/submitqueue-list-receipt branch October 7, 2026 19:46
Tmwakalasya pushed a commit to Tmwakalasya/submitqueue that referenced this pull request Oct 8, 2026
…timestamp and then get request_summary rows (uber#800)

## Summary
Builds on uber#799 to serve List from immutable request_receipt keys and
authoritative request_summary rows, instead of the duplicated
queue-summary projection.

### Changes

- Scan receipt keys, then point-read summaries for visible results; keep
bounds, string-ID ordering, and page-token format unchanged.
- Use the existing RequestSummary response type and wire mapper.
- Fail the page on missing, mismatched, or hidden summaries using the
existing InternalConsistencyError.
- Add controller and gateway integration coverage. Keep legacy
projection writes for rollback.

### Rollout

Deploy only after uber#799 reaches all writers. No backfill or legacy-read
fallback: requests without receipt keys are absent from List.
Duplicate-write and old-table removal remain follow-up work.

## Test Plan
After CD rollout, confirm new Land requests appear in List with the same
summary fields as ID lookup, check continuation pages, and monitor page
latency.

## Revert Plan
Revert the read cutover to restore the old List path. Legacy projection
writes remain active; this PR makes no schema changes.

## API Changes
No RPC/proto changes. The Go ListResult now contains RequestSummary
values.

## Issue Links
None — no separate ticket supplied for this stacked follow-up.

## Stack
1. uber#799
1. @ uber#800
1. uber#801

This branch was previously deployed

1 inactive deployment
stack-rebase — 74e3cc30 Deployed Oct 7, 2026 by mnoah1 via Rebase Stack #582
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