You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stage_descriptions/produce-06_mf2.md
+16-9Lines changed: 16 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,14 @@ In this stage, you'll add support for producing to multiple partitions of the sa
2
2
3
3
## Partition Routing
4
4
5
-
Your Kafka implementation should handle writes to multiple partitions within the same topic, manage independent offset assignment per partition, and aggregate responses correctly. Each partition maintains its own offset sequence independently.
5
+
When a Kafka broker receives a Produce request targeting multiple partitions of the same topic, it needs to validate that the topic and all partitions exist, write records to each partition's log file independently, and return a response containing results for all partitions. Each partition maintains its own offset sequence independently, so partition 0 and partition 1 can both have records starting at offset 0.
6
+
7
+
The request will contain multiple RecordBatches, one for each partition. Each RecordBatch will contain a single record.
8
+
9
+
We've created an interactive protocol inspector for the request & response structures for `Produce`:
@@ -23,18 +30,18 @@ The tester will validate that:
23
30
- The `name` field in the topic response matches the topic name in the request.
24
31
- Each partition in the request has a corresponding partition response.
25
32
- Each partition response contains:
26
-
- The correct `partition` field matching the request.
33
+
- The correct `index` field matching the partition in the request.
27
34
- An error code of `0` (NO_ERROR).
28
-
- A valid `offset` field with the assigned offset for that partition.
29
-
-A valid `timestamp` field.
30
-
-A correct `log_start_offset` field.
35
+
- A valid `base_offset` field with the assigned offset for that partition.
36
+
-The `log_append_time_ms` field contains `-1` (signifying that the timestamp is latest).
37
+
-The `log_start_offset` field is `0`.
31
38
- Records are persisted to the correct partition log files.
32
39
- Offset assignment is independent per partition (partition 0 and partition 1 can both have offset 0).
33
40
41
+
The tester will also verify that the records are persisted to the correct partition log files.
42
+
34
43
## Notes
35
44
36
-
- Each partition maintains its own offset sequence starting from 0.
37
-
- Multiple partitions can be written to simultaneously in a single request.
38
45
- The response must include entries for all requested partitions.
39
-
-Partition-level errors should be handled independently (one partition failure shouldn't affect others).
40
-
- The official docs for the `Produce` request can be found [here](https://kafka.apache.org/protocol.html#The_Messages_Produce).
46
+
-On-disk log files must be stored in RecordBatch format with proper CRC validation.
47
+
- The official docs for the `Produce` request can be found [here](https://kafka.apache.org/protocol.html#The_Messages_Produce). Make sure to scroll down to the "Produce Response (Version: 11)" section.
0 commit comments