# Request for documentation in cm4: Fetch with an empty topic

**URL:** <https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578>\
**Category:** Challenges\
**Tags:** challenge:kafka\
**Created:** [April 11, 2025, 6:47am UTC](https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578 "2025-04-11T06:47:04Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheBlueFireFox](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/thebluefirefox/32/1180_2.png) [@TheBlueFireFox](https://forum.codecrafters.io/u/TheBlueFireFox)\
**Post date:** [April 11, 2025, 6:47am UTC](https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578/1 "2025-04-11T06:47:04Z")

</div>

Hello, I am having some issues understanding the “/tmp/kraft-combined-logs/\_\_cluster\_metadata-0/00000000000000000000.log” structure, which, according to my (limited) understanding, will provide the mapping from the topic UUID to the topic name.  
I have already parsed the content with the [Message Format](https://kafka.apache.org/documentation/#messageformat), but I am struggling to find any information on the value structure.  
I think this should be the correct file, as it fits both criteria: the empty partition name and the topic UUID requested seem to be contained in it.

Could you please provide me with more documentation on parsing that value block?

Thank you very much on this great challenge

---

<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:** [April 11, 2025, 5:05pm UTC](https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578/4 "2025-04-11T17:05:51Z")

</div>

Hey @TheBlueFireFox, feel free to use [BinSpec](https://binspec.org/kafka-cluster-metadata?highlight=158-181) to check the value structure.

Additionally, you can add these lines to `.codecrafters/run.sh` to print a hex dump:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/a/a02d07b4b147695a04dff98e82ab966b98202d03.png)

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/d/d93fea6ba71fe284767a83eddb2cfd3bb057379b.jpeg)

---

<div class="post-metadata">

**Author:** ![TheBlueFireFox](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/thebluefirefox/32/1180_2.png) [@TheBlueFireFox](https://forum.codecrafters.io/u/TheBlueFireFox)\
**Post date:** [April 11, 2025, 6:38pm UTC](https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578/6 "2025-04-11T18:38:18Z")

</div>

@andy1li  
I apologize for the misunderstanding, what I meant is the structure of the blue blocks.  
As there are more records then just these topic related entries.  
(Plus thanks for the link, it’s really useful)

---

<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:** [April 11, 2025, 6:50pm UTC](https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578/7 "2025-04-11T18:50:26Z")

</div>

Thanks for the clarification!

> As there are more records then just these topic related entries.

@TheBlueFireFox Would you mind sharing a few examples of records you’re referring to?

---

<div class="post-metadata">

**Author:** ![TheBlueFireFox](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/thebluefirefox/32/1180_2.png) [@TheBlueFireFox](https://forum.codecrafters.io/u/TheBlueFireFox)\
**Post date:** [April 11, 2025, 8:36pm UTC](https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578/8 "2025-04-11T20:36:11Z")

</div>

[Here](https://pastebin.com/ERmseN1i) is a pastebin of the full parsed “\_\_cluster\_metadata-0/00000000000000000000.log” file.  
As you might be able to see, every “value” array in a record is different.  
Some have a topic name in it (ex, line 86: 98, 97, 122 =\> baz), others do not.  
So, I am trying to determine the structure of these value arrays.

---

<div class="post-metadata">

**Author:** ![TheBlueFireFox](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/thebluefirefox/32/1180_2.png) [@TheBlueFireFox](https://forum.codecrafters.io/u/TheBlueFireFox)\
**Post date:** [April 11, 2025, 8:42pm UTC](https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578/10 "2025-04-11T20:42:25Z")

</div>

I just realized that the binspec you (@andy1li) linked shows the structure for the value field, which I have been searching for. So every “Record value” belongs to one of the following Record types.

1. [Topic Record](https://binspec.org/kafka-cluster-metadata?highlight=158-181)
2. [Partition Record](https://binspec.org/kafka-cluster-metadata?highlight=191-255)
3. [Feature Level Record](https://binspec.org/kafka-cluster-metadata?highlight=67-89)

---

<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:** [April 11, 2025, 8:48pm UTC](https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578/11 "2025-04-11T20:48:45Z")

</div>

Feel free to dive deeper into the details here:

> **[KIP-746: Revise KRaft Metadata Records - Apache Kafka - Apache Software...](https://cwiki.apache.org/confluence/display/KAFKA/KIP-746%3A%2BRevise%2BKRaft%2BMetadata%2BRecords)**

---

<div class="post-metadata">

**Author:** ![TheBlueFireFox](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/thebluefirefox/32/1180_2.png) [@TheBlueFireFox](https://forum.codecrafters.io/u/TheBlueFireFox)\
**Post date:** [April 11, 2025, 9:04pm UTC](https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578/13 "2025-04-11T21:04:17Z")

</div>

Thank you very much for your help

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [April 16, 2025, 9:04pm UTC](https://forum.codecrafters.io/t/request-for-documentation-in-cm4-fetch-with-an-empty-topic/8578/14 "2025-04-16T21:04:51Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
