[fix][proxy] Return partition metadata responses for failed backend metadata requests - #26607
Open
void-ptr974 wants to merge 1 commit into
Open
void-ptr974 wants to merge 1 commit into
void-ptr974 wants to merge 1 commit into
Conversation
…etadata requests Use the partition metadata error response when a backend metadata request fails, preserving the client request ID, error code, and error message. Add protocol regression tests for metadata errors, successful responses, and connection failures, including immediate and delayed failures. Assisted-by: OpenAI Codex
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.
Motivation
When a backend partition metadata request fails, the proxy returns a
LOOKUP_RESPONSEinstead of aPARTITIONED_METADATA_RESPONSE. Successful metadata requests and backend connection failures already use the partition metadata response. Returning the wrong command type makes the failure path inconsistent with the request and can cause differences for clients, protocol validation, and monitoring that distinguish the response types.The Java client can still recognize the error because its lookup and partition metadata response handlers share the pending request map, which masks the protocol mismatch.
Modifications
Commands.newPartitionMetadataResponsefor failed backend partition metadata requests, preserving the client request ID, error code mapping, and error message.Verifying this change
This change added tests and was verified locally with:
The 11 new unit test cases and the existing end-to-end Java client/Proxy/Broker test pass.
quickCheckpasses. Before the fix, the regression test failed because the serialized command type wasLOOKUP_RESPONSErather thanPARTITIONED_METADATA_RESPONSE.Does this pull request potentially affect one of the following parts:
The binary protocol change corrects the response command type for failed backend partition metadata requests using the existing partition metadata response schema.