Repository navigation
fix(gateway): prevent replay of delivered queries (FB-4383) - #111
Open
simonzelenskifbio wants to merge 4 commits into
Open
simonzelenskifbio wants to merge 4 commits into
simonzelenskifbio wants to merge 4 commits into
Conversation
Restrict retries to pre-delivery failures and explicit drained responses. Document staged signing-key distribution and promotion to keep token verification compatible across rolling pods.
Mintlify docs previewDocs were aggregated into the Firebolt documentation site.
Mintlify may take a few minutes to finish building. This comment updates on each sync while the source PR is open. |
This was referenced Sep 29, 2026
simonzelenskifbio
marked this pull request as ready for review
October 1, 2026 15:33
There was a problem hiding this comment.
Risk: medium. Approved: Cursor Bugbot completed successfully with no findings that need human review, and Cursor Security Agent was not running on this update. The gateway retry tightening remains a bounded behavior change with render and runtime test coverage.
Sent by Cursor Approval Agent: Infra Reviewer
fstr
approved these changes
Oct 2, 2026
simonzelenskifbio
dismissed
cursor[bot]’s stale review
October 13, 2026 07:54
The merge-base changed after approval.
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.


Background
FB-4383: retrying a generic upstream reset can replay a SQL mutation that the Engine already received and executed.
Summary
Replace
resetwithreset-before-requestin the Gateway retry policy. Retain connection-failure, refused-stream, and the Engine's explicit pre-workX-Firebolt-Drainedretries. Generic failures after delivery are returned to the client rather than automatically replayed.Add render regression coverage and a Docker fixture using the chart's Envoy image and rendered retry policy. The fixture checks that a disconnect after accepting a mutation produces one upstream call, while an explicit pre-work drained response can retry.
This change reduces automatic replay risk; it does not establish exactly-once execution or tell a client whether an interrupted mutation committed. Signing-key rotation guidance belongs to the final documentation PR, #120 (FB-4481).
Test Plan
Stack navigation: #111 → #112 → #113 → #114 → #117 → #120. Parent: FB-4382. Merge in this order. Signing-key rotation documentation is in #120 (FB-4481).
Note
High Risk
Changes gateway retry semantics for SQL traffic; incorrect policy could duplicate mutations or leave clients without safe failover during drain.
Overview
Tightens Envoy gateway retries so a mutation is not automatically replayed after the engine has already accepted the request.
The chart’s
retry_onpolicy drops genericresetin favor ofreset-before-request, while keeping connect/refused-stream failures andX-Firebolt-Drainedpre-work 503 retries. Inline comments ingateway-configmap.yamlspell out that post-delivery resets must not be retried.Adds regression coverage:
test_render.pyasserts the rendered retry contract;test_gateway_runtime.pyruns the chart’s Envoy image against a fault-injecting backend (one upstream call on accept-then-disconnect, retry on drained fence). CI’svalidate-chart.shruns the render tests;make test-renderandmake test-gateway-runtimeexpose them locally.helm/AGENTS.mddocuments the new hooks.Reviewed by Cursor Bugbot for commit 33c5dfd. Bugbot is set up for automated code reviews on this repo. Configure here.