---
title: "WarpStream Kafka: an Agent dies mid-commit"
description: "WarpStream (Agent v857): a hard-killed Agent loses no acked record; its sent commit still lands, and the idempotent retry of a committed record is deduplicated."
url: https://monedula.dev/kafka-simulator/scenarios/warpstream-agent-dies/
---

# WarpStream Kafka: an Agent dies mid-commit

Scenario 10.1.3 · WarpStream: an Agent dies. Diskless · Advanced · about 4 min · Apache Kafka 4.4 · WarpStream (Agent v857).

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 it: https://monedula.dev/kafka-simulator/playground/?scenario=10.1.3

## What 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

1. **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](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.3&t=0)
2. **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](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.3&t=1)
3. **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](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.3&t=2)
4. **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](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.3&t=3)
5. **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](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.3&t=4)
6. **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](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.3&t=5)

## 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.

## Further reading

- [WarpStream documentation](https://docs.warpstream.com/warpstream/overview/architecture/write-path)

## Troubleshooting

- [TimeoutException in Kafka producers: causes and fixes](https://monedula.dev/kafka/troubleshooting/producer-timeout-exception/)
