Scenario 08.2.2 · KafScale: etcd goes down
KafScale 2.1 diskless Kafka: when etcd goes down
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 this scenario in the playgroundSteady 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: step 1, Steady produce and consumeetcd 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: step 2, etcd stops: the proxy routes from its cacheProduce, 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: step 3, Produce, commits and fetches time outetcd 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: step 4, etcd is backTraffic 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: step 5, Traffic resumesWhat 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
- 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: step 1, Steady produce and consume
- 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: step 2, etcd stops: the proxy routes from its cache
- 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: step 3, Produce, commits and fetches time out
- 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: step 4, etcd is back
- 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: step 5, Traffic resumes
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
-
retriesHow 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.How long the producer waits before retrying a failed send, so it does not hammer a broker that is still recovering.backoff. ms
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=08.2.2" title="Kafka Simulator: KafScale: etcd goes down" 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/kafscale-2-etcd-outage/">KafScale 2.1 diskless Kafka: when etcd goes down</a></p> Further reading
KafScale v2.1.0 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 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: 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