---
title: "KafScale 2.1 diskless Kafka: when etcd goes down"
description: "KafScale 2.1: with etcd down, produce, offset commits and fetches get REQUEST_TIMED_OUT, owners too, while the proxy routes from its cache."
url: https://monedula.dev/kafka-simulator/scenarios/kafscale-2-etcd-outage/
---

# KafScale 2.1 diskless Kafka: when etcd goes down

Scenario 08.2.2 · KafScale: etcd goes down. Diskless · Advanced · about 4 min · Apache Kafka 4.4 · KafScale 2.1.

KafScale 2.1 · with etcd stopped, produce, offset commits and fetches get REQUEST_TIMED_OUT, at the owners too, while the proxy keeps routing from its cache; etcd back, traffic resumes.

Run it: https://monedula.dev/kafka-simulator/playground/?scenario=08.2.2

## What you start with

KafScale keeps partition leases, end offsets, consumer offsets and group state in etcd. Its proxy, which clients connect to, also reads the brokers and partition routes from etcd. The proxy keeps routing from its cache while etcd is down, for up to its cache TTL of 60 s. Here etcd is stopped for 4.4 s, well inside that TTL, with nothing in flight. Producer p1 is set to retries=30 and retry.backoff.ms=500, about 15 s of retries with the simulator's fixed backoff. Watch etcd on the lease lane, the proxy node, p1's errors and c1's fetches and commits.

## Step by step

1. **Steady produce and consume** (t+1.500s): orders is a KafScale topic (KafScale 2.1) with two partitions, one replica each, every byte in S3. p1's first two records took the leases in etcd (orders-0 broker-2, orders-1 broker-3, the simulator's hash), each became one S3 segment, etcd recorded the end offsets and p1 was acked at 790 ms; consumer c1 of g1 read both at 1000 ms. Its offset commit comes with its next poll. The proxy is ready: it reads the brokers and partition routes from etcd. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=08.2.2&t=0)
2. **etcd stops: the proxy routes from its cache** (t+1.700s): etcd stopped at 1600 ms, with nothing in flight; in the simulator the brokers notice at once. The proxy keeps routing clients from what it last read from etcd, for up to its cache TTL of 60 s: it would go not ready at 61600 ms, and the proxy node counts down. Every lease stays where it was. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=08.2.2&t=1)
3. **Produce, commits and fetches time out** (t+3.100s): At c1's poll at 2000 ms its offset commit got REQUEST_TIMED_OUT, and so did its fetches. They went to the owners, broker-2 and broker-3, which have their partitions loaded, but a fetch first reads the partition's end offset from etcd, and with etcd down that read fails: the owner answers REQUEST_TIMED_OUT and the consumer retries at its next poll (KafScale issue #342, fixed by #352; before the fix the failed read counted as end offset 0 and the consumer got OFFSET_OUT_OF_RANGE). p1 sent order-3 and order-4 at 2500 ms; with etcd down the broker refused them with REQUEST_TIMED_OUT (retriable) at 2550 and 3050 ms, and p1 retries every 500 ms. The proxy still routes from its cache: these errors come from the brokers. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=08.2.2&t=2)
4. **etcd is back** (t+6.100s): etcd started at 6000 ms, inside the proxy's TTL, so the proxy never went not ready and is simply ready again. p1 was refused 7 times, from 2550 to 5550 ms. Its next retry at 6050 ms was appended by the same owners at offset 1 of each partition and is uploading. No lease changed hands. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=08.2.2&t=3)
5. **Traffic resumes** (t+8.050s): The retry was acked at 6690 ms. c1 committed its old offsets at 7000 ms, read order-3 and order-4 in the same poll, and committed them at 8000 ms. All four records were acked once and read once; the high watermarks are 2 and 2, lag is 0. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=08.2.2&t=4)

## The takeaway

While etcd was down, nothing that needs it worked. p1's produce was refused with REQUEST_TIMED_OUT and retried, and c1's offset commit failed. c1's fetches went to the owners, which had their partitions loaded, but a fetch reads the partition's end offset from etcd first, so they got REQUEST_TIMED_OUT too and c1 retried at its next poll. The proxy kept routing from its cache the whole time and never went not ready. No lease changed hands. Once etcd was back, p1's retry was acked, c1 read and committed both new records, and nothing was lost or written twice. Simulator choices: etcd is one up/down entity and the brokers notice the outage at once; an owner's fetch answers REQUEST_TIMED_OUT at once, where KafScale answers once its 3 s etcd read times out (issue #342, fixed by #352); the outage is shorter than the 10 s lease TTL, so the owners keep their etcd sessions (in a longer one they lose them and drop their partition logs, as scenario 08.2.4 shows); the proxy's cache counts its 60 s from the moment etcd stopped.

## Configs in this scenario

- [`retries`](https://kafka.apache.org/44/configuration/producer-configs/#producerconfigs_retries): How many times the producer sends a batch again after a transient error (default 2147483647, so in practice delivery.timeout.ms ends the retrying); idempotence needs it above 0.
- [`retry.backoff.ms`](https://kafka.apache.org/44/configuration/producer-configs/#producerconfigs_retry.backoff.ms): How long the producer waits before retrying a failed send, so it does not hammer a broker that is still recovering.

## Further reading

- [KafScale v2.1.0 source on GitHub](https://github.com/KafScale/platform/blob/v2.1.0/docs/operations.md)

## Troubleshooting

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