Scenario 10.1.2 · WarpStream: zones and a leader per client
WarpStream Kafka: a leader per client, a cache per zone
WarpStream (Agent v857) · service discovery names a leader for each client: an Agent in its zone when client.id sets ws_az, any Agent when it does not; each zone loads a file into its cache once.
Run this scenario in the playgroundThree clients ask for the leader of orders-0. t+0.000s
orders is a WarpStream topic (Agent v857): 3 partitions, every record in object storage, and no leader of its own: any Agent can serve any partition. One Agent runs in each zone: agent-1 in az-a, agent-2 in az-b, agent-3 in az-c. Producer p-a sets ws_az=az-a in its client.id, p-b sets ws_az=az-b, and p-x sets no zone. All three are about to write orders-0, so each first asks service discovery for its leader. Consumer groups g-a, g-b and g-c read orders, one in each zone.
Open at this step: step 1, Three clients ask for the leader of orders-0Each gets the Agent in its own zone. t+0.300s
Discovery answers each Metadata request with an Agent in the client's zone: the leader of orders-0 is agent-1 for p-a and agent-2 for p-b. Two clients, two leaders for one partition. Each record now sits in the buffer of the Agent in its producer's zone, so neither request left its zone.
Open at this step: step 2, Each gets the Agent in its own zoneA client with no zone lands on an Agent in any zone. t+0.450s
p-x sets no ws_az, so discovery may name any Agent. For orders-0 it names agent-3 in az-c: a third leader for the same partition, and p-x's record waits in agent-3's buffer. Nothing tells the Agents which zone p-x runs in; unless it is az-c, each of its requests crosses zones, the traffic ws_az is there to avoid. The cross-AZ counter counts no request of a client with no zone: the simulator does not know where it runs, so it stays at 0.
Open at this step: step 3, A client with no zone lands on an Agent in any zoneEach zone that reads a file loads it into its own cache. t+1.800s
The control plane committed the three files in turn, agent-1's, agent-2's, then agent-3's, so orders-0 holds p-a's record at offset 0, p-b's at 1 and p-x's at 2. Each group reads through the Agent in its zone, and each zone loads every file it reads from object storage into its own cache, once: three files in three zones, nine loads, so each file carries a mark for every zone. A later read in a zone is served from its cache.
Open at this step: step 4, Each zone that reads a file loads it into its own cacheWhat you start with
A WarpStream partition has no leader of its own: any Agent can serve it. Service discovery answers each client's Metadata request with an Agent in the zone named by ws_az in its client.id, and with any Agent when the client names no zone, so two clients can see two leaders for one partition. Three Agents run here, one per zone. Producer p-a sits in az-a, p-b in az-b, and p-x sets no zone; all three write partition 0 of orders. Consumer groups g-a, g-b and g-c read orders, one in each zone. Timings are slowed so each phase gets its own frame.
Step by step
- Three clients ask for the leader of orders-0 t+0.000s orders is a WarpStream topic (Agent v857): 3 partitions, every record in object storage, and no leader of its own: any Agent can serve any partition. One Agent runs in each zone: agent-1 in az-a, agent-2 in az-b, agent-3 in az-c. Producer p-a sets ws_az=az-a in its client.id, p-b sets ws_az=az-b, and p-x sets no zone. All three are about to write orders-0, so each first asks service discovery for its leader. Consumer groups g-a, g-b and g-c read orders, one in each zone. Open at this step: step 1, Three clients ask for the leader of orders-0
- Each gets the Agent in its own zone t+0.300s Discovery answers each Metadata request with an Agent in the client's zone: the leader of orders-0 is agent-1 for p-a and agent-2 for p-b. Two clients, two leaders for one partition. Each record now sits in the buffer of the Agent in its producer's zone, so neither request left its zone. Open at this step: step 2, Each gets the Agent in its own zone
- A client with no zone lands on an Agent in any zone t+0.450s p-x sets no ws_az, so discovery may name any Agent. For orders-0 it names agent-3 in az-c: a third leader for the same partition, and p-x's record waits in agent-3's buffer. Nothing tells the Agents which zone p-x runs in; unless it is az-c, each of its requests crosses zones, the traffic ws_az is there to avoid. The cross-AZ counter counts no request of a client with no zone: the simulator does not know where it runs, so it stays at 0. Open at this step: step 3, A client with no zone lands on an Agent in any zone
- Each zone that reads a file loads it into its own cache t+1.800s The control plane committed the three files in turn, agent-1's, agent-2's, then agent-3's, so orders-0 holds p-a's record at offset 0, p-b's at 1 and p-x's at 2. Each group reads through the Agent in its zone, and each zone loads every file it reads from object storage into its own cache, once: three files in three zones, nine loads, so each file carries a mark for every zone. A later read in a zone is served from its cache. Open at this step: step 4, Each zone that reads a file loads it into its own cache
The takeaway
Three clients asked for the leader of orders-0 and got three different Agents: p-a got agent-1 in az-a and p-b got agent-2 in az-b, each the Agent in its own zone, so their requests stayed in their zones. p-x set no ws_az, so discovery could name any Agent; it got agent-3 in az-c, and unless p-x runs in az-c its requests cross zones. Each zone then loaded every file it read into its own cache, once: three files in three zones, nine loads. WarpStream facts: service discovery names an Agent in the client's zone when ws_az is set in client.id, and any Agent otherwise; each zone's cache loads a file once. Simulator choices: the client's zone is its rack, shown as ws_az; the Agent within a zone, or among all Agents for a client with no zone, is picked by a stable hash; the cross-AZ counter counts no request of a client with no zone, since the simulator does not know where it runs; and the 500 ms batchTimeout, 600 ms upload and 200 ms commit are slowed figures so each phase is a frame.
Configs in this scenario
-
client.A logical name the producer sends with every request - it shows up in broker logs, metrics, and quota enforcement so traffic can be attributed to an application.id
Embed this scenario
Paste this into a blog post, a course page or your team's docs. The scenario plays inside your page, and the link under it points readers to this walkthrough.
<iframe src="https://monedula.dev/kafka-simulator/embed/?scenario=10.1.2" title="Kafka Simulator: WarpStream: zones and a leader per client" width="100%" height="520" style="border:1px solid #d0d0d0;border-radius:8px" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
<p><a href="https://monedula.dev/kafka-simulator/scenarios/warpstream-zones-leader-per-client/">WarpStream Kafka: a leader per client, a cache per zone</a></p> Further reading
More in Diskless
- Diskless Kafka topics (KIP-1163): the write path
- Diskless vs classic Kafka: cross-AZ replication traffic
- Diskless Kafka produce latency: the price of object storage
- Diskless Kafka (KIP-1163): when object storage goes down
- Aiven Inkless diskless Kafka: the write path
- Aiven Inkless: what a PostgreSQL outage does to Kafka
- Aiven Inkless: what losing a Kafka broker costs
- Aiven Inkless: a slow S3 bucket fails Kafka produce
- KafScale diskless Kafka: etcd lease, S3 segment, ack
- KafScale 2.1 diskless Kafka: a lease owner crashes
- KafScale 2.1 diskless Kafka: when etcd goes down
- KafScale 2.1 diskless Kafka: when S3 goes down
- KafScale 2.1 proxy: etcd down past the 60 s cache TTL
- KafScale 2.1: a Kafka producer timeout that still wrote
- KafScale 2.1 diskless Kafka: lease handover, no overwrite
- KafScale 2.1 diskless Kafka: a paused broker comes back
- AutoMQ diskless Kafka: one S3 WAL per broker, then ack
- AutoMQ diskless Kafka: a broker crash and WAL failover
- AutoMQ diskless Kafka: moving a partition, no copying
- AutoMQ diskless Kafka: zone router, no cross-zone data
- AutoMQ diskless Kafka: when S3 goes down
- WarpStream diskless Kafka: the write path through Agents
- WarpStream Kafka: an Agent dies mid-commit
- WarpStream Kafka: the control plane goes down
- WarpStream Kafka Ripcord: produce without the control plane
- WarpStream Kafka lightning topics: ack before the commit
- WarpStream Kafka transactions in the control plane
- Redpanda Kafka write path: the offset comes after S3
- Redpanda Kafka leader crash: a Raft election, no replay
- Redpanda Kafka S3 outage: uploads time out, Raft holds
- Redpanda Kafka L0 to L1: the LRO and who serves a read
- Redpanda Kafka transactions: exactly-once on Cloud Topics
- Nisshi diskless Kafka: watermark.json, then the batch
- Nisshi diskless Kafka on PostgreSQL: a row lock per write
- Nisshi diskless Kafka: two brokers write one partition
- Nisshi diskless Kafka: reading through another broker
- Nisshi diskless Kafka: a broker dies mid-write
- Nisshi diskless Kafka: when PostgreSQL goes down
- Nisshi diskless Kafka: what 0.8.2 refuses
- Ursa for Kafka write path: Oxia assigns the offset
- Ursa for Kafka zones: the zonal owner and the zone cache
- Ursa for Kafka compaction: from WAL objects to Parquet
- Ursa for Kafka broker failure: a kill and a silent broker
- Ursa for Kafka: diskless and disk topics, side by side