Scenario 12.1.5 · Nisshi: a broker dies
Nisshi diskless Kafka: a broker dies mid-write
Nisshi 0.8.2 on S3 · a hard kill ends each request where it is: offsets taken with no batch leave a gap, a batch stored without its ack is stored twice, and so is an idempotent batch stored before its sequence advance.
Run this scenario in the playgroundbroker-1 holds three requests at three stages. t+0.999s
Each producer writes its own partition through broker-1. p-idem's batch for orders-1 was written at 975, and its meta.json sequence advance is in flight. p-plain's PUT to orders-0 ends at 1000. p-gap's watermark write took offset 0 of orders-2 at 900, and its PUT runs until 1200.
Open at this step: step 1, broker-1 holds three requests at three stagesbroker-1 dies: a stored batch, an unrecorded sequence, a gap. t+1.000s
A hard kill at 1000 ends each request where it is. p-plain's PUT ended in this millisecond: the batch is stored, but the response, 1 ms behind (a simulator choice), never leaves. p-idem's batch is stored and its sequence never written. p-gap's PUT never ends: offset 0 of orders-2 is taken with no batch. All three producers get REQUEST_TIMED_OUT.
Open at this step: step 2, broker-1 dies: a stored batch, an unrecorded sequence, a gapc1 moves to broker-2 and reads on, skipping the gap. t+1.200s
c1 lost broker-1 too and moved at once to broker-2 (a hash over the alive brokers, the simulator's choice). The group's state is in S3, so nothing fails over: c1 reads offset 0 of orders-0 and orders-1, both stored, and moves past orders-2's offset 0, which holds no batch.
Open at this step: step 3, c1 moves to broker-2 and reads on, skipping the gapThe retries go through broker-3. t+1.550s
The producers moved to broker-3 and retried after their 400 ms backoff. broker-3 held no copies, so its three creates fail with 412 at 1450; it reads the documents and takes offset 1 in each partition at 1550.
Open at this step: step 4, The retries go through broker-3Both duplicates are stored. t+1.901s
p-plain's retry is a plain batch, so orders-0 holds its record at offsets 0 and 1. p-idem's retry passes the sequence check, since meta.json never recorded the first write, so orders-1 holds its record twice too. p-gap's record lands at offset 1 of orders-2. All are acked (1851, 1901).
Open at this step: step 5, Both duplicates are storedc1 reads both duplicates; the gap stays empty. t+6.600s
broker-2's copies, read at 1200, expire at 6200, so c1 reads the retries at its 6600 poll: orders-0 and orders-1 give it each record twice, and orders-2 gives offset 1 only.
Open at this step: step 6, c1 reads both duplicates; the gap stays emptyWhat you start with
Nisshi's brokers keep nothing that is not in S3, so a broker death moves no data and no group. But a request in flight ends where it is, and the S3 engine writes in steps: the offsets (watermark.json), the batch (its own object), and for an idempotent producer the sequence (meta.json), then the answer. broker-1 is hard-killed at 1000 with one request at each stage. Producers p-plain and p-gap (plain), p-idem (idempotent) and consumer group g1 all talk to broker-1.
Step by step
- broker-1 holds three requests at three stages t+0.999s Each producer writes its own partition through broker-1. p-idem's batch for orders-1 was written at 975, and its meta.json sequence advance is in flight. p-plain's PUT to orders-0 ends at 1000. p-gap's watermark write took offset 0 of orders-2 at 900, and its PUT runs until 1200. Open at this step: step 1, broker-1 holds three requests at three stages
- broker-1 dies: a stored batch, an unrecorded sequence, a gap t+1.000s A hard kill at 1000 ends each request where it is. p-plain's PUT ended in this millisecond: the batch is stored, but the response, 1 ms behind (a simulator choice), never leaves. p-idem's batch is stored and its sequence never written. p-gap's PUT never ends: offset 0 of orders-2 is taken with no batch. All three producers get REQUEST_TIMED_OUT. Open at this step: step 2, broker-1 dies: a stored batch, an unrecorded sequence, a gap
- c1 moves to broker-2 and reads on, skipping the gap t+1.200s c1 lost broker-1 too and moved at once to broker-2 (a hash over the alive brokers, the simulator's choice). The group's state is in S3, so nothing fails over: c1 reads offset 0 of orders-0 and orders-1, both stored, and moves past orders-2's offset 0, which holds no batch. Open at this step: step 3, c1 moves to broker-2 and reads on, skipping the gap
- The retries go through broker-3 t+1.550s The producers moved to broker-3 and retried after their 400 ms backoff. broker-3 held no copies, so its three creates fail with 412 at 1450; it reads the documents and takes offset 1 in each partition at 1550. Open at this step: step 4, The retries go through broker-3
- Both duplicates are stored t+1.901s p-plain's retry is a plain batch, so orders-0 holds its record at offsets 0 and 1. p-idem's retry passes the sequence check, since meta.json never recorded the first write, so orders-1 holds its record twice too. p-gap's record lands at offset 1 of orders-2. All are acked (1851, 1901). Open at this step: step 5, Both duplicates are stored
- c1 reads both duplicates; the gap stays empty t+6.600s broker-2's copies, read at 1200, expire at 6200, so c1 reads the retries at its 6600 poll: orders-0 and orders-1 give it each record twice, and orders-2 gives offset 1 only. Open at this step: step 6, c1 reads both duplicates; the gap stays empty
The takeaway
One kill, three outcomes, each from the order of the steps. p-gap's offsets were taken but its PUT never ended: offset 0 of orders-2 is a gap, which the fetch skips, as the code's comment above the produce path describes. p-plain's batch was stored in the millisecond of the kill without an ack, so its retry was stored a second time. p-idem's batch was stored before its meta.json advance, so its retry passed the sequence check and was stored again: the code calls this a known residual. Every client moved to another broker at once, and the group carried on with no coordinator to fail over. Simulator choices: REQUEST_TIMED_OUT for the lost connection, the hashes that sent c1 to broker-2 and the producers to broker-3, the 1 ms response, and the 400 ms retry backoff.
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=12.1.5" title="Kafka Simulator: Nisshi: a broker 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/nisshi-broker-dies/">Nisshi diskless Kafka: a broker dies mid-write</a></p> Further reading
Nisshi v0.8.2 source on GitHub
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: 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: 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