From 2e47ced2eb21b263aba695ee0cd854d073229c89 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Fri, 4 Oct 2024 17:50:48 +0530 Subject: [PATCH 1/7] chore: add binspec cluster metadata generator + spec --- protocol/api/spec.yml | 349 ++++++++++++++++++ .../serializer/cluster_metadata_binspec.go | 142 +++++++ 2 files changed, 491 insertions(+) create mode 100644 protocol/api/spec.yml create mode 100644 protocol/serializer/cluster_metadata_binspec.go diff --git a/protocol/api/spec.yml b/protocol/api/spec.yml new file mode 100644 index 0000000..728613a --- /dev/null +++ b/protocol/api/spec.yml @@ -0,0 +1,349 @@ +data: + # RecordBatch[0] + - 0x00 # Base Offset (8 bytes, 0x01 in hex, 1 in decimal) + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x01 + - 0x00 # Batch Length (4 bytes, 0x4f in hex, 79 in decimal) + - 0x00 + - 0x00 + - 0x4f + - 0x00 # Partition Leader Epoch (4 bytes, 0x01 in hex, 1 in decimal) + - 0x00 + - 0x00 + - 0x01 + - 0x02 # Magic Byte (1 byte, 0x02 in hex, 2 in decimal) + - 0x96 # CRC (4 bytes, 0x9654b1a5 in hex, -1772834395 in decimal) + - 0x54 + - 0xb1 + - 0xa5 + - 0x00 # Attributes (2 bytes, 0x00 in hex, 0 in decimal) + - 0x00 + - 0x00 # Last Offset Delta (4 bytes, 0x03 in hex, 3 in decimal) + - 0x00 + - 0x00 + - 0x03 + - 0x00 # Base Timestamp (8 bytes, 0x00000191e05af818 in hex, 1726045943832 in decimal) + - 0x00 + - 0x01 + - 0x91 + - 0xe0 + - 0x5a + - 0xf8 + - 0x18 + - 0x00 # Max Timestamp (8 bytes, 0x00000191e05af818 in hex, 1726045943832 in decimal) + - 0x00 + - 0x01 + - 0x91 + - 0xe0 + - 0x5a + - 0xf8 + - 0x18 + - 0xff # Producer ID (8 bytes, 0xffffffffffffffff in hex, -1 in decimal) + - 0xff + - 0xff + - 0xff + - 0xff + - 0xff + - 0xff + - 0xff + - 0xff # Producer Epoch (2 bytes, 0xffff in hex, -1 in decimal) + - 0xff + - 0xff # Base Sequence (4 bytes, 0xffffffff in hex, -1 in decimal) + - 0xff + - 0xff + - 0xff + - 0x00 # Records Length (4 bytes, 0x01 in hex, 1 in decimal) + - 0x00 + - 0x00 + - 0x01 + + # Record[0] + - 0x3a # Record Length (1 byte, 0x3a in hex, 29 in decimal (as signed varint)) (Length from attributes to the end of the record) + - 0x00 # Attributes (1 byte, 0x00 in hex, 0 in decimal) + - 0x00 # Timestamp Delta (1 byte, 0x00 in hex, 0 in decimal) + - 0x00 # Offset Delta (1 byte, 0x00 in hex, 0 in decimal) + - 0x01 # Key Length (1 byte, 0x01 in hex, -1 in decimal (as signed varint, using zigzag encoding, refer to: https://protobuf.dev/programming-guides/encoding/#signed-ints)) + # As key length is -1, the key value is empty + - 0x2e # Value Length (1 byte, 0x2e in hex, 23 in decimal (as signed varint)) + # Payload: Feature Level Record + - 0x01 # Frame Version (1 byte, 0x01 in hex, 1 in decimal) + - 0x0c # Type (1 byte, 0x0c in hex, 12 in decimal) + - 0x00 # Version (1 byte, 0x00 in hex, 0 in decimal) + - 0x11 # Name Length (1 byte, 0x11 in hex, 17 in decimal (as unsigned varint)) + - 0x6d # Name (Compact String (Length = 17 - 1), parsed as "metadata.version") + - 0x65 + - 0x74 + - 0x61 + - 0x64 + - 0x61 + - 0x74 + - 0x61 + - 0x2e + - 0x76 + - 0x65 + - 0x72 + - 0x73 + - 0x69 + - 0x6f + - 0x6e + - 0x00 # Feature Level (2 bytes, 0x14 in hex, 20 in decimal) + - 0x14 + - 0x00 # Tagged Field Count (1 byte, 0x00 in hex, 0 in decimal) (unsigned varint) + + # RecordBatch[1] + - 0x00 # Base Offset (8 bytes, 0x02 in hex, 2 in decimal) + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 # Batch Length (4 bytes, 0xe4 in hex, 228 in decimal) + - 0x00 + - 0x00 + - 0xe4 + - 0x00 # Partition Leader Epoch (4 bytes, 0x01 in hex, 1 in decimal) + - 0x00 + - 0x00 + - 0x01 + - 0x02 # Magic Byte (1 byte, 0x02 in hex, 2 in decimal) + - 0xeb # CRC (4 bytes, 0xeb602a9d in hex, -346019171 in decimal) + - 0x60 + - 0x2a + - 0x9d + - 0x00 # Attributes (2 bytes, 0x00 in hex, 0 in decimal) + - 0x00 + - 0x00 # Last Offset Delta (4 bytes, 0x01 in hex, 1 in decimal) + - 0x00 + - 0x00 + - 0x01 + - 0x00 # Base Timestamp (8 bytes, 0x00000191e05b2d15 in hex, 1726045957397 in decimal) + - 0x00 + - 0x01 + - 0x91 + - 0xe0 + - 0x5b + - 0x2d + - 0x15 + - 0x00 # Max Timestamp (8 bytes, 0x00000191e05b2d15 in hex, 1726045957397 in decimal) + - 0x00 + - 0x01 + - 0x91 + - 0xe0 + - 0x5b + - 0x2d + - 0x15 + - 0xff # Producer ID (8 bytes, 0xffffffffffffffff in hex, -1 in decimal) + - 0xff + - 0xff + - 0xff + - 0xff + - 0xff + - 0xff + - 0xff + - 0xff # Producer Epoch (2 bytes, 0xffff in hex, -1 in decimal) + - 0xff + - 0xff # Base Sequence (4 bytes, 0xffffffff in hex, -1 in decimal) + - 0xff + - 0xff + - 0xff + - 0x00 # Records Length (4 bytes, 0x02 in hex, 2 in decimal) + - 0x00 + - 0x00 + - 0x03 + + # Record[0] + - 0x3c # Record Length (1 byte, 0x3c in hex, 30 in decimal (as signed varint)) (Length from attributes to the end of the record) + - 0x00 # Attributes (1 byte, 0x00 in hex, 0 in decimal) + - 0x00 # Timestamp Delta (1 byte, 0x00 in hex, 0 in decimal) + - 0x00 # Offset Delta (1 byte, 0x00 in hex, 0 in decimal) + - 0x01 # Key Length (1 byte, 0x01 in hex, -1 in decimal (as signed varint, using zigzag encoding, refer to: https://protobuf.dev/programming-guides/encoding/#signed-ints)) + # As key length is -1, the key value is empty + - 0x30 # Value Length (1 byte, 0x30 in hex, 24 in decimal (as signed varint)) + # Payload: Topic Record + - 0x01 # Frame Version (1 byte, 0x01 in hex, 1 in decimal) + - 0x02 # Type (1 byte, 0x02 in hex, 2 in decimal) + - 0x00 # Version (1 byte, 0x00 in hex, 0 in decimal) + - 0x04 # Name Length (1 byte, 0x04 in hex, 4 in decimal (as unsigned varint)) + - 0x73 # Topic Name (Compact String (Length = 4 - 1), parsed as "saz") + - 0x61 + - 0x7a + - 0x00 # Topic UUID (16 raw bytes, 00000000-0000-4000-8000-000000000091 after parsing) + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x40 + - 0x00 + - 0x80 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x91 + - 0x00 # Tagged Field Count (1 byte, 0x00 in hex, 0 in decimal) (unsigned varint) + + # Record[1] + - 0x90 # Record Length (1 byte, 0x9001 in hex, 72 in decimal (as signed varint)) (Length from attributes to the end of the record) + - 0x01 + - 0x00 # Attributes (1 byte, 0x00 in hex, 0 in decimal) + - 0x00 # Timestamp Delta (1 byte, 0x00 in hex, 0 in decimal) + - 0x02 # Offset Delta (1 byte, 0x02 in hex, 1 in decimal (as signed varint)) + - 0x01 # Key Length (1 byte, 0x01 in hex, -1 in decimal (as signed varint, using zigzag encoding, refer to: https://protobuf.dev/programming-guides/encoding/#signed-ints)) + # As key length is -1, the key value is empty + - 0x82 # Value Length (2 bytes, 0x8201 in hex, 65 in decimal (as signed varint)) + - 0x01 + # Payload: Partition Record + - 0x01 # Frame Version (1 byte, 0x01 in hex, 1 in decimal) + - 0x03 # Type (1 byte, 0x03 in hex, 3 in decimal) + - 0x01 # Version (1 byte, 0x01 in hex, 1 in decimal) + - 0x00 # Partition ID (4 bytes, 0x01 in hex, 1 in decimal) + - 0x00 + - 0x00 + - 0x01 + - 0x00 # Topic UUID (16 raw bytes, 00000000-0000-4000-8000-000000000091 after parsing) + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x40 + - 0x00 + - 0x80 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x91 + - 0x02 # Length of Replica array (1 byte, 0x02 in hex, 2 in decimal) + - 0x00 # Replica array (1 element, length = (2-1), each element is 4 bytes) + - 0x00 + - 0x00 + - 0x01 + - 0x02 # Length of In Sync Replica array (1 byte, 0x02 in hex, 2 in decimal) + - 0x00 # In Sync Replica array (1 element, length = (2-1), each element is 4 bytes) + - 0x00 + - 0x00 + - 0x01 + - 0x01 # Length of Removing Replicas array (1 byte, 0x01 in hex, 1 in decimal, actual length = (1 - 1 = 0)) + - 0x01 # Length of Adding Replicas array (1 byte, 0x01 in hex, 1 in decimal, actual length = (1 - 1 = 0)) + - 0x00 # Leader (4 bytes, 0x01 in hex, 1 in decimal) + - 0x00 + - 0x00 + - 0x01 + - 0x00 # Leader Epoch (4 bytes, 0x00 in hex, 0 in decimal) + - 0x00 + - 0x00 + - 0x00 + - 0x00 # Partition Epoch (4 bytes, 0x00 in hex, 0 in decimal) + - 0x00 + - 0x00 + - 0x00 + - 0x02 # Compact Array Length (1 byte, 0x02 in hex, 1 in decimal (parsed as an unsigned varint)) + - 0x10 # Directory UUID (16 raw bytes, 10000000-0000-4000-8000-000000000001 after parsing) + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x40 + - 0x00 + - 0x80 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x01 + - 0x00 # Tagged Field Count (1 byte, 0x00 in hex, 0 in decimal) (unsigned varint) + + # Record[2] + - 0x90 # Record Length (1 byte, 0x9001 in hex, 72 in decimal (as signed varint)) (Length from attributes to the end of the record) + - 0x01 + - 0x00 # Attributes (1 byte, 0x00 in hex, 0 in decimal) + - 0x00 # Timestamp Delta (1 byte, 0x00 in hex, 0 in decimal) + - 0x04 # Offset Delta (1 byte, 0x04 in hex, 2 in decimal (as signed varint)) + - 0x01 # Key Length (1 byte, 0x01 in hex, -1 in decimal (as signed varint, using zigzag encoding, refer to: https://protobuf.dev/programming-guides/encoding/#signed-ints)) + # As key length is -1, the key value is empty + - 0x82 # Value Length (2 bytes, 0x8201 in hex, 65 in decimal (as signed varint)) + - 0x01 + + # Payload: Partition Record + - 0x01 # Frame Version (1 byte, 0x01 in hex, 1 in decimal) + - 0x03 # Type (1 byte, 0x03 in hex, 3 in decimal) + - 0x01 # Version (1 byte, 0x01 in hex, 1 in decimal) + - 0x00 # Partition ID (4 bytes, 0x00 in hex, 0 in decimal) + - 0x00 + - 0x00 + - 0x00 + - 0x00 # Topic UUID (16 raw bytes, 00000000-0000-4000-8000-000000000091 after parsing) + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x40 + - 0x00 + - 0x80 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x91 + - 0x02 # Length of Replica array (1 byte, 0x02 in hex, 2 in decimal) + - 0x00 # Replica array (1 element, length = (2-1), each element is 4 bytes) + - 0x00 + - 0x00 + - 0x01 + - 0x02 # Length of In Sync Replica array (1 byte, 0x02 in hex, 2 in decimal) + - 0x00 # In Sync Replica array (1 element, length = (2-1), each element is 4 bytes) + - 0x00 + - 0x00 + - 0x01 + - 0x01 # Length of Removing Replicas array (1 byte, 0x01 in hex, 1 in decimal, actual length = (1 - 1 = 0)) + - 0x01 # Length of Adding Replicas array (1 byte, 0x01 in hex, 1 in decimal, actual length = (1 - 1 = 0)) + - 0x00 # Leader (4 bytes, 0x01 in hex, 1 in decimal) + - 0x00 + - 0x00 + - 0x01 + - 0x00 # Leader Epoch (4 bytes, 0x00 in hex, 0 in decimal) + - 0x00 + - 0x00 + - 0x00 + - 0x00 # Partition Epoch (4 bytes, 0x00 in hex, 0 in decimal) + - 0x00 + - 0x00 + - 0x00 + - 0x02 # Compact Array Length (1 byte, 0x02 in hex, 1 in decimal (parsed as an unsigned varint)) + - 0x10 # Directory UUID (16 raw bytes, 10000000-0000-4000-8000-000000000001 after parsing) + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x40 + - 0x00 + - 0x80 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x00 + - 0x01 + - 0x00 # Number of Headers (1 byte, 0x00 in hex, 0 in decimal) + // ToDo Do paylaods have headers or tagged fields ? \ No newline at end of file diff --git a/protocol/serializer/cluster_metadata_binspec.go b/protocol/serializer/cluster_metadata_binspec.go new file mode 100644 index 0000000..500ae3b --- /dev/null +++ b/protocol/serializer/cluster_metadata_binspec.go @@ -0,0 +1,142 @@ +package serializer + +import ( + "fmt" + "os" + + kafkaapi "github.com/codecrafters-io/kafka-tester/protocol/api" + kafkaencoder "github.com/codecrafters-io/kafka-tester/protocol/encoder" + "github.com/codecrafters-io/tester-utils/logger" +) + +func writeClusterMetadataBinSpec(path string, directoryUUID string, logger *logger.Logger) error { + encoder := kafkaencoder.RealEncoder{} + encoder.Init(make([]byte, 40960)) + + topic3Name := "saz" + topic3UUID := "00000000-0000-4000-8000-000000000091" + + featureLevelRecord := kafkaapi.ClusterMetadataPayload{ + FrameVersion: 1, + Type: 12, + Version: 0, + Data: &kafkaapi.FeatureLevelRecord{ + Name: "metadata.version", + FeatureLevel: 20, + }, + } + + topicRecord3 := kafkaapi.ClusterMetadataPayload{ + FrameVersion: 1, + Type: 2, + Version: 0, + Data: &kafkaapi.TopicRecord{ + TopicName: topic3Name, + TopicUUID: topic3UUID, + }, + } + + partitionRecord3 := kafkaapi.ClusterMetadataPayload{ + FrameVersion: 1, + Type: 3, + Version: 1, + Data: &kafkaapi.PartitionRecord{ + PartitionID: 1, + TopicUUID: topic3UUID, + Replicas: []int32{1}, + ISReplicas: []int32{1}, + RemovingReplicas: []int32{}, + AddingReplicas: []int32{}, + Leader: 1, + LeaderEpoch: 0, + PartitionEpoch: 0, + Directories: []string{directoryUUID}, + }, + } + + partitionRecord4 := kafkaapi.ClusterMetadataPayload{ + FrameVersion: 1, + Type: 3, + Version: 1, + Data: &kafkaapi.PartitionRecord{ + PartitionID: 0, + TopicUUID: topic3UUID, + Replicas: []int32{1}, + ISReplicas: []int32{1}, + RemovingReplicas: []int32{}, + AddingReplicas: []int32{}, + Leader: 1, + LeaderEpoch: 0, + PartitionEpoch: 0, + Directories: []string{directoryUUID}, + }, + } + + recordBatch1 := kafkaapi.RecordBatch{ + BaseOffset: 1, + PartitionLeaderEpoch: 1, + Attributes: 0, + LastOffsetDelta: 3, + FirstTimestamp: 1726045943832, + MaxTimestamp: 1726045943832, + ProducerId: -1, + ProducerEpoch: -1, + BaseSequence: -1, + Records: []kafkaapi.Record{ + { + Attributes: 0, + TimestampDelta: 0, + Key: nil, + Value: GetEncodedBytes(featureLevelRecord), + Headers: []kafkaapi.RecordHeader{}, + }, + }, + } + + recordBatch4 := kafkaapi.RecordBatch{ + BaseOffset: int64(0 + 0), + PartitionLeaderEpoch: 1, + Attributes: 0, + LastOffsetDelta: 1, + FirstTimestamp: 1726045957397, + MaxTimestamp: 1726045957397, + ProducerId: -1, + ProducerEpoch: -1, + BaseSequence: -1, + Records: []kafkaapi.Record{ + { + Attributes: 0, + TimestampDelta: 0, + Key: nil, + Value: GetEncodedBytes(topicRecord3), + Headers: []kafkaapi.RecordHeader{}, + }, + { + Attributes: 0, + TimestampDelta: 0, + Key: nil, + Value: GetEncodedBytes(partitionRecord3), + Headers: []kafkaapi.RecordHeader{}, + }, + { + Attributes: 0, + TimestampDelta: 0, + Key: nil, + Value: GetEncodedBytes(partitionRecord4), + Headers: []kafkaapi.RecordHeader{}, + }, + }, + } + + recordBatch1.Encode(&encoder) + recordBatch4.Encode(&encoder) + encodedBytes := encoder.Bytes()[:encoder.Offset()] + + err := os.WriteFile(path, encodedBytes, 0644) + if err != nil { + return fmt.Errorf("error writing file to %s: %w", path, err) + } + + logger.Debugf(" - Wrote file to: %s", path) + return nil +} From 74846df1c224ef15e0b49f2d095693b8304e3fc7 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Fri, 4 Oct 2024 17:51:11 +0530 Subject: [PATCH 2/7] test: update cluster metadata payload tests --- internal/cluster_metadata_payload_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/cluster_metadata_payload_test.go b/internal/cluster_metadata_payload_test.go index 48eadba..a3ae15b 100644 --- a/internal/cluster_metadata_payload_test.go +++ b/internal/cluster_metadata_payload_test.go @@ -48,6 +48,8 @@ func TestDecodeFeatureLevelRecordPayload(t *testing.T) { assert.EqualValues(t, 0, featureLevelRecord.Version) payload, ok := featureLevelRecord.Data.(*kafkaapi.FeatureLevelRecord) + assert.EqualValues(t, "metadata.version", payload.Name) + assert.EqualValues(t, 20, payload.FeatureLevel) assert.True(t, ok) assert.EqualValues(t, "metadata.version", payload.Name) } @@ -94,7 +96,7 @@ func TestDecodeEndTransactionRecordPayload(t *testing.T) { } func TestDecodeTopicRecordPayload(t *testing.T) { - hexdump := "01020004666f6fbfd99e5e3235455281f8d4af1741970c00" + hexdump := "0102000473617a0000000000004000800000000000009100" b, err := hex.DecodeString(hexdump) if err != nil { @@ -111,12 +113,12 @@ func TestDecodeTopicRecordPayload(t *testing.T) { payload, ok := topicRecord.Data.(*kafkaapi.TopicRecord) assert.True(t, ok) - assert.EqualValues(t, "foo", payload.TopicName) - assert.EqualValues(t, "bfd99e5e-3235-4552-81f8-d4af1741970c", payload.TopicUUID) + assert.EqualValues(t, "saz", payload.TopicName) + assert.EqualValues(t, "00000000-0000-4000-8000-000000000091", payload.TopicUUID) } func TestDecodePartitionRecordPayload(t *testing.T) { - hexdump := "01030100000000bfd99e5e3235455281f8d4af1741970c020000000102000000010101000000010000000000000000020224973cbadd44cf874445a99619da3400" + hexdump := "0103010000000000000000000040008000000000000091020000000102000000010101000000010000000000000000021000000000004000800000000000000100" b, err := hex.DecodeString(hexdump) if err != nil { @@ -134,7 +136,7 @@ func TestDecodePartitionRecordPayload(t *testing.T) { payload, ok := partitionRecord.Data.(*kafkaapi.PartitionRecord) assert.True(t, ok) assert.EqualValues(t, 0, payload.PartitionID) - assert.EqualValues(t, "bfd99e5e-3235-4552-81f8-d4af1741970c", payload.TopicUUID) + assert.EqualValues(t, "00000000-0000-4000-8000-000000000091", payload.TopicUUID) assert.EqualValues(t, []int32{1}, payload.Replicas) assert.EqualValues(t, []int32{1}, payload.ISReplicas) assert.EqualValues(t, []int32{}, payload.RemovingReplicas) @@ -142,7 +144,7 @@ func TestDecodePartitionRecordPayload(t *testing.T) { assert.EqualValues(t, 1, payload.Leader) assert.EqualValues(t, 0, payload.LeaderEpoch) assert.EqualValues(t, 0, payload.PartitionEpoch) - assert.EqualValues(t, []string{"0224973c-badd-44cf-8744-45a99619da34"}, payload.Directories) + assert.EqualValues(t, []string{"10000000-0000-4000-8000-000000000001"}, payload.Directories) } func TestEncodeBeginTransactionRecordPayload(t *testing.T) { From d07c86ffebea95a64297a67a8a4dacce87bcd29a Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Fri, 4 Oct 2024 17:51:41 +0530 Subject: [PATCH 3/7] feat: add randomized unknown topic names --- internal/stagep2.go | 3 ++- protocol/common/constants.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/stagep2.go b/internal/stagep2.go index e0f2595..5af15b3 100644 --- a/internal/stagep2.go +++ b/internal/stagep2.go @@ -42,7 +42,7 @@ func testDTPartitionWithUnknownTopic(stageHarness *test_case_harness.TestCaseHar Body: kafkaapi.DescribeTopicPartitionsRequestBody{ Topics: []kafkaapi.TopicName{ { - Name: "unknown-topic", + Name: common.TOPIC_UNKOWN_NAME, }, }, ResponsePartitionLimit: 1, @@ -56,6 +56,7 @@ func testDTPartitionWithUnknownTopic(stageHarness *test_case_harness.TestCaseHar if err != nil { return err } + // ToDo: log inside sendAndReceive, else in failure cases, we won't log any logger.Debugf("Hexdump of sent \"DescribeTopicPartitions\" request: \n%v\n", GetFormattedHexdump(message)) logger.Debugf("Hexdump of received \"DescribeTopicPartitions\" response: \n%v\n", GetFormattedHexdump(response)) diff --git a/protocol/common/constants.go b/protocol/common/constants.go index 1ef0b04..c15ee0a 100644 --- a/protocol/common/constants.go +++ b/protocol/common/constants.go @@ -21,7 +21,7 @@ const ( var ( all_topic_names = []string{"foo", "bar", "baz", "qux", "quz", "pax", "paz", "saz"} - topic_names = GetSortedValues(random.RandomElementsFromArray(all_topic_names, 3)) + topic_names = GetSortedValues(random.RandomElementsFromArray(all_topic_names, 4)) TOPIC1_NAME = topic_names[0] TOPIC2_NAME = topic_names[1] TOPIC3_NAME = topic_names[2] @@ -30,7 +30,7 @@ var ( TOPIC3_UUID = fmt.Sprintf("00000000-0000-4000-8000-0000000000%02d", random.RandomInt(10, 99)) TOPICX_UUID = fmt.Sprintf("00000000-0000-0000-0000-00000000%04d", random.RandomInt(1000, 9999)) // Unknown topic used in requests - TOPIC_UNKOWN_NAME = "unknown-topic" + TOPIC_UNKOWN_NAME = fmt.Sprintf("unknown-topic-%s", topic_names[3]) TOPIC_UNKOWN_UUID = "00000000-0000-0000-0000-000000000000" all_messages = []string{"Hello World!", "Hello Earth!", "Hello Reverse Engineering!", "Hello Universe!", "Hello Kafka!", "Hello CodeCrafters!"} From 7f7e3a7087144f8ff360fdc772e2a0ed3a4e7bab Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Fri, 4 Oct 2024 17:52:37 +0530 Subject: [PATCH 4/7] refactor: update values in our serializer for custer metadata --- .../serializer/cluster_metadata_binspec.go | 41 +++++++++++++++++-- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/protocol/serializer/cluster_metadata_binspec.go b/protocol/serializer/cluster_metadata_binspec.go index 500ae3b..5c42528 100644 --- a/protocol/serializer/cluster_metadata_binspec.go +++ b/protocol/serializer/cluster_metadata_binspec.go @@ -5,6 +5,7 @@ import ( "os" kafkaapi "github.com/codecrafters-io/kafka-tester/protocol/api" + "github.com/codecrafters-io/kafka-tester/protocol/common" kafkaencoder "github.com/codecrafters-io/kafka-tester/protocol/encoder" "github.com/codecrafters-io/tester-utils/logger" ) @@ -41,7 +42,7 @@ func writeClusterMetadataBinSpec(path string, directoryUUID string, logger *logg Type: 3, Version: 1, Data: &kafkaapi.PartitionRecord{ - PartitionID: 1, + PartitionID: 0, TopicUUID: topic3UUID, Replicas: []int32{1}, ISReplicas: []int32{1}, @@ -59,7 +60,7 @@ func writeClusterMetadataBinSpec(path string, directoryUUID string, logger *logg Type: 3, Version: 1, Data: &kafkaapi.PartitionRecord{ - PartitionID: 0, + PartitionID: 1, TopicUUID: topic3UUID, Replicas: []int32{1}, ISReplicas: []int32{1}, @@ -76,7 +77,7 @@ func writeClusterMetadataBinSpec(path string, directoryUUID string, logger *logg BaseOffset: 1, PartitionLeaderEpoch: 1, Attributes: 0, - LastOffsetDelta: 3, + LastOffsetDelta: 0, // len(records) - 1 FirstTimestamp: 1726045943832, MaxTimestamp: 1726045943832, ProducerId: -1, @@ -97,7 +98,7 @@ func writeClusterMetadataBinSpec(path string, directoryUUID string, logger *logg BaseOffset: int64(0 + 0), PartitionLeaderEpoch: 1, Attributes: 0, - LastOffsetDelta: 1, + LastOffsetDelta: 2, // ToDo len(records) - 1 FirstTimestamp: 1726045957397, MaxTimestamp: 1726045957397, ProducerId: -1, @@ -140,3 +141,35 @@ func writeClusterMetadataBinSpec(path string, directoryUUID string, logger *logg logger.Debugf(" - Wrote file to: %s", path) return nil } + +func GenerateClusterMetadataBinSpec(logger *logger.Logger) error { + directoryUUID := common.DIRECTORY_UUID + + basePath := common.LOG_DIR + + err := os.RemoveAll(basePath) + if err != nil { + return fmt.Errorf("could not remove log directory at %s: %w", basePath, err) + } + + clusterMetadataDirectory := fmt.Sprintf("%s/__cluster_metadata-0", basePath) + clusterMetadataDataFilePath := fmt.Sprintf("%s/00000000000000000000.log", clusterMetadataDirectory) + + err = generateDirectories([]string{clusterMetadataDirectory}) + if err != nil { + return fmt.Errorf("could not generate directories: %w", err) + } + + logger.UpdateSecondaryPrefix("Serializer") + logger.Debugf("Writing log files to: %s", basePath) + + err = writeClusterMetadataBinSpec(clusterMetadataDataFilePath, directoryUUID, logger) + if err != nil { + return err + } + + logger.Infof("Finished writing log files to: %s", basePath) + logger.ResetSecondaryPrefix() + + return nil +} From 48f43aa3a09995aab562c21f80e6becd1339f884 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Fri, 4 Oct 2024 18:07:53 +0530 Subject: [PATCH 5/7] refactor: update apiVersionAssertion success logs --- internal/assertions/apiversions_response_assertion.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/assertions/apiversions_response_assertion.go b/internal/assertions/apiversions_response_assertion.go index a7b3954..fe51fab 100644 --- a/internal/assertions/apiversions_response_assertion.go +++ b/internal/assertions/apiversions_response_assertion.go @@ -53,20 +53,20 @@ func (a ApiVersionsResponseAssertion) Evaluate(fields []string, AssertApiVersion for _, actualApiVersionKey := range a.ActualValue.ApiKeys { if actualApiVersionKey.ApiKey == expectedApiVersionKey.ApiKey { found = true - if actualApiVersionKey.MaxVersion < expectedApiVersionKey.MinVersion { - return fmt.Errorf("Expected max version %v to be >= min version %v for %s", actualApiVersionKey.MaxVersion, actualApiVersionKey.MinVersion, apiKeyNames[expectedApiVersionKey.ApiKey]) + if actualApiVersionKey.MinVersion > expectedApiVersionKey.MaxVersion { + return fmt.Errorf("Expected min version %v to be < max version %v for %s", actualApiVersionKey.MinVersion, expectedApiVersionKey.MaxVersion, apiKeyNames[expectedApiVersionKey.ApiKey]) } // anything above or equal to expected minVersion is fine if actualApiVersionKey.MinVersion < expectedApiVersionKey.MinVersion { return fmt.Errorf("Expected API version %v to be supported for %s, got %v", expectedApiVersionKey.MaxVersion, apiKeyNames[expectedApiVersionKey.ApiKey], actualApiVersionKey.MaxVersion) } - logger.Successf("✓ API version %v is supported for %s", actualApiVersionKey.MaxVersion, apiKeyNames[expectedApiVersionKey.ApiKey]) + logger.Successf("✓ MinVersion for %s is <= %v & >= %v", apiKeyNames[expectedApiVersionKey.ApiKey], expectedApiVersionKey.MaxVersion, expectedApiVersionKey.MinVersion) if actualApiVersionKey.MaxVersion < expectedApiVersionKey.MaxVersion { return fmt.Errorf("Expected API version %v to be supported for %s, got %v", expectedApiVersionKey.MaxVersion, apiKeyNames[expectedApiVersionKey.ApiKey], actualApiVersionKey.MaxVersion) } - logger.Successf("✓ API version %v is supported for %s", actualApiVersionKey.MinVersion, apiKeyNames[expectedApiVersionKey.ApiKey]) + logger.Successf("✓ MaxVersion for %s is >= %v", apiKeyNames[expectedApiVersionKey.ApiKey], expectedApiVersionKey.MaxVersion) } } if !found { From 25082ada7e9a98be71f36638959f1c5f263ab4c0 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Fri, 4 Oct 2024 18:08:48 +0530 Subject: [PATCH 6/7] refactor: update regex pattern for topic name validation --- internal/stages_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/stages_test.go b/internal/stages_test.go index 411fbef..d83e556 100644 --- a/internal/stages_test.go +++ b/internal/stages_test.go @@ -65,7 +65,7 @@ func normalizeTesterOutput(testerOutput []byte) []byte { "topic_name": {regexp.MustCompile(`- .topic_name \([A-Za-z0-9 ]{1,}\)`)}, "next_cursor": {regexp.MustCompile(`- .next_cursor \(\{[A-Za-z0-9 ]{1,}\}\)`)}, "Messages": {regexp.MustCompile(`✓ Messages: \["[A-Za-z !]{1,}"\]`)}, - "Topic Name": {regexp.MustCompile(`✓ TopicResponse\[[0-9]{1,}\] Topic Name: [A-Za-z]{3}`)}, + "Topic Name": {regexp.MustCompile(`✓ TopicResponse\[[0-9]{1,}\] Topic Name: [A-Za-z]{3,}`)}, "Topic UUID": {regexp.MustCompile(`✓ TopicResponse\[[0-9]{1,}\] Topic UUID: [0-9 -]{1,}`)}, } From 7b4d5cfb073e8edba1c9d66f3d5ce1d65ebf06f7 Mon Sep 17 00:00:00 2001 From: Ryan Gang Date: Fri, 4 Oct 2024 18:30:19 +0530 Subject: [PATCH 7/7] test: add fixtures --- .../fixtures/describe_topic_partitions/pass | 134 +++++++++--------- internal/test_helpers/fixtures/fetch/pass | 102 ++++++------- 2 files changed, 118 insertions(+), 118 deletions(-) diff --git a/internal/test_helpers/fixtures/describe_topic_partitions/pass b/internal/test_helpers/fixtures/describe_topic_partitions/pass index 5544df3..a08c911 100644 --- a/internal/test_helpers/fixtures/describe_topic_partitions/pass +++ b/internal/test_helpers/fixtures/describe_topic_partitions/pass @@ -365,10 +365,10 @@ Debug = true [stage-5] ✓ Correlation ID: 177586623 [stage-5] ✓ Error code: 0 (NO_ERROR) [stage-5] ✓ API keys array length: 61 -[stage-5] ✓ API version 4 is supported for API_VERSIONS -[stage-5] ✓ API version 0 is supported for API_VERSIONS -[stage-5] ✓ API version 0 is supported for DESCRIBE_TOPIC_PARTITIONS -[stage-5] ✓ API version 0 is supported for DESCRIBE_TOPIC_PARTITIONS +[stage-5] ✓ MinVersion for API_VERSIONS is <= 4 & >= 0 +[stage-5] ✓ MaxVersion for API_VERSIONS is >= 4 +[stage-5] ✓ MinVersion for DESCRIBE_TOPIC_PARTITIONS is <= 0 & >= 0 +[stage-5] ✓ MaxVersion for DESCRIBE_TOPIC_PARTITIONS is >= 0 [stage-5] Test passed. [stage-5] Terminating program [stage-5] Program terminated successfully @@ -381,18 +381,18 @@ Debug = true [stage-4] Hexdump of sent "DescribeTopicPartitions" request:  [stage-4] Idx | Hex | ASCII [stage-4] -----+-------------------------------------------------+----------------- -[stage-4] 0000 | 00 00 00 2d 00 4b 00 00 60 5a 05 cd 00 0c 6b 61 | ...-.K..`Z....ka -[stage-4] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 02 0e 75 6e 6b | fka-tester...unk -[stage-4] 0020 | 6e 6f 77 6e 2d 74 6f 70 69 63 00 00 00 00 01 ff | nown-topic...... -[stage-4] 0030 | 00 | . +[stage-4] 0000 | 00 00 00 31 00 4b 00 00 60 5a 05 cd 00 0c 6b 61 | ...1.K..`Z....ka +[stage-4] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 02 12 75 6e 6b | fka-tester...unk +[stage-4] 0020 | 6e 6f 77 6e 2d 74 6f 70 69 63 2d 73 61 7a 00 00 | nown-topic-saz.. +[stage-4] 0030 | 00 00 01 ff 00 | ..... [stage-4]  [stage-4] Hexdump of received "DescribeTopicPartitions" response:  [stage-4] Idx | Hex | ASCII [stage-4] -----+-------------------------------------------------+----------------- -[stage-4] 0000 | 60 5a 05 cd 00 00 00 00 00 02 00 03 0e 75 6e 6b | `Z...........unk -[stage-4] 0010 | 6e 6f 77 6e 2d 74 6f 70 69 63 00 00 00 00 00 00 | nown-topic...... -[stage-4] 0020 | 00 00 00 00 00 00 00 00 00 00 00 01 00 00 0d f8 | ................ -[stage-4] 0030 | 00 ff 00 | ... +[stage-4] 0000 | 60 5a 05 cd 00 00 00 00 00 02 00 03 12 75 6e 6b | `Z...........unk +[stage-4] 0010 | 6e 6f 77 6e 2d 74 6f 70 69 63 2d 73 61 7a 00 00 | nown-topic-saz.. +[stage-4] 0020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 | ................ +[stage-4] 0030 | 00 00 0d f8 00 ff 00 | ....... [stage-4]  [stage-4] [Decoder] - .ResponseHeader [stage-4] [Decoder]  - .correlation_id (1616512461) @@ -402,7 +402,7 @@ Debug = true [stage-4] [Decoder]  - .topic.length (1) [stage-4] [Decoder]  - .Topics[0] [stage-4] [Decoder]  - .error_code (3) -[stage-4] [Decoder]  - .name (unknown-topic) +[stage-4] [Decoder]  - .name (unknown-topic-saz) [stage-4] [Decoder]  - .topic_id (00000000-0000-0000-0000-000000000000) [stage-4] [Decoder]  - .is_internal (false) [stage-4] [Decoder]  - .num_partitions (0) @@ -413,7 +413,7 @@ Debug = true [stage-4] ✓ Correlation ID: 1616512461 [stage-4] ✓ Throttle Time: 0 [stage-4]  ✓ TopicResponse[0] Error code: 3 -[stage-4]  ✓ TopicResponse[0] Topic Name: unknown-topic +[stage-4]  ✓ TopicResponse[0] Topic Name: unknown-topic-saz [stage-4]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-0000-0000-000000000000 [stage-4] Test passed. [stage-4] Terminating program @@ -425,15 +425,15 @@ Debug = true [stage-3] [Serializer]  - Wrote file to: /tmp/server.properties [stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/meta.properties [stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/.kafka_cleanshutdown -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/partition.metadata +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/partition.metadata +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/partition.metadata [stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/partition.metadata -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-0/partition.metadata -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-1/partition.metadata +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/partition.metadata [stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/partition.metadata -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/00000000000000000000.log +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/00000000000000000000.log +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/00000000000000000000.log [stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/00000000000000000000.log -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-0/00000000000000000000.log -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-1/00000000000000000000.log +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/00000000000000000000.log [stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000.log [stage-3] [Serializer] Finished writing log files to: /tmp/kraft-combined-logs [stage-3] Connecting to broker at: localhost:9092 @@ -443,14 +443,14 @@ Debug = true [stage-3] Idx | Hex | ASCII [stage-3] -----+-------------------------------------------------+----------------- [stage-3] 0000 | 00 00 00 23 00 4b 00 00 05 c3 b0 2a 00 0c 6b 61 | ...#.K.....*..ka -[stage-3] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 02 04 62 61 72 | fka-tester...bar +[stage-3] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 02 04 70 61 78 | fka-tester...pax [stage-3] 0020 | 00 00 00 00 01 ff 00 | ....... [stage-3]  [stage-3] Hexdump of received "DescribeTopicPartitions" response:  [stage-3] Idx | Hex | ASCII [stage-3] -----+-------------------------------------------------+----------------- -[stage-3] 0000 | 05 c3 b0 2a 00 00 00 00 00 02 00 00 04 62 61 72 | ...*.........bar -[stage-3] 0010 | 00 00 00 00 00 00 40 00 80 00 00 00 00 00 00 87 | ......@......... +[stage-3] 0000 | 05 c3 b0 2a 00 00 00 00 00 02 00 00 04 70 61 78 | ...*.........pax +[stage-3] 0010 | 00 00 00 00 00 00 40 00 80 00 00 00 00 00 00 45 | ......@........E [stage-3] 0020 | 00 02 00 00 00 00 00 00 00 00 00 01 00 00 00 00 | ................ [stage-3] 0030 | 02 00 00 00 01 02 00 00 00 01 01 01 01 00 00 00 | ................ [stage-3] 0040 | 0d f8 00 ff 00 | ..... @@ -463,8 +463,8 @@ Debug = true [stage-3] [Decoder]  - .topic.length (1) [stage-3] [Decoder]  - .Topics[0] [stage-3] [Decoder]  - .error_code (0) -[stage-3] [Decoder]  - .name (bar) -[stage-3] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000087) +[stage-3] [Decoder]  - .name (pax) +[stage-3] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000045) [stage-3] [Decoder]  - .is_internal (false) [stage-3] [Decoder]  - .num_partitions (1) [stage-3] [Decoder]  - .Partitions[0] @@ -485,8 +485,8 @@ Debug = true [stage-3] ✓ Correlation ID: 96710698 [stage-3] ✓ Throttle Time: 0 [stage-3]  ✓ TopicResponse[0] Error code: 0 -[stage-3]  ✓ TopicResponse[0] Topic Name: bar -[stage-3]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-4000-8000-000000000087 +[stage-3]  ✓ TopicResponse[0] Topic Name: pax +[stage-3]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-4000-8000-000000000045 [stage-3] Test passed. [stage-3] Terminating program [stage-3] Program terminated successfully @@ -497,15 +497,15 @@ Debug = true [stage-2] [Serializer]  - Wrote file to: /tmp/server.properties [stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/meta.properties [stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/.kafka_cleanshutdown -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/partition.metadata +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/partition.metadata +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/partition.metadata [stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/partition.metadata -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-0/partition.metadata -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-1/partition.metadata +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/partition.metadata [stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/partition.metadata -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/00000000000000000000.log +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/00000000000000000000.log +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/00000000000000000000.log [stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/00000000000000000000.log -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-0/00000000000000000000.log -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-1/00000000000000000000.log +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/00000000000000000000.log [stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000.log [stage-2] [Serializer] Finished writing log files to: /tmp/kraft-combined-logs [stage-2] Connecting to broker at: localhost:9092 @@ -515,14 +515,14 @@ Debug = true [stage-2] Idx | Hex | ASCII [stage-2] -----+-------------------------------------------------+----------------- [stage-2] 0000 | 00 00 00 23 00 4b 00 00 0f 2e 14 fa 00 0c 6b 61 | ...#.K........ka -[stage-2] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 02 04 73 61 7a | fka-tester...saz +[stage-2] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 02 04 71 75 7a | fka-tester...quz [stage-2] 0020 | 00 00 00 00 02 ff 00 | ....... [stage-2]  [stage-2] Hexdump of received "DescribeTopicPartitions" response:  [stage-2] Idx | Hex | ASCII [stage-2] -----+-------------------------------------------------+----------------- -[stage-2] 0000 | 0f 2e 14 fa 00 00 00 00 00 02 00 00 04 73 61 7a | .............saz -[stage-2] 0010 | 00 00 00 00 00 00 40 00 80 00 00 00 00 00 00 58 | ......@........X +[stage-2] 0000 | 0f 2e 14 fa 00 00 00 00 00 02 00 00 04 71 75 7a | .............quz +[stage-2] 0010 | 00 00 00 00 00 00 40 00 80 00 00 00 00 00 00 11 | ......@......... [stage-2] 0020 | 00 03 00 00 00 00 00 00 00 00 00 01 00 00 00 00 | ................ [stage-2] 0030 | 02 00 00 00 01 02 00 00 00 01 01 01 01 00 00 00 | ................ [stage-2] 0040 | 00 00 00 01 00 00 00 01 00 00 00 00 02 00 00 00 | ................ @@ -537,8 +537,8 @@ Debug = true [stage-2] [Decoder]  - .topic.length (1) [stage-2] [Decoder]  - .Topics[0] [stage-2] [Decoder]  - .error_code (0) -[stage-2] [Decoder]  - .name (saz) -[stage-2] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000058) +[stage-2] [Decoder]  - .name (quz) +[stage-2] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000011) [stage-2] [Decoder]  - .is_internal (false) [stage-2] [Decoder]  - .num_partitions (2) [stage-2] [Decoder]  - .Partitions[0] @@ -570,8 +570,8 @@ Debug = true [stage-2] ✓ Correlation ID: 254678266 [stage-2] ✓ Throttle Time: 0 [stage-2]  ✓ TopicResponse[0] Error code: 0 -[stage-2]  ✓ TopicResponse[0] Topic Name: saz -[stage-2]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-4000-8000-000000000058 +[stage-2]  ✓ TopicResponse[0] Topic Name: quz +[stage-2]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-4000-8000-000000000011 [stage-2]  ✓ PartitionResponse[0] Error code: 0 [stage-2]  ✓ PartitionResponse[0] Partition Index: 0 [stage-2]  ✓ PartitionResponse[1] Error code: 0 @@ -586,15 +586,15 @@ Debug = true [stage-1] [Serializer]  - Wrote file to: /tmp/server.properties [stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/meta.properties [stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/.kafka_cleanshutdown -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/partition.metadata +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/partition.metadata +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/partition.metadata [stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/partition.metadata -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-0/partition.metadata -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-1/partition.metadata +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/partition.metadata [stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/partition.metadata -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/00000000000000000000.log +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/00000000000000000000.log +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/00000000000000000000.log [stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/00000000000000000000.log -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-0/00000000000000000000.log -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/saz-1/00000000000000000000.log +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/00000000000000000000.log [stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000.log [stage-1] [Serializer] Finished writing log files to: /tmp/kraft-combined-logs [stage-1] Connecting to broker at: localhost:9092 @@ -604,23 +604,23 @@ Debug = true [stage-1] Idx | Hex | ASCII [stage-1] -----+-------------------------------------------------+----------------- [stage-1] 0000 | 00 00 00 2d 00 4b 00 00 70 d8 81 15 00 0c 6b 61 | ...-.K..p.....ka -[stage-1] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 04 04 62 61 72 | fka-tester...bar -[stage-1] 0020 | 00 04 71 75 7a 00 04 73 61 7a 00 00 00 00 04 ff | ..quz..saz...... +[stage-1] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 04 04 70 61 78 | fka-tester...pax +[stage-1] 0020 | 00 04 70 61 7a 00 04 71 75 7a 00 00 00 00 04 ff | ..paz..quz...... [stage-1] 0030 | 00 | . [stage-1]  [stage-1] Hexdump of received "DescribeTopicPartitions" response:  [stage-1] Idx | Hex | ASCII [stage-1] -----+-------------------------------------------------+----------------- -[stage-1] 0000 | 70 d8 81 15 00 00 00 00 00 04 00 00 04 62 61 72 | p............bar -[stage-1] 0010 | 00 00 00 00 00 00 40 00 80 00 00 00 00 00 00 87 | ......@......... +[stage-1] 0000 | 70 d8 81 15 00 00 00 00 00 04 00 00 04 70 61 78 | p............pax +[stage-1] 0010 | 00 00 00 00 00 00 40 00 80 00 00 00 00 00 00 45 | ......@........E [stage-1] 0020 | 00 02 00 00 00 00 00 00 00 00 00 01 00 00 00 00 | ................ [stage-1] 0030 | 02 00 00 00 01 02 00 00 00 01 01 01 01 00 00 00 | ................ -[stage-1] 0040 | 0d f8 00 00 00 04 71 75 7a 00 00 00 00 00 00 40 | ......quz......@ -[stage-1] 0050 | 00 80 00 00 00 00 00 00 54 00 02 00 00 00 00 00 | ........T....... +[stage-1] 0040 | 0d f8 00 00 00 04 70 61 7a 00 00 00 00 00 00 40 | ......paz......@ +[stage-1] 0050 | 00 80 00 00 00 00 00 00 58 00 02 00 00 00 00 00 | ........X....... [stage-1] 0060 | 00 00 00 00 01 00 00 00 00 02 00 00 00 01 02 00 | ................ -[stage-1] 0070 | 00 00 01 01 01 01 00 00 00 0d f8 00 00 00 04 73 | ...............s -[stage-1] 0080 | 61 7a 00 00 00 00 00 00 40 00 80 00 00 00 00 00 | az......@....... -[stage-1] 0090 | 00 58 00 03 00 00 00 00 00 00 00 00 00 01 00 00 | .X.............. +[stage-1] 0070 | 00 00 01 01 01 01 00 00 00 0d f8 00 00 00 04 71 | ...............q +[stage-1] 0080 | 75 7a 00 00 00 00 00 00 40 00 80 00 00 00 00 00 | uz......@....... +[stage-1] 0090 | 00 11 00 03 00 00 00 00 00 00 00 00 00 01 00 00 | ................ [stage-1] 00a0 | 00 00 02 00 00 00 01 02 00 00 00 01 01 01 01 00 | ................ [stage-1] 00b0 | 00 00 00 00 00 01 00 00 00 01 00 00 00 00 02 00 | ................ [stage-1] 00c0 | 00 00 01 02 00 00 00 01 01 01 01 00 00 00 0d f8 | ................ @@ -634,8 +634,8 @@ Debug = true [stage-1] [Decoder]  - .topic.length (3) [stage-1] [Decoder]  - .Topics[0] [stage-1] [Decoder]  - .error_code (0) -[stage-1] [Decoder]  - .name (bar) -[stage-1] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000087) +[stage-1] [Decoder]  - .name (pax) +[stage-1] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000045) [stage-1] [Decoder]  - .is_internal (false) [stage-1] [Decoder]  - .num_partitions (1) [stage-1] [Decoder]  - .Partitions[0] @@ -653,8 +653,8 @@ Debug = true [stage-1] [Decoder]  - .TAG_BUFFER [stage-1] [Decoder]  - .Topics[1] [stage-1] [Decoder]  - .error_code (0) -[stage-1] [Decoder]  - .name (quz) -[stage-1] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000054) +[stage-1] [Decoder]  - .name (paz) +[stage-1] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000058) [stage-1] [Decoder]  - .is_internal (false) [stage-1] [Decoder]  - .num_partitions (1) [stage-1] [Decoder]  - .Partitions[0] @@ -672,8 +672,8 @@ Debug = true [stage-1] [Decoder]  - .TAG_BUFFER [stage-1] [Decoder]  - .Topics[2] [stage-1] [Decoder]  - .error_code (0) -[stage-1] [Decoder]  - .name (saz) -[stage-1] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000058) +[stage-1] [Decoder]  - .name (quz) +[stage-1] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000011) [stage-1] [Decoder]  - .is_internal (false) [stage-1] [Decoder]  - .num_partitions (2) [stage-1] [Decoder]  - .Partitions[0] @@ -705,18 +705,18 @@ Debug = true [stage-1] ✓ Correlation ID: 1893237013 [stage-1] ✓ Throttle Time: 0 [stage-1]  ✓ TopicResponse[0] Error code: 0 -[stage-1]  ✓ TopicResponse[0] Topic Name: bar -[stage-1]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-4000-8000-000000000087 +[stage-1]  ✓ TopicResponse[0] Topic Name: pax +[stage-1]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-4000-8000-000000000045 [stage-1]  ✓ PartitionResponse[0] Error code: 0 [stage-1]  ✓ PartitionResponse[0] Partition Index: 0 [stage-1]  ✓ TopicResponse[1] Error code: 0 -[stage-1]  ✓ TopicResponse[1] Topic Name: quz -[stage-1]  ✓ TopicResponse[1] Topic UUID: 00000000-0000-4000-8000-000000000054 +[stage-1]  ✓ TopicResponse[1] Topic Name: paz +[stage-1]  ✓ TopicResponse[1] Topic UUID: 00000000-0000-4000-8000-000000000058 [stage-1]  ✓ PartitionResponse[0] Error code: 0 [stage-1]  ✓ PartitionResponse[0] Partition Index: 0 [stage-1]  ✓ TopicResponse[2] Error code: 0 -[stage-1]  ✓ TopicResponse[2] Topic Name: saz -[stage-1]  ✓ TopicResponse[2] Topic UUID: 00000000-0000-4000-8000-000000000058 +[stage-1]  ✓ TopicResponse[2] Topic Name: quz +[stage-1]  ✓ TopicResponse[2] Topic UUID: 00000000-0000-4000-8000-000000000011 [stage-1]  ✓ PartitionResponse[0] Error code: 0 [stage-1]  ✓ PartitionResponse[0] Partition Index: 0 [stage-1]  ✓ PartitionResponse[1] Error code: 0 diff --git a/internal/test_helpers/fixtures/fetch/pass b/internal/test_helpers/fixtures/fetch/pass index 0884b7c..435b459 100644 --- a/internal/test_helpers/fixtures/fetch/pass +++ b/internal/test_helpers/fixtures/fetch/pass @@ -6,15 +6,15 @@ Debug = true [stage-4] [Serializer]  - Wrote file to: /tmp/server.properties [stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/meta.properties [stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/.kafka_cleanshutdown -[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/partition.metadata -[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/baz-0/partition.metadata -[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-0/partition.metadata -[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-1/partition.metadata +[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/partition.metadata +[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/partition.metadata +[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/partition.metadata +[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/partition.metadata [stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/partition.metadata -[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/00000000000000000000.log -[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/baz-0/00000000000000000000.log -[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-0/00000000000000000000.log -[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-1/00000000000000000000.log +[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/00000000000000000000.log +[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/00000000000000000000.log +[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/00000000000000000000.log +[stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/00000000000000000000.log [stage-4] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000.log [stage-4] [Serializer] Finished writing log files to: /tmp/kraft-combined-logs [stage-4] Connecting to broker at: localhost:9092 @@ -61,7 +61,7 @@ Debug = true [stage-4] 01c0 | 2e 76 65 72 73 69 6f 6e 00 00 00 01 00 0e 6b 72 | .version......kr [stage-4] 01d0 | 61 66 74 2e 76 65 72 73 69 6f 6e 00 00 00 01 00 | aft.version..... [stage-4] 01e0 | 11 6d 65 74 61 64 61 74 61 2e 76 65 72 73 69 6f | .metadata.versio -[stage-4] 01f0 | 6e 00 01 00 16 00 01 08 00 00 00 00 00 00 00 0c | n............... +[stage-4] 01f0 | 6e 00 01 00 16 00 01 08 00 00 00 00 00 00 00 0b | n............... [stage-4] 0200 | 02 17 02 11 6d 65 74 61 64 61 74 61 2e 76 65 72 | ....metadata.ver [stage-4] 0210 | 73 69 6f 6e 00 14 00 14 00 | sion..... [stage-4]  @@ -380,10 +380,10 @@ Debug = true [stage-4] ✓ Correlation ID: 177586623 [stage-4] ✓ Error code: 0 (NO_ERROR) [stage-4] ✓ API keys array length: 61 -[stage-4] ✓ API version 17 is supported for FETCH -[stage-4] ✓ API version 0 is supported for FETCH -[stage-4] ✓ API version 4 is supported for API_VERSIONS -[stage-4] ✓ API version 0 is supported for API_VERSIONS +[stage-4] ✓ MinVersion for FETCH is <= 16 & >= 0 +[stage-4] ✓ MaxVersion for FETCH is >= 16 +[stage-4] ✓ MinVersion for API_VERSIONS is <= 4 & >= 0 +[stage-4] ✓ MaxVersion for API_VERSIONS is >= 4 [stage-4] Test passed. [stage-4] Terminating program [stage-4] Program terminated successfully @@ -394,15 +394,15 @@ Debug = true [stage-3] [Serializer]  - Wrote file to: /tmp/server.properties [stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/meta.properties [stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/.kafka_cleanshutdown -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/partition.metadata -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/baz-0/partition.metadata -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-0/partition.metadata -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-1/partition.metadata +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/partition.metadata +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/partition.metadata +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/partition.metadata +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/partition.metadata [stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/partition.metadata -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/00000000000000000000.log -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/baz-0/00000000000000000000.log -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-0/00000000000000000000.log -[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-1/00000000000000000000.log +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/00000000000000000000.log +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/00000000000000000000.log +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/00000000000000000000.log +[stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/00000000000000000000.log [stage-3] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000.log [stage-3] [Serializer] Finished writing log files to: /tmp/kraft-combined-logs [stage-3] Connecting to broker at: localhost:9092 @@ -419,7 +419,7 @@ Debug = true [stage-3] Hexdump of received "Fetch" response:  [stage-3] Idx | Hex | ASCII [stage-3] -----+-------------------------------------------------+----------------- -[stage-3] 0000 | 60 5a 05 cd 00 00 00 00 00 00 00 08 9b d1 a0 01 | `Z.............. +[stage-3] 0000 | 60 5a 05 cd 00 00 00 00 00 00 00 0f 58 2f fb 01 | `Z..........X/.. [stage-3] 0010 | 00 | . [stage-3]  [stage-3] [Decoder] - .ResponseHeader @@ -428,7 +428,7 @@ Debug = true [stage-3] [Decoder] - .ResponseBody [stage-3] [Decoder]  - .throttle_time_ms (0) [stage-3] [Decoder]  - .error_code (0) -[stage-3] [Decoder]  - .session_id (144429472) +[stage-3] [Decoder]  - .session_id (257437691) [stage-3] [Decoder]  - .num_responses (0) [stage-3] [Decoder]  - .TAG_BUFFER [stage-3] ✓ Correlation ID: 1616512461 @@ -445,15 +445,15 @@ Debug = true [stage-2] [Serializer]  - Wrote file to: /tmp/server.properties [stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/meta.properties [stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/.kafka_cleanshutdown -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/partition.metadata -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/baz-0/partition.metadata -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-0/partition.metadata -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-1/partition.metadata +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/partition.metadata +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/partition.metadata +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/partition.metadata +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/partition.metadata [stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/partition.metadata -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/00000000000000000000.log -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/baz-0/00000000000000000000.log -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-0/00000000000000000000.log -[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-1/00000000000000000000.log +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/00000000000000000000.log +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/00000000000000000000.log +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/00000000000000000000.log +[stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/00000000000000000000.log [stage-2] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000.log [stage-2] [Serializer] Finished writing log files to: /tmp/kraft-combined-logs [stage-2] Connecting to broker at: localhost:9092 @@ -465,7 +465,7 @@ Debug = true [stage-2] 0000 | 00 00 00 60 00 01 00 10 05 c3 b0 2a 00 09 6b 61 | ...`.......*..ka [stage-2] 0010 | 66 6b 61 2d 63 6c 69 00 00 00 01 f4 00 00 00 01 | fka-cli......... [stage-2] 0020 | 03 20 00 00 00 00 00 00 00 00 00 00 00 02 00 00 | . .............. -[stage-2] 0030 | 00 00 00 00 00 00 00 00 00 00 00 00 15 49 02 00 | .............I.. +[stage-2] 0030 | 00 00 00 00 00 00 00 00 00 00 00 00 42 08 02 00 | ............B... [stage-2] 0040 | 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 ff | ................ [stage-2] 0050 | ff ff ff ff ff ff ff ff ff ff ff 00 10 00 00 00 | ................ [stage-2] 0060 | 00 01 01 00 | .... @@ -473,8 +473,8 @@ Debug = true [stage-2] Hexdump of received "Fetch" response:  [stage-2] Idx | Hex | ASCII [stage-2] -----+-------------------------------------------------+----------------- -[stage-2] 0000 | 05 c3 b0 2a 00 00 00 00 00 00 00 01 26 64 2c 02 | ...*........&d,. -[stage-2] 0010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 15 49 | ...............I +[stage-2] 0000 | 05 c3 b0 2a 00 00 00 00 00 00 00 0f 88 6e 28 02 | ...*.........n(. +[stage-2] 0010 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 42 08 | ..............B. [stage-2] 0020 | 02 00 00 00 00 00 64 ff ff ff ff ff ff ff ff ff | ......d......... [stage-2] 0030 | ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 01 | ................ [stage-2] 0040 | ff ff ff ff 01 00 00 00 | ........ @@ -485,10 +485,10 @@ Debug = true [stage-2] [Decoder] - .ResponseBody [stage-2] [Decoder]  - .throttle_time_ms (0) [stage-2] [Decoder]  - .error_code (0) -[stage-2] [Decoder]  - .session_id (19293228) +[stage-2] [Decoder]  - .session_id (260599336) [stage-2] [Decoder]  - .num_responses (1) [stage-2] [Decoder]  - .TopicResponse[0] -[stage-2] [Decoder]  - .topic_id (00000000-0000-0000-0000-000000001549) +[stage-2] [Decoder]  - .topic_id (00000000-0000-0000-0000-000000004208) [stage-2] [Decoder]  - .num_partitions (1) [stage-2] [Decoder]  - .PartitionResponse[0] [stage-2] [Decoder]  - .partition_index (0) @@ -505,7 +505,7 @@ Debug = true [stage-2] ✓ Correlation ID: 96710698 [stage-2] ✓ Throttle Time: 0 [stage-2] ✓ Error Code: 0 (NO_ERROR) -[stage-2]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-0000-0000-000000001549 +[stage-2]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-0000-0000-000000004208 [stage-2]  ✓ PartitionResponse[0] Error code: 100 (UNKNOWN_TOPIC_ID) [stage-2]  ✓ PartitionResponse[0] Partition Index: 0 [stage-2]  ✓ RecordBatches: [] @@ -519,15 +519,15 @@ Debug = true [stage-1] [Serializer]  - Wrote file to: /tmp/server.properties [stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/meta.properties [stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/.kafka_cleanshutdown -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/partition.metadata -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/baz-0/partition.metadata -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-0/partition.metadata -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-1/partition.metadata +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/partition.metadata +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/partition.metadata +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/partition.metadata +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/partition.metadata [stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/partition.metadata -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/bar-0/00000000000000000000.log -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/baz-0/00000000000000000000.log -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-0/00000000000000000000.log -[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/foo-1/00000000000000000000.log +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/pax-0/00000000000000000000.log +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/paz-0/00000000000000000000.log +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-0/00000000000000000000.log +[stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/quz-1/00000000000000000000.log [stage-1] [Serializer]  - Wrote file to: /tmp/kraft-combined-logs/__cluster_metadata-0/00000000000000000000.log [stage-1] [Serializer] Finished writing log files to: /tmp/kraft-combined-logs [stage-1] Connecting to broker at: localhost:9092 @@ -539,7 +539,7 @@ Debug = true [stage-1] 0000 | 00 00 00 60 00 01 00 10 0f 2e 14 fa 00 09 6b 61 | ...`..........ka [stage-1] 0010 | 66 6b 61 2d 63 6c 69 00 00 00 01 f4 00 00 00 01 | fka-cli......... [stage-1] 0020 | 03 20 00 00 00 00 00 00 00 00 00 00 00 02 00 00 | . .............. -[stage-1] 0030 | 00 00 00 00 40 00 80 00 00 00 00 00 00 37 02 00 | ....@........7.. +[stage-1] 0030 | 00 00 00 00 40 00 80 00 00 00 00 00 00 58 02 00 | ....@........X.. [stage-1] 0040 | 00 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 ff | ................ [stage-1] 0050 | ff ff ff ff ff ff ff ff ff ff ff 00 10 00 00 00 | ................ [stage-1] 0060 | 00 01 01 00 | .... @@ -547,8 +547,8 @@ Debug = true [stage-1] Hexdump of received "Fetch" response:  [stage-1] Idx | Hex | ASCII [stage-1] -----+-------------------------------------------------+----------------- -[stage-1] 0000 | 0f 2e 14 fa 00 00 00 00 00 00 00 07 c3 37 a8 02 | .............7.. -[stage-1] 0010 | 00 00 00 00 00 00 40 00 80 00 00 00 00 00 00 37 | ......@........7 +[stage-1] 0000 | 0f 2e 14 fa 00 00 00 00 00 00 00 0a a5 d9 23 02 | ..............#. +[stage-1] 0010 | 00 00 00 00 00 00 40 00 80 00 00 00 00 00 00 58 | ......@........X [stage-1] 0020 | 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................ [stage-1] 0030 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................ [stage-1] 0040 | ff ff ff ff 01 00 00 00 | ........ @@ -559,10 +559,10 @@ Debug = true [stage-1] [Decoder] - .ResponseBody [stage-1] [Decoder]  - .throttle_time_ms (0) [stage-1] [Decoder]  - .error_code (0) -[stage-1] [Decoder]  - .session_id (130234280) +[stage-1] [Decoder]  - .session_id (178641187) [stage-1] [Decoder]  - .num_responses (1) [stage-1] [Decoder]  - .TopicResponse[0] -[stage-1] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000037) +[stage-1] [Decoder]  - .topic_id (00000000-0000-4000-8000-000000000058) [stage-1] [Decoder]  - .num_partitions (1) [stage-1] [Decoder]  - .PartitionResponse[0] [stage-1] [Decoder]  - .partition_index (0) @@ -579,7 +579,7 @@ Debug = true [stage-1] ✓ Correlation ID: 254678266 [stage-1] ✓ Throttle Time: 0 [stage-1] ✓ Error Code: 0 (NO_ERROR) -[stage-1]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-4000-8000-000000000037 +[stage-1]  ✓ TopicResponse[0] Topic UUID: 00000000-0000-4000-8000-000000000058 [stage-1]  ✓ PartitionResponse[0] Error code: 0 (NO_ERROR) [stage-1]  ✓ PartitionResponse[0] Partition Index: 0 [stage-1]  ✓ RecordBatches: []