feat(fetch): add full Fetch v10 support#1111
Open
mesteruh wants to merge 1 commit intoaio-libs:masterfrom
Open
feat(fetch): add full Fetch v10 support#1111mesteruh wants to merge 1 commit intoaio-libs:masterfrom
mesteruh wants to merge 1 commit intoaio-libs:masterfrom
Conversation
* Implement FetchRequest_v10 / FetchResponse_v10 (KIP-110, KIP-320)
· rack_id field, ZStd capability flag
· per-partition current_leader_epoch in request
· new “responses” field in response schema
* Fetcher
· builds v10 request when broker API ≥ 2.1.0
· supplies leader_epoch (-1 fallback) and log_start_offset
· parses v10 response, handles ZStd records
· treats FENCED_LEADER_EPOCH (74) & UNKNOWN_LEADER_EPOCH (75)
as retriable → triggers metadata refresh
* Tests
· `test_fetch_v10_format` covers request/response ser-des
and Fetcher happy-path
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.
feat: add FetchRequest v10 support (Kafka ≥ 2.6, KIP-110/320)
What this PR adds
FetchRequest_v10/FetchResponse_v10• Set
rack_idcapability bit → declares Zstd support• Add per-partition
current_leader_epoch&log_start_offset• Introduce top-level
responsesarrayApiVersion ≥ 2.1.0(Kafka 2.6+)• Inject
leader_epoch(-1 fallback) per partition• Parse v10 responses and decode Zstd batches
• Treat error codes 74 / 75 (FENCED / UNKNOWN_LEADER_EPOCH) as retriable → triggers metadata refresh
test_fetch_v10_formatcovers request/response round-trip and happy-path fetch with ZstdResult
aiokafkaconsumers now fetch successfully from Kafka 2.6+ clusters where Zstandard is enabled at broker or topic level-no more silent hangs.For older brokers (
ApiVersion < 2.1.0) the client keeps using v4, so behaviour remains backward-compatible.Checklist
fetch_v10.feature