[4/N] feat(gateway): persist request context on Land#327
Draft
albertywu wants to merge 1 commit into
Draft
Conversation
Summary: Add a focused admission writer that creates authoritative request context, change URI mappings, and the initial queue projection before Land appends its accepted log or publishes asynchronous work. Duplicate creates are reconciled in the application layer so identical retries converge and conflicting immutable context fails fast. Test Plan: make fmt make gazelle ./tool/bazel test //submitqueue/core/request:go_default_test //submitqueue/gateway/controller:go_default_test --test_output=errors Revert Plan: Revert this commit to stop writing request context. Existing additive rows may remain unused. API Changes: None. Monitoring and Alerts: Land controller operation metrics report admission write failures through the existing failure path.
9a8ea9c to
a165683
Compare
fa19c8d to
5d0f839
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a focused admission writer that creates authoritative request context, change URI mappings, and the initial queue projection before first request log publish.
The gateway persists all request-context rows before publishing the request to the orchestrator. If any context write fails, the Land call fails before pipeline publication. The client can retry Land, which generates a new sqid for the new attempt.
This change also unblocks implementation of the HistoryAPI, because change uri -> request mappings will be stored prior to first request log, which is needed for the HistoryByChangeIDRequest endpoint described here
Test Plan
✅
make fmt && make build && make test && make check-mocks && make e2e-testStack