Scenario 08.2.7 · KafScale: a paused broker comes back without overwriting
KafScale 2.1 diskless Kafka: a paused broker comes back
KafScale 2.1 · a broker paused past its lease drops its partition log when it resumes; when the partition comes back to it, it restores from etcd and S3 and writes at the right offset.
Run this scenario in the playgroundbroker-2 owns orders-0. t+1.100s
orders is a KafScale topic (KafScale 2.1) with one partition. p1 sent order-1 at 100 ms: broker-2 took the lease, gave it offset 0 and was acked at 790 ms; c1 read it at 1000 ms.
Open at this step: step 1, broker-2 owns orders-0broker-2 is paused. t+2.100s
broker-2 was paused at 1500 ms. It sends no keepalives, so its lease on orders-0 expires at 11500 ms; until then requests for orders-0 still go to broker-2. p1's order-2 got REQUEST_TIMED_OUT at 2050 ms and is retried every 500 ms; c1's fetch timed out at 2000 ms. A real client waits request.timeout.ms (30 s by default) per attempt.
Open at this step: step 2, broker-2 is pausedbroker-1 took over. t+13.100s
The lease expired at 11500 ms. p1's retry at 11550 ms made broker-1 take it and restore orders-0 (etcd end 1, S3 end 1): order-2 got offset 1 and was acked at 12190 ms, and c1 read it at 13000 ms.
Open at this step: step 3, broker-1 took overbroker-2 resumes. t+14.100s
broker-2 resumed at 14000 ms after 12.5 s. Its etcd session is gone, so KafScale 2.1 dropped its partition log for orders-0: it owns nothing and holds nothing.
Open at this step: step 4, broker-2 resumesbroker-1 stops gracefully. t+15.100s
broker-1 was stopped gracefully at 15000 ms, as in a rolling restart. Nothing was in flight, so it released its lease at once.
Open at this step: step 5, broker-1 stops gracefullyA restore, then the right offset. t+16.300s
p1 sent order-3. At 15550 ms it went to broker-2, which took the lease with a new acquisition and restored orders-0 from etcd and S3 (both at 2): order-3 got offset 2, under its own segment key orders/0/segment-00000002, and was acked at 16190 ms. The end offset is 3.
Open at this step: step 6, A restore, then the right offsetNothing acked was lost. t+20.100s
c1 read order-3 at 17000 ms. g2 started at 17000 ms from the start and read order-1, order-2 and order-3, one per poll. Each record was acked once at its own offset, and nothing in S3 was replaced.
Open at this step: step 7, Nothing acked was lostWhat you start with
A paused broker is a frozen process: SIGSTOP, or a long garbage collection pause. Its partition leases expire after the 10 s TTL and another broker takes over. A resumed broker that kept its old partition log could write at a stale offset over records another broker acked (KafScale issue #324), so KafScale drops the log when the lease is lost and reloads it from etcd and S3 on the next acquisition. broker-2 owns orders and is paused; later it resumes and broker-1 is stopped for a rolling restart. Watch the lease lane, the restore, and the segment keys in the object storage lane.
Step by step
- broker-2 owns orders-0 t+1.100s orders is a KafScale topic (KafScale 2.1) with one partition. p1 sent order-1 at 100 ms: broker-2 took the lease, gave it offset 0 and was acked at 790 ms; c1 read it at 1000 ms. Open at this step: step 1, broker-2 owns orders-0
- broker-2 is paused t+2.100s broker-2 was paused at 1500 ms. It sends no keepalives, so its lease on orders-0 expires at 11500 ms; until then requests for orders-0 still go to broker-2. p1's order-2 got REQUEST_TIMED_OUT at 2050 ms and is retried every 500 ms; c1's fetch timed out at 2000 ms. A real client waits request.timeout.ms (30 s by default) per attempt. Open at this step: step 2, broker-2 is paused
- broker-1 took over t+13.100s The lease expired at 11500 ms. p1's retry at 11550 ms made broker-1 take it and restore orders-0 (etcd end 1, S3 end 1): order-2 got offset 1 and was acked at 12190 ms, and c1 read it at 13000 ms. Open at this step: step 3, broker-1 took over
- broker-2 resumes t+14.100s broker-2 resumed at 14000 ms after 12.5 s. Its etcd session is gone, so KafScale 2.1 dropped its partition log for orders-0: it owns nothing and holds nothing. Open at this step: step 4, broker-2 resumes
- broker-1 stops gracefully t+15.100s broker-1 was stopped gracefully at 15000 ms, as in a rolling restart. Nothing was in flight, so it released its lease at once. Open at this step: step 5, broker-1 stops gracefully
- A restore, then the right offset t+16.300s p1 sent order-3. At 15550 ms it went to broker-2, which took the lease with a new acquisition and restored orders-0 from etcd and S3 (both at 2): order-3 got offset 2, under its own segment key orders/0/segment-00000002, and was acked at 16190 ms. The end offset is 3. Open at this step: step 6, A restore, then the right offset
- Nothing acked was lost t+20.100s c1 read order-3 at 17000 ms. g2 started at 17000 ms from the start and read order-1, order-2 and order-3, one per poll. Each record was acked once at its own offset, and nothing in S3 was replaced. Open at this step: step 7, Nothing acked was lost
The takeaway
broker-2 dropped its partition log when it resumed, because its etcd session had expired. When orders-0 came back to it, it restored from etcd and S3 (both at 2) and wrote order-3 at offset 2, under its own segment key. Each record was acked once at its own offset, nothing in S3 was replaced, and both consumers read order-1, order-2 and order-3. Not shown: a write in flight at the pause. KafScale fences it: the produce gets NOT_LEADER_OR_FOLLOWER, or KAFKA_STORAGE_ERROR when the segment PUT finds the key taken (If-None-Match); scenario 08.2.6 shows that fence after a graceful stop. At the commit the simulator reads, such a conflict also blocked the broker's produces for 60 s (issue #335), fixed in the 2.0 release (PR #345). Simulator choices: in-flight work fails at the pause, a request to a paused broker times out at once, the lease TTL counts from the pause, the resumed broker notices its lost session at once, and a stable hash stands in for the proxy's round-robin.
Configs in this scenario
-
request.How long the client waits for the response to one request before it sends it again or fails it (default 30000, 30 seconds); for a producer it should stay above the broker replica.lag.time.max.ms to avoid retries that write duplicates.timeout. 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.7" title="Kafka Simulator: KafScale: a paused broker comes back without overwriting" 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-paused-broker/">KafScale 2.1 diskless Kafka: a paused broker comes back</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 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
- 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