Scenario 08.1.1 · KafScale: the write path
KafScale diskless Kafka: etcd lease, S3 segment, ack
KafScale 2.1 · the owner of each partition holds an etcd lease; every produce request is one S3 segment, then the end offset in etcd, then the ack.
Run this scenario in the playgroundKafScale cluster, no leases yet. t+0.000s
orders is a KafScale topic (KafScale 2.1): 3 partitions, one replica each, every byte in S3. Three brokers and etcd, which will hold one lease per partition, but no partition has an owner yet and nothing has been written. Producer p1 sends keyed records; consumer group g1 has one member.
Open at this step: step 1, KafScale cluster, no leases yetFirst produce: lease, offset, segment upload. t+0.150s
The first produce request, flushed at 150 ms, makes a broker take each partition's lease in etcd: broker-2 for orders-0, broker-3 for orders-1 and orders-2 (the simulator's hash picks them). Each new owner restores its partition from S3, which is empty, gives its record offset 0 and starts uploading it as its own segment (one per produce request and partition, for example orders-0 · segment 0-0). The upload runs 600 ms here (the simulator's figure). Nothing is committed and p1 is not yet acked.
Open at this step: step 2, First produce: lease, offset, segment uploadetcd records the end offset, producer acked. t+0.790s
The uploads finished at 750 ms, then each owner wrote the partition's new end offset (1) to etcd, 40 ms here (the simulator's figure). Only now is p1 acked, 640 ms after the append, and the high watermark moves to 1 on all three partitions.
Open at this step: step 3, etcd records the end offset, producer ackedThe owner serves the read from its cache. t+1.850s
Consumer c1 read all three records and its offsets are committed (lag 0). A KafScale fetch takes the partition's lease, as a produce does, so the consumer's fetch reaches each partition's lease owner, which has the segment cached from its own upload: no read from S3 was needed.
Open at this step: step 4, The owner serves the read from its cacheWhat you start with
KafScale 2.1 is a broker written in Go that speaks the Kafka protocol and keeps every topic in S3, with one replica. Clients connect through its proxy, which routes each request to the partition's owner broker, the one holding a lease for it in etcd. With its default sync flush, a produce request is uploaded as one S3 segment, the new end offset is written to etcd, and only once that write succeeds does the producer get its ack. Producer p1 sends three keyed records, one per partition of orders. Watch the lease lane for etcd, the object storage lane and the partition strips. Timings are slowed so each phase gets its own frame.
Step by step
- KafScale cluster, no leases yet t+0.000s orders is a KafScale topic (KafScale 2.1): 3 partitions, one replica each, every byte in S3. Three brokers and etcd, which will hold one lease per partition, but no partition has an owner yet and nothing has been written. Producer p1 sends keyed records; consumer group g1 has one member. Open at this step: step 1, KafScale cluster, no leases yet
- First produce: lease, offset, segment upload t+0.150s The first produce request, flushed at 150 ms, makes a broker take each partition's lease in etcd: broker-2 for orders-0, broker-3 for orders-1 and orders-2 (the simulator's hash picks them). Each new owner restores its partition from S3, which is empty, gives its record offset 0 and starts uploading it as its own segment (one per produce request and partition, for example orders-0 · segment 0-0). The upload runs 600 ms here (the simulator's figure). Nothing is committed and p1 is not yet acked. Open at this step: step 2, First produce: lease, offset, segment upload
- etcd records the end offset, producer acked t+0.790s The uploads finished at 750 ms, then each owner wrote the partition's new end offset (1) to etcd, 40 ms here (the simulator's figure). Only now is p1 acked, 640 ms after the append, and the high watermark moves to 1 on all three partitions. Open at this step: step 3, etcd records the end offset, producer acked
- The owner serves the read from its cache t+1.850s Consumer c1 read all three records and its offsets are committed (lag 0). A KafScale fetch takes the partition's lease, as a produce does, so the consumer's fetch reaches each partition's lease owner, which has the segment cached from its own upload: no read from S3 was needed. Open at this step: step 4, The owner serves the read from its cache
The takeaway
No partition had an owner until the first produce; the first append took its lease and restored the partition from an empty S3. The owner then numbered the record, uploaded one segment per produce request and partition, and wrote the end offset to etcd; the producer was acked only after that write succeeded (08.2.5 shows what happens when that etcd write fails). Consumer c1 (group g1) read every record from the caches of the owner brokers. Simulator choices: which broker takes each lease is the simulator's hash of topic and partition, and the S3 upload time (600 ms here) and etcd write time (40 ms here) are slowed figures; KafScale's sources give none.
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.1.1" title="Kafka Simulator: KafScale: the write path" 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-write-path/">KafScale diskless Kafka: etcd lease, S3 segment, ack</a></p> Further reading
KafScale v2.1.0 source on GitHub
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 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: 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