Skip to content

Commit 330358a

Browse files
committed
[KIP-848] HB Error Code, Partial ack flow, OffsetCommit Request, Response and various fixes (#4634)
- Added error handling to ConsumerGroupHeartbeat API - Added type new errors - UNRELEASED_INSTANCE_ID and UNSUPPORTED_ASSIGNOR - Added partial acknowledgement flow - Upgraded OffsetCommit Request and response to v9 - Fixed metadata being called with duplicate topic id - Fixed next_target_assignment not getting reset to NULL - Fixed member stuck if fenced during rebalancing - Fixed segfault with current and target assignment while resetting consumer group - Fixed segfault due to deleted topic in metadata - Fixed leave not being called if the consumer without any assignment leaves
1 parent 22f0285 commit 330358a

16 files changed

+490
-222
lines changed

INTRODUCTION.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,45 +1972,45 @@ The [Apache Kafka Implementation Proposals (KIPs)](https://cwiki.apache.org/conf
19721972
release of librdkafka.
19731973

19741974

1975-
| ApiKey | Request name | Kafka max | librdkafka max |
1976-
| ------- | ------------------------------| ----------- | ----------------------- |
1977-
| 0 | Produce | 9 | 7 |
1978-
| 1 | Fetch | 15 | 11 |
1979-
| 2 | ListOffsets | 8 | 7 |
1980-
| 3 | Metadata | 12 | 12 |
1981-
| 8 | OffsetCommit | 8 | 7 |
1982-
| 9 | OffsetFetch | 8 | 7 |
1983-
| 10 | FindCoordinator | 4 | 2 |
1984-
| 11 | JoinGroup | 9 | 5 |
1985-
| 12 | Heartbeat | 4 | 3 |
1986-
| 13 | LeaveGroup | 5 | 1 |
1987-
| 14 | SyncGroup | 5 | 3 |
1988-
| 15 | DescribeGroups | 5 | 4 |
1989-
| 16 | ListGroups | 4 | 4 |
1990-
| 17 | SaslHandshake | 1 | 1 |
1991-
| 18 | ApiVersions | 3 | 3 |
1992-
| 19 | CreateTopics | 7 | 4 |
1993-
| 20 | DeleteTopics | 6 | 1 |
1994-
| 21 | DeleteRecords | 2 | 1 |
1995-
| 22 | InitProducerId | 4 | 4 |
1996-
| 23 | OffsetForLeaderEpoch | 4 | 2 |
1997-
| 24 | AddPartitionsToTxn | 4 | 0 |
1998-
| 25 | AddOffsetsToTxn | 3 | 0 |
1999-
| 26 | EndTxn | 3 | 1 |
2000-
| 28 | TxnOffsetCommit | 3 | 3 |
2001-
| 29 | DescribeAcls | 3 | 1 |
2002-
| 30 | CreateAcls | 3 | 1 |
2003-
| 31 | DeleteAcls | 3 | 1 |
2004-
| 32 | DescribeConfigs | 4 | 1 |
2005-
| 33 | AlterConfigs | 2 | 2 |
2006-
| 36 | SaslAuthenticate | 2 | 1 |
2007-
| 37 | CreatePartitions | 3 | 0 |
2008-
| 42 | DeleteGroups | 2 | 1 |
2009-
| 44 | IncrementalAlterConfigs | 1 | 1 |
2010-
| 47 | OffsetDelete | 0 | 0 |
2011-
| 50 | DescribeUserScramCredentials | 0 | 0 |
2012-
| 51 | AlterUserScramCredentials | 0 | 0 |
2013-
1975+
| ApiKey | Request name | Kafka max | librdkafka max |
1976+
| ------- | ------------------------------|-----------|----------------|
1977+
| 0 | Produce | 9 | 7 |
1978+
| 1 | Fetch | 15 | 11 |
1979+
| 2 | ListOffsets | 8 | 7 |
1980+
| 3 | Metadata | 12 | 12 |
1981+
| 8 | OffsetCommit | 9 | 9 |
1982+
| 9 | OffsetFetch | 9 | 9 |
1983+
| 10 | FindCoordinator | 4 | 2 |
1984+
| 11 | JoinGroup | 9 | 5 |
1985+
| 12 | Heartbeat | 4 | 3 |
1986+
| 13 | LeaveGroup | 5 | 1 |
1987+
| 14 | SyncGroup | 5 | 3 |
1988+
| 15 | DescribeGroups | 5 | 4 |
1989+
| 16 | ListGroups | 4 | 4 |
1990+
| 17 | SaslHandshake | 1 | 1 |
1991+
| 18 | ApiVersions | 3 | 3 |
1992+
| 19 | CreateTopics | 7 | 4 |
1993+
| 20 | DeleteTopics | 6 | 1 |
1994+
| 21 | DeleteRecords | 2 | 1 |
1995+
| 22 | InitProducerId | 4 | 4 |
1996+
| 23 | OffsetForLeaderEpoch | 4 | 2 |
1997+
| 24 | AddPartitionsToTxn | 4 | 0 |
1998+
| 25 | AddOffsetsToTxn | 3 | 0 |
1999+
| 26 | EndTxn | 3 | 1 |
2000+
| 28 | TxnOffsetCommit | 3 | 3 |
2001+
| 29 | DescribeAcls | 3 | 1 |
2002+
| 30 | CreateAcls | 3 | 1 |
2003+
| 31 | DeleteAcls | 3 | 1 |
2004+
| 32 | DescribeConfigs | 4 | 1 |
2005+
| 33 | AlterConfigs | 2 | 2 |
2006+
| 36 | SaslAuthenticate | 2 | 1 |
2007+
| 37 | CreatePartitions | 3 | 0 |
2008+
| 42 | DeleteGroups | 2 | 1 |
2009+
| 44 | IncrementalAlterConfigs | 1 | 1 |
2010+
| 47 | OffsetDelete | 0 | 0 |
2011+
| 50 | DescribeUserScramCredentials | 0 | 0 |
2012+
| 51 | AlterUserScramCredentials | 0 | 0 |
2013+
| 68 | ConsumerGroupHeartbeat | 0 | 0 |
20142014

20152015
# Recommendations for language binding developers
20162016

examples/consumer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,4 @@ int main(int argc, char **argv) {
258258
rd_kafka_destroy(rk);
259259

260260
return 0;
261-
}
261+
}

src/rdkafka.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,12 @@ static const struct rd_kafka_err_desc rd_kafka_err_descs[] = {
704704
_ERR_DESC(RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_ID, "Broker: Unknown topic id"),
705705
_ERR_DESC(RD_KAFKA_RESP_ERR_FENCED_MEMBER_EPOCH,
706706
"Broker: The member epoch is fenced by the group coordinator"),
707+
_ERR_DESC(RD_KAFKA_RESP_ERR_UNRELEASED_INSTANCE_ID,
708+
"Broker: The instance ID is still used by another member in the "
709+
"consumer group"),
710+
_ERR_DESC(RD_KAFKA_RESP_ERR_UNSUPPORTED_ASSIGNOR,
711+
"Broker: The assignor or its version range is not supported by "
712+
"the consumer group"),
707713
_ERR_DESC(RD_KAFKA_RESP_ERR_STALE_MEMBER_EPOCH,
708714
"Broker: The member epoch is stale"),
709715
_ERR_DESC(RD_KAFKA_RESP_ERR__END, NULL)};

src/rdkafka.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,12 @@ typedef enum {
635635
RD_KAFKA_RESP_ERR_UNKNOWN_TOPIC_ID = 100,
636636
/** The member epoch is fenced by the group coordinator */
637637
RD_KAFKA_RESP_ERR_FENCED_MEMBER_EPOCH = 110,
638+
/** The instance ID is still used by another member in the
639+
* consumer group */
640+
RD_KAFKA_RESP_ERR_UNRELEASED_INSTANCE_ID = 111,
641+
/** The assignor or its version range is not supported by the consumer
642+
* group */
643+
RD_KAFKA_RESP_ERR_UNSUPPORTED_ASSIGNOR = 112,
638644
/** The member epoch is stale */
639645
RD_KAFKA_RESP_ERR_STALE_MEMBER_EPOCH = 113,
640646
RD_KAFKA_RESP_ERR_END_ALL,

0 commit comments

Comments
 (0)