Skip to content

app/vtstorage/netselect: return 502 instead of empty 200 on non-200 vtstorage response - #314

Open
cuongleqq wants to merge 1 commit into
masterfrom
netselect-partial-response-non-200
Open

cuongleqq wants to merge 1 commit into
masterfrom
netselect-partial-response-non-200

Conversation

@cuongleqq

Copy link
Copy Markdown

With -search.allowPartialResponse, a non-200 response from one vtstorage node could make vtselect return an empty 200 OK, depending on the node order in -storageNode. Now it returns 502 regardless of the node order in -storageNode.

Porting VictoriaMetrics/VictoriaLogs#1940 to VictoriaTraces, together with the tests for getFirstError() from VictoriaMetrics/VictoriaLogs@85051a8.

Related to VictoriaMetrics/VictoriaLogs#1935

@cuongleqq
cuongleqq requested a review from jiekun November 11, 2026 07:55

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/vtstorage/netselect/netselect.go">

<violation number="1" location="app/vtstorage/netselect/netselect.go:816">
P2: This check can still return the 502 error after a successful backend has streamed a 1 MiB block, which commits the internal response as 200. Buffer the response until all backend errors are known, or otherwise delay streaming, so a later non-200 can actually produce 502 instead of a truncated 200 response.</violation>
</file>

Click Fix with cubic on a comment, or reply @cubic-dev-ai fix this, and cubic writes the fix.

Turn on auto-fix | Re-trigger cubic

Comment thread app/vtstorage/netselect/netselect.go Resolved
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.

1 participant