New extension: Listing Partitions (Kafka)

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:

Learn about how Kafka stores messages on disk, the __cluster_metadata topic and more, by implementing the DescribeTopicPartitions API to support listing topic partitions.

Here’s the stage breakdown:

Please give this a try and let us know how it can be improved! @ryan-gang (author of this extension) and I will be available here to help out!

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

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 :slight_smile:

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

2 Likes

@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.

We should have the binspec mistakes corrected this week!

1 Like

@ValentinJub We fixed the issue in this PR. Thanks again for highlighting it!

1 Like