From c23b2a67a460033bb37e5f6f0808f3c6e39abb7a Mon Sep 17 00:00:00 2001 From: Emanuele Sabellico Date: Wed, 16 Oct 2024 09:57:38 +0200 Subject: [PATCH] Fix for a Fetch regression when connecting to Apache Kafka < 2.7 (#4871) AK 2.7 is the first version implementing Fetch 12, before that it shouldn't fallback to v12, neither check if topic IDs are supported. --- CHANGELOG.md | 18 ++++++++++++++++++ src/rdkafka_fetcher.c | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9b43973b..7cf8a2e29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,21 @@ +# librdkafka v2.6.1 + +librdkafka v2.6.1 is a maintenance release: + + * Fix for a Fetch regression when connecting to Apache Kafka < 2.7 (#4871). + + +## Fixes + +### Consumer fixes + + * Issues: #4870 + Fix for a Fetch regression when connecting to Apache Kafka < 2.7, causing + fetches to fail. + Happening since v2.6.0 (#4871) + + + # librdkafka v2.6.0 librdkafka v2.6.0 is a feature release: diff --git a/src/rdkafka_fetcher.c b/src/rdkafka_fetcher.c index 835271a4b..24112f4c1 100644 --- a/src/rdkafka_fetcher.c +++ b/src/rdkafka_fetcher.c @@ -996,8 +996,8 @@ int rd_kafka_broker_fetch_toppars(rd_kafka_broker_t *rkb, rd_ts_t now) { /* Fallback to version 12 if topic id is null which can happen if * inter.broker.protocol.version is < 2.8 */ - ApiVersion = - ApiVersion > 12 && can_use_topic_ids(rkb) ? ApiVersion : 12; + if (ApiVersion > 12 && !can_use_topic_ids(rkb)) + ApiVersion = 12; rkbuf = rd_kafka_buf_new_flexver_request( rkb, RD_KAFKAP_Fetch, 1,