# New extension: Listing Partitions (Kafka)

**URL:** https://forum.codecrafters.io/t/new-extension-listing-partitions-kafka/2171
**Category:** Announcements
**Created:** [October 8, 2024, 10:37pm UTC](https://forum.codecrafters.io/t/new-extension-listing-partitions-kafka/2171 "2024-10-08T22:37:39Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)
#### Post date: [October 8, 2024, 10:37pm UTC](https://forum.codecrafters.io/t/new-extension-listing-partitions-kafka/2171/1 "2024-10-08T22:37:39Z")

</div>

The next extension for the Kafka challenge is now live: **Listing Partitions**.

This is an interesting one since you’ll finally get to deal with Kafka’s on-disk storage format:

 ![Log File preview](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/a/a2d96d356db409a7c2569645bda02855c0eed5ba.png)

Learn about how Kafka stores messages on disk, the `__cluster_metadata` topic and more, by implementing the [DescribeTopicPartitions](https://kafka.apache.org/protocol.html#The_Messages_DescribeTopicPartitions) API to support listing topic partitions.

Here’s the stage breakdown:

 ![Stages for Listing Partitions](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/7/768aacd8ac36d1949c474c8d06e1f72fce19acb3.png)

Please [give this a try](https://app.codecrafters.io/courses/kafka/overview) and let us know how it can be improved! @ryan-gang (author of this extension) and I will be available here to help out!

---

<div class="post-metadata">

### Author: ![ValentinJub](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/valentinjub/32/145_2.png) [@ValentinJub](https://forum.codecrafters.io/u/ValentinJub)
#### Post date: [October 10, 2024, 4:02pm UTC](https://forum.codecrafters.io/t/new-extension-listing-partitions-kafka/2171/2 "2024-10-10T16:02:22Z")

</div>

I finished the extension and thought it was the smoothest of all, well done I enjoyed it.

Binspec was very useful but I’m certain it contains errors, for instance:

DescribeTopicResponse V0:

Binspec says that:

EligibleLeaderReplicas → varint  
LastKnownElr → varint  
OfflineReplicas → varint

Whereas these are listed as compact arrays of int32 on Kafka doc: [Apache Kafka](https://kafka.apache.org/protocol.html#The_Messages_DescribeTopicPartitions)

The tests expect compact arrays for these three fields, thankfully.

However, binspec was a massive help in decoding what I needed from the cluster\_metadata file 🙂

Regarding the tests for “List for multiple partitions #ku4” the tests expect two Partition indexes. The order in which I find these Partition Index in the cluster\_metadata file is the opposite order that the test expects.

Say the Partition IDs found are 146 and 145 (In the order they appear in the cluster file), the test expects 145 and then 146, I’m not sure if that’s how Kafka works intrinsically but it does seem strange to me

---

<div class="post-metadata">

### Author: ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)
#### Post date: [October 11, 2024, 3:12am UTC](https://forum.codecrafters.io/t/new-extension-listing-partitions-kafka/2171/3 "2024-10-11T03:12:27Z")

</div>

@ValentinJub Thanks for your detailed feedback!

I’ll consult with the author of the challenge (who’s currently on vacation) and will get back to you as soon as possible.

---

<div class="post-metadata">

### Author: ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)
#### Post date: [October 20, 2024, 10:09pm UTC](https://forum.codecrafters.io/t/new-extension-listing-partitions-kafka/2171/5 "2024-10-20T22:09:42Z")

</div>

We should have the binspec mistakes corrected this week!

---

<div class="post-metadata">

### Author: ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)
#### Post date: [October 30, 2024, 4:44pm UTC](https://forum.codecrafters.io/t/new-extension-listing-partitions-kafka/2171/6 "2024-10-30T16:44:21Z")

</div>

@ValentinJub We fixed the issue in [this PR](https://github.com/codecrafters-io/binspec/pull/21). Thanks again for highlighting it!
