Kafka gateway: keep repeated header names and header order

オープン
#4,517 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
backend

調査の方向性

Start with gateways/kafka/docs/BRIDGE_MAPPING.md to see how headers are currently mapped and sorted on Fetch. The issue says kafka_protocol keeps only the last value of a repeated header name, so the raw record bytes need to be read for headers. The open question on whether every record or only repeated-name records keep order must be settled before changing the envelope. Done means the KafkaJS array-header producer succeeds and a record with a repeated header name matches after Produce and Fetch.

索引モデルが issue の本文から書いたものです。

説明

gateways

Summary

A record with a repeated header name gets INVALID_RECORD (87), and Fetch returns headers sorted by name (gateways/kafka/docs/BRIDGE_MAPPING.md). Kafka allows both.

Who hits it:

  • KafkaJS writes array header values as repeated keys, a documented feature. If it forwards a consumed message, it writes them again. The KafkaJS layer of confluent-kafka-javascript does the same.
  • Apps that append a trace header twice (https://github.com/spring-projects/spring-kafka/issues/3786).
  • Error 87 fails the whole partition batch in librdkafka, franz-go and Sarama. It puts a kafka-python 3.0 producer in a fatal state, so every later send fails until a restart. A kafka-go writer at its default acks=0 loses the batch and the connection, with no error.

Open question

Does every record keep its header order, at the cost of a larger stored envelope, or only records with repeated names?

Scope

  • Read headers from the raw record bytes, because kafka_protocol keeps only the last value of a name
  • Store a record with repeated names in the envelope, which keeps a list
  • Return headers in their original order on Fetch, as the open question decides
  • Update gateways/kafka/docs/BRIDGE_MAPPING.md

Acceptance criteria

  • A KafkaJS producer with array header values succeeds, and a consumer reads every value in order
  • A record with the same header name twice is the same after Produce and Fetch

References

主要言語
Rust
スター
5.2k
フォーク
502
平均マージ
3日 3時間
マージ済み PR(30日)
163

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/iggy のほかの issue

apache/iggy の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。