Scenario 10.1.3 · WarpStream: an Agent dies
WarpStream Kafka: an Agent dies mid-commit
WarpStream (Agent v857) · a hard-killed Agent loses nothing acked: its buffered requests time out, the file whose commit it sent still commits with its acks lost, and the idempotent producer's retry of the record already committed is the only one dropped as a duplicate.
Run this scenario in the playgroundTwo producers write through one Agent in az-a. t+2.150s
orders is a WarpStream topic (Agent v857). Four Agents run here: agent-1 and agent-2 in az-a, agent-3 in az-b, agent-4 in az-c. p-idem (idempotent) and p-plain (idempotence off) both set ws_az=az-a and both write orders-2, and discovery names agent-2 as the leader for both. Their first records, k1 and k3, went into one file that the control plane committed at 1450 (offsets 0 and 1); g1 in az-b and g2 in az-a read them at 1800, so az-a's zone cache loaded that file through agent-2. Their second records, k4 and k6, are in a second file: its upload ended at 2100 and its commit request is with the control plane, not yet answered. Their third records, k12 and k20, wait in agent-2's open buffer.
Open at this step: step 1, Two producers write through one Agent in az-aThe Agent dies: buffered requests time out. t+2.200s
agent-2 is hard-killed. Its open buffer never reached object storage, so k12 and k20 are gone with it: both producers get REQUEST_TIMED_OUT for them at the kill (WarpStream's docs name no code; the simulator's choice) and will retry. agent-2 leaves the routing at once (the simulator does not model discovery), and its entry in az-a's zone cache is dropped. The file holding k4 and k6 is another matter: its commit request had already left the Agent.
Open at this step: step 2, The Agent dies: buffered requests time outIts last file still commits, but its acks are lost. t+2.300s
The control plane commits the file agent-2 sent before it died: k4 gets offset 2 and k6 offset 3, readable at once. But the Agent that would have answered the producers is gone, so neither learns that its record was written: each gets REQUEST_TIMED_OUT (again the simulator's choice of code) and will retry a record that is already in the log.
Open at this step: step 3, Its last file still commits, but its acks are lostThe producers retry through the other az-a Agent. t+2.700s
Each producer sends again 400 ms after its timeout (the simulator's retry backoff). Discovery now names agent-1, the only live Agent in az-a, for both: k12 and k20 reach its buffer at 2600, the retries of k4 and k6 at 2700, all in one file. In between, g1 and g2 read k4 and k6 at 2400, and az-a's zone cache loaded their file through agent-1.
Open at this step: step 4, The producers retry through the other az-a AgentThe control plane drops p-idem's duplicate; p-plain's lands twice. t+3.900s
agent-1's file commits. p-idem's retry of k4 carries a sequence the control plane has already committed for it, so the record is dropped and acked as a duplicate: the check runs at commit, so a retry through another Agent is still caught. k12 gets offset 4. p-plain sends no sequence, so nothing marks its k6 as a retry: k20 gets offset 5 and k6 is written again at offset 6. Both producers are acked.
Open at this step: step 5, The control plane drops p-idem's duplicate; p-plain's lands twiceNothing acked is lost; the zone cache moves to a live Agent. t+4.800s
g1 and g2 read offsets 4 to 6 at 4200 and commit 7 at 4800: every record a producer was acked for is in the log and read, p-plain's k6 twice. agent-2 held nothing acked: its buffer was never acked, and its last file was already in object storage, and the control plane committed it after the kill. In az-a, the file agent-2 had loaded now maps to agent-1, so its next read there loads it again, and every az-a load since the kill went through agent-1. az-b's cache stays with agent-3: the kill did not touch it.
Open at this step: step 6, Nothing acked is lost; the zone cache moves to a live AgentWhat you start with
WarpStream Agents are stateless: a produce is acked only after its file is uploaded to object storage and committed by the control plane, so an Agent holds nothing acked. Four Agents run here: agent-1 and agent-2 in az-a, agent-3 in az-b and agent-4 in az-c. Producers p-idem (idempotent) and p-plain (idempotence off) both sit in az-a and both write through agent-2. Consumer groups g1 in az-b and g2 in az-a read orders. agent-2 is hard-killed while it holds an open buffer and a file whose commit request it has sent but not had answered. Timings are slowed so each phase gets its own frame.
Step by step
- Two producers write through one Agent in az-a t+2.150s orders is a WarpStream topic (Agent v857). Four Agents run here: agent-1 and agent-2 in az-a, agent-3 in az-b, agent-4 in az-c. p-idem (idempotent) and p-plain (idempotence off) both set ws_az=az-a and both write orders-2, and discovery names agent-2 as the leader for both. Their first records, k1 and k3, went into one file that the control plane committed at 1450 (offsets 0 and 1); g1 in az-b and g2 in az-a read them at 1800, so az-a's zone cache loaded that file through agent-2. Their second records, k4 and k6, are in a second file: its upload ended at 2100 and its commit request is with the control plane, not yet answered. Their third records, k12 and k20, wait in agent-2's open buffer. Open at this step: step 1, Two producers write through one Agent in az-a
- The Agent dies: buffered requests time out t+2.200s agent-2 is hard-killed. Its open buffer never reached object storage, so k12 and k20 are gone with it: both producers get REQUEST_TIMED_OUT for them at the kill (WarpStream's docs name no code; the simulator's choice) and will retry. agent-2 leaves the routing at once (the simulator does not model discovery), and its entry in az-a's zone cache is dropped. The file holding k4 and k6 is another matter: its commit request had already left the Agent. Open at this step: step 2, The Agent dies: buffered requests time out
- Its last file still commits, but its acks are lost t+2.300s The control plane commits the file agent-2 sent before it died: k4 gets offset 2 and k6 offset 3, readable at once. But the Agent that would have answered the producers is gone, so neither learns that its record was written: each gets REQUEST_TIMED_OUT (again the simulator's choice of code) and will retry a record that is already in the log. Open at this step: step 3, Its last file still commits, but its acks are lost
- The producers retry through the other az-a Agent t+2.700s Each producer sends again 400 ms after its timeout (the simulator's retry backoff). Discovery now names agent-1, the only live Agent in az-a, for both: k12 and k20 reach its buffer at 2600, the retries of k4 and k6 at 2700, all in one file. In between, g1 and g2 read k4 and k6 at 2400, and az-a's zone cache loaded their file through agent-1. Open at this step: step 4, The producers retry through the other az-a Agent
- The control plane drops p-idem's duplicate; p-plain's lands twice t+3.900s agent-1's file commits. p-idem's retry of k4 carries a sequence the control plane has already committed for it, so the record is dropped and acked as a duplicate: the check runs at commit, so a retry through another Agent is still caught. k12 gets offset 4. p-plain sends no sequence, so nothing marks its k6 as a retry: k20 gets offset 5 and k6 is written again at offset 6. Both producers are acked. Open at this step: step 5, The control plane drops p-idem's duplicate; p-plain's lands twice
- Nothing acked is lost; the zone cache moves to a live Agent t+4.800s g1 and g2 read offsets 4 to 6 at 4200 and commit 7 at 4800: every record a producer was acked for is in the log and read, p-plain's k6 twice. agent-2 held nothing acked: its buffer was never acked, and its last file was already in object storage, and the control plane committed it after the kill. In az-a, the file agent-2 had loaded now maps to agent-1, so its next read there loads it again, and every az-a load since the kill went through agent-1. az-b's cache stays with agent-3: the kill did not touch it. Open at this step: step 6, Nothing acked is lost; the zone cache moves to a live Agent
The takeaway
agent-2 died holding two kinds of unfinished work. The records in its open buffer had never reached object storage and had never been acked: both producers got REQUEST_TIMED_OUT at the kill and retried them through agent-1, the other Agent in az-a. Its last file had been uploaded and its commit request sent, so the control plane committed it after the Agent was gone; only the acks were lost, and the producers retried records that were already in the log. At commit the control plane dropped p-idem's retry, whose sequence it had already committed, and acked it as a duplicate; p-plain's retry carried no sequence and was written a second time. Every acked record was read, and az-a's zone cache moved to agent-1. WarpStream facts: Agents hold no data, so losing all of them loses nothing acked; idempotence is checked at commit by the control plane, so a retry through another Agent is still caught. Simulator choices: REQUEST_TIMED_OUT for the buffered requests and for the lost acks (the docs name no code), sent at the kill and when the commit lands; the retry timing, 400 ms after each timeout (the simulator's retry backoff); the Agent in a zone that serves a client, and the one that loads a file into the zone's cache, are picked by a stable hash over the live Agents; a dead Agent leaves the routing at once and its zone cache entries are dropped; and the 500 ms batchTimeout, 600 ms upload and 200 ms commit are slowed figures so each phase is a frame.
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.3" title="Kafka Simulator: WarpStream: an Agent dies" 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-agent-dies/">WarpStream Kafka: an Agent dies mid-commit</a></p> Further reading
Troubleshooting
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: a leader per client, a cache per zone
- 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