Skip to content

feat(gateways): map Kafka topic configs and replication factor to Iggy - #4747

Open
krishvishal wants to merge 4 commits into
masterfrom
kafka-topic-configs
Open

krishvishal wants to merge 4 commits into
masterfrom
kafka-topic-configs

Conversation

@krishvishal

Copy link
Copy Markdown
Member

Which issue does this PR address?

Relates to #4508

Rationale

Kafka frameworks create topics with specific configurations and read those configurations back. The gateway currently rejects most of them. As a result, Kafka Connect, Kafka Streams, MirrorMaker 2, Debezium, kafka-ui, Terraform, and the Strimzi Topic Operator can stop at startup or when they create their first topic.

This PR proposes the following answers to the three open questions in #4508.

  1. Compaction. The gateway accepts cleanup.policy=compact, creates the topic without an expiry or size cap, and logs a warning. Until Iggy supports compaction (Kafka gateway: log compaction for compacted topics #4521), the gateway does not report compact in DescribeConfigs. Persisting the policy requires a new Iggy topic option with a typed field in all eight SDKs.
  2. Replication factor. The gateway stores the requested replication factor in the Iggy replication_factor topic option introduced in feat(cluster)!: add per-topic replication factor #4692.
  3. Settings Iggy cannot apply. If a setting has no client-visible effect, the gateway accepts any value Kafka accepts and reports the Kafka default in DescribeConfigs. It returns error 40 for message.timestamp.type=LogAppendTime and non-default values of max.message.bytes, because these settings change what clients receive.

The following gaps keep #4508 open.

  • Schema Registry reads cleanup.policy on its second startup and stops unless kafkastore.topic.skip.validation=true is set.
  • Apicurio Registry 3 reads back cleanup.policy=delete on every startup and fails to start.
  • Retention changes apply to a topic created with compact if the alter request omits cleanup.policy.
  • Replication factor 2 requires both replicas to be available for writes because Iggy commits on a majority. Kafka can continue accepting writes with one replica down.
  • Metadata lists gateways as partition replicas instead of the Iggy nodes that host each partition.

What changed?

  • CreateTopics previously returned error 40 for any configuration entry and error 38 for any replication factor other than 1 or -1. It now stores retention.ms, retention.bytes, segment.bytes, and the replication factor as Iggy topic options. It also validates every Kafka 4.4 topic key using Kafka's validation rules and error messages.
  • DescribeConfigs previously returned only retention.ms for topics and error 42 for a BROKER resource. It now returns the Kafka 4.4 topic keys for topics and the keys the Strimzi Topic Operator reads for brokers.
  • Three new variables control retention and durability for topics the gateway creates. Their defaults preserve the current behavior.

Two changes affect existing clients.

  • AlterConfigs now replaces the full topic configuration, matching Kafka's behavior. An empty list resets the topic configuration to its defaults.
  • A retention.bytes value smaller than one segment now returns error 40 because Iggy always retains one sealed segment per partition.

gateways/kafka/docs/CONFIGS.md documents each key, the gateway's response, and its limitations.

Frameworks create Kafka topics with configs and read them back, which the gateway refused (#4508).
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Nov 4, 2026
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.03%. Comparing base (d0fc19a) to head (ec2fbeb).

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #4747   +/-   ##
=========================================
  Coverage     91.03%   91.03%           
  Complexity     3878     3878           
=========================================
  Files          1561     1561           
  Lines        403726   403723    -3     
  Branches     337601   337598    -3     
=========================================
+ Hits         367515   367533   +18     
+ Misses        28851    28827   -24     
- Partials       7360     7363    +3     
Components Coverage Δ
Rust Core 92.28% <ø> (+<0.01%) ⬆️
Java SDK 79.37% <ø> (ø)
C# SDK 84.42% <ø> (ø)
Python SDK 86.51% <ø> (ø)
PHP SDK 92.23% <ø> (ø)
Node SDK 96.60% <ø> (ø)
Go SDK 71.70% <ø> (ø)
C++ SDK 86.84% <ø> (ø)
see 24 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread gateways/kafka/src/protocol/api.rs Resolved
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Nov 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author PR is waiting on author response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants