BYO Kafka - #YK1 Testing for Incorrect Response Header

remote: [tester::#YK1] Running tests for Stage #YK1 (Listing Partitions - Include DescribeTopicPartitions in APIVersions)
remote: [tester::#YK1] $ ./your_program.sh /tmp/server.properties
remote: [tester::#YK1] Connecting to broker at: localhost:9092
remote: [tester::#YK1] Connection to broker at localhost:9092 successful
remote: [tester::#YK1] Sending "ApiVersions" (version: 4) request (Correlation id: 1296539330)
remote: [tester::#YK1] Hexdump of sent "ApiVersions" request:
remote: [tester::#YK1] Idx  | Hex                                             | ASCII
remote: [tester::#YK1] -----+-------------------------------------------------+-----------------
remote: [tester::#YK1] 0000 | 00 00 00 23 00 12 00 04 4d 47 9e c2 00 09 6b 61 | ...#....MG....ka
remote: [tester::#YK1] 0010 | 66 6b 61 2d 63 6c 69 00 0a 6b 61 66 6b 61 2d 63 | fka-cli..kafka-c
remote: [tester::#YK1] 0020 | 6c 69 04 30 2e 31 00                            | li.0.1.
remote: [tester::#YK1]
remote: [tester::#YK1] Hexdump of received "ApiVersions" response:
remote: [tester::#YK1] Idx  | Hex                                             | ASCII
remote: [tester::#YK1] -----+-------------------------------------------------+-----------------
remote: [tester::#YK1] 0000 | 00 00 00 1b 4d 47 9e c2 00 00 00 03 00 12 00 03 | ....MG..........
remote: [tester::#YK1] 0010 | 00 04 00 00 4b 00 00 00 00 00 00 00 00 00 00    | ....K..........
remote: [tester::#YK1]
remote: [tester::#YK1] [Decoder] - .ResponseHeader
remote: [tester::#YK1] [Decoder]   - .correlation_id (1296539330)
remote: [tester::#YK1] [Decoder] - .ResponseBody
remote: [tester::#YK1] [Decoder]   - .error_code (0)
remote: [tester::#YK1] [Decoder]   - .num_api_keys (0)
remote: [tester::#YK1] [Decoder]   - .throttle_time_ms (50336256)
remote: [tester::#YK1] [Decoder]   - .TAG_BUFFER

Key bytes: c2 00 00 00 03 00, there is an extra 00 before the 03 from the tag buffer in ResponseHeaderV1

The tester sends an ApiVersionsRequestV4 with a RequestHeaderV2 (has tagged fields). I would therefore expect the program to test for a ResponseHeaderV1 (has tagged fields). Instead the program is testing for a ResponseHeaderV0 (no tagged fields).

The other test from this section is testing for a ResponseHeaderV1:

remote: [tester::#VT6] Running tests for Stage #VT6 (Listing Partitions - List for an unknown topic)
remote: [tester::#VT6] $ ./your_program.sh /tmp/server.properties
remote: [tester::#VT6] Connecting to broker at: localhost:9092
remote: [tester::#VT6] Connection to broker at localhost:9092 successful
remote: [tester::#VT6] Sending "DescribeTopicPartitions" (version: 0) request (Correlation id: 1239075417)
remote: [tester::#VT6] Hexdump of sent "DescribeTopicPartitions" request:
remote: [tester::#VT6] Idx  | Hex                                             | ASCII
remote: [tester::#VT6] -----+-------------------------------------------------+-----------------
remote: [tester::#VT6] 0000 | 00 00 00 31 00 4b 00 00 49 da ca 59 00 0c 6b 61 | ...1.K..I..Y..ka
remote: [tester::#VT6] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 02 12 75 6e 6b | fka-tester...unk
remote: [tester::#VT6] 0020 | 6e 6f 77 6e 2d 74 6f 70 69 63 2d 73 61 7a 00 00 | nown-topic-saz..
remote: [tester::#VT6] 0030 | 00 00 01 ff 00                                  | .....
remote: [tester::#VT6]
remote: [tester::#VT6] Hexdump of received "DescribeTopicPartitions" response:
remote: [tester::#VT6] Idx  | Hex                                             | ASCII
remote: [tester::#VT6] -----+-------------------------------------------------+-----------------
remote: [tester::#VT6] 0000 | 00 00 00 37 49 da ca 59 00 00 00 00 00 02 00 03 | ...7I..Y........
remote: [tester::#VT6] 0010 | 12 75 6e 6b 6e 6f 77 6e 2d 74 6f 70 69 63 2d 73 | .unknown-topic-s
remote: [tester::#VT6] 0020 | 61 7a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | az..............
remote: [tester::#VT6] 0030 | 00 00 00 01 00 00 0d f8 00 ff 00                | ...........
remote: [tester::#VT6]
remote: [tester::#VT6] [Decoder] - .ResponseHeader
remote: [tester::#VT6] [Decoder]   - .correlation_id (1239075417)
remote: [tester::#VT6] [Decoder]   - .TAG_BUFFER
remote: [tester::#VT6] [Decoder] - .ResponseBody
remote: [tester::#VT6] [Decoder]   - .throttle_time_ms (0)
remote: [tester::#VT6] [Decoder]   - .topic.length (1)
remote: [tester::#VT6] [Decoder]   - .Topics[0]
remote: [tester::#VT6] [Decoder]     - .error_code (3)
remote: [tester::#VT6] [Decoder]     - .name (unknown-topic-saz)
remote: [tester::#VT6] [Decoder]     - .topic_id (00000000-0000-0000-0000-000000000000)
remote: [tester::#VT6] [Decoder]     - .is_internal (false)
remote: [tester::#VT6] [Decoder]     - .num_partitions (0)
remote: [tester::#VT6] [Decoder]     - .topic_authorized_operations (3576)
remote: [tester::#VT6] [Decoder]     - .TAG_BUFFER
remote: [tester::#VT6] [Decoder]   - .next_cursor (null)
remote: [tester::#VT6] [Decoder]   - .TAG_BUFFER
remote: [tester::#VT6] βœ“ Correlation ID: 1239075417
remote: [tester::#VT6] βœ“ Throttle Time: 0
remote: [tester::#VT6]   βœ“ TopicResponse[0] Error code: 3
remote: [tester::#VT6]   βœ“ TopicResponse[0] Topic Name: unknown-topic-saz
remote: [tester::#VT6]   βœ“ TopicResponse[0] Topic UUID: 00000000-0000-0000-0000-000000000000
remote: [tester::#VT6] Test passed.

I could also be making a mistake in how I am choosing my ResponseHeader version, but if it isn’t based on support for _tagged_fields it is not obvious to me.

Hey @Didgety, the ApiVersionsResponse always uses a v0 header:

Woops, lost track of that when I refactored everything. Thank you!

1 Like