Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] fake protocol version for zstd. #1443

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,14 @@ func (bc *brokerConsumer) fetchNewMessages() (*FetchResponse, error) {
request.Version = 4
request.Isolation = bc.consumer.conf.Consumer.IsolationLevel
}
// TODO: verify that versions 5-9 didn't introduce breaking change.
// v9 introduces FETCH_REQUEST_TOPIC_V9,
// v7 introduces FORGOTTEN_TOPIC_DATA_V7, SESSION_ID, & SESSION_EPOCH, and
// v5 introduces TOPICS_V5 (subsumed by FETCH_REQUEST_TOPIC_V9).
// There also may be response level changes.
if bc.consumer.conf.Version.IsAtLeast(V2_1_0_0) {
request.Version = 10
}

for child := range bc.subscriptions {
request.AddBlock(child.topic, child.partition, child.offset, child.fetchSize)
Expand Down
5 changes: 5 additions & 0 deletions produce_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ func (ps *produceSet) buildRequest() *ProduceRequest {
if ps.parent.conf.Version.IsAtLeast(V0_11_0_0) {
req.Version = 3
}
// TODO: check for Version cases between 4-6 inclusive.
// No protocol changes are introduced to the request, but the response changes.
if ps.parent.conf.Version.IsAtLeast(V2_1_0_0) {
req.Version = 7
}

for topic, partitionSets := range ps.msgs {
for partition, set := range partitionSets {
Expand Down