tychedelia / kafka-protocol-rs

Rust Kafka protocol
Apache License 2.0
63 stars 23 forks source link

incorrect decoding of OffsetCommitRequest #88

Closed pdeva closed 2 months ago

pdeva commented 2 months ago

for 2nd and 3rd partitions in the array, both the partition_index and committed_offset have bogus values. api version of request is 5 for this test.

OffsetCommitRequest { 
        group_id: "kafka-go-group-5d98a46efd9bf672", 
        topics: [
            Topic { 
                name: "kafka-go-5a569f08b3e0db68", 
                partitions: [
                    Partition { 
                        partition_index: 0, 
                        committed_offset: 10, 
                        committed_metadata: Some("") 
                    }, 
                    Partition { 
                        partition_index: 65535, 
                        committed_offset: 4294967296, 
                        committed_metadata: Some("") 
                    }, 
                    Partition { 
                        partition_index: 655360, 
                        committed_offset: 281470681743362, 
                        committed_metadata: Some("") 
                    }
                ] 
            }
        ], 
        member_id: "___1TestClientOffsetCommit_in_github_com_segmentio_kafka_go.test@code-pdeva (github.com/segmentio/kafka-go)-627a8981-6197-4cf0-b522-9e99cdee2120", 
        group_instance_id: None, 
        generation_id: 1 
    }

same request run against apache kafka shows committed_offset to be 10 in each of the partition structs and partition_indexes to have values 1 and 2.

Screenshot 2024-09-24 at 10 48 55 AM

pdeva commented 2 months ago

seems like this is a bug in kafka-go library. we were able to get it to reproduce on apache kafka.