Monedula
Kafka guide contents

Markdown

Part VI · Reference

Kafka Improvement Proposal

KIP-1123: rack-aware partitioning, keep producer traffic in its zone

Producers and transactions · Shipped · since Kafka 4.4 · status checked November 2026

KIP-1123 lets the producer send records without a key only to partitions whose leader sits in the producer's own rack or availability zone. In the cloud that cuts the cross-zone traffic you pay for on every produce. It is off by default and needs partitioner.rack.aware=true plus client.rack on the producer.

Proposal
KIP-1123, Rack-aware partitioning for Kafka Producer
Status
Shipped New in Kafka 4.4, off by default (partitioner.rack.aware=false).
Area
Producers and transactions
Rack-aware: az-a leaders only. With partitioner.rack.aware=true the default partitioner picks each new sticky partition among the partitions led in client.rack, here p3 and p0. Kafka picks one at random; the simulator alternates so the rotation is visible. Open this step in the full playground

Why it was needed

In a cluster spread over three availability zones, leaders are spread evenly, so about two thirds of what a producer sends crosses a zone boundary. Cloud providers bill that traffic. Consumers already had a fix, fetching from the closest replica (KIP-392), but producers must write to the leader, and the default partitioner picked partitions without looking at where their leaders live.

What it changes

With partitioner.rack.aware=true, the default partitioner chooses its sticky partition for keyless records only among partitions led by a broker with the same rack as the producer's client.rack. Records with a key still hash to their partition as before, so ordering by key is unchanged. If no partition in the producer's rack has a leader, for example after a broker in that zone failed, it falls back to all partitions.

How to use it

  • Set client.rack on the producer to the zone it runs in, matching the brokers' broker.rack values.
  • Set partitioner.rack.aware=true. It only helps keyless records and only when every zone hosts leaders.

Where it stands

Accepted and shipped in Apache Kafka 4.4 (October 2026) as an opt-in setting of the built-in partitioner. Leader placement still decides how much it saves: zones without leaders get no local partitions.

What comes next

No follow-up is planned. It pairs with KIP-392 on the consumer side, and diskless topics (KIP-1150) go after the same cross-zone bill for replication, which this KIP does not touch.

See it in the simulator

Sources

All Kafka KIPs