Scenario 09.1.1 · AutoMQ: the write path
AutoMQ diskless Kafka: one S3 WAL per broker, then ack
AutoMQ 1.7.4 · each partition has one leader and one replica; a broker writes one S3 WAL object for all its partitions, acks=all waits for that upload, and seconds later the WAL becomes an SSO.
Run this scenario in the playgroundAutoMQ cluster: one leader per partition, one WAL per broker. t+0.000s
orders is an AutoMQ topic (AutoMQ 1.7.4, a fork of Apache Kafka 3.9.1): 6 partitions, one replica each, every byte in S3. The KRaft controller chose one leader per partition, two on each broker, and each broker will write one WAL object for all the partitions it leads. Producer p-all sends acks=all, p-one acks=1; consumer group g1 has one member in az-b.
Open at this step: step 1, AutoMQ cluster: one leader per partition, one WAL per brokerThe leader assigns offsets; acks=1 is answered at once. t+0.200s
The leader of each partition numbered its record at append. p-one (acks=1) was answered right there, before anything reached S3, and its record is not readable yet. p-all (acks=all) is still waiting: it is answered only when the upload finishes.
Open at this step: step 2, The leader assigns offsets; acks=1 is answered at onceOne WAL object mixes two partitions and uploads to S3. t+0.700s
The buffer of broker-1 closed after the 500 ms batch interval (the simulator's figure) and is uploading as one WAL object that holds the records of both partitions it leads, one from each producer. The upload takes 600 ms in the simulator.
Open at this step: step 3, One WAL object mixes two partitions and uploads to S3Upload done: acks=all answered, nothing written to the controller. t+1.300s
The upload finished and the WAL object is confirmed: the high watermark rose and p-all was answered. Nothing was written to the KRaft controller for this ack. The SSO has not been committed yet.
Open at this step: step 4, Upload done: acks=all answered, nothing written to the controllerThe consumer reads the records only now. t+2.500s
g1 in az-b fetched both records from broker-1 in az-a, a cross-zone fetch. The acks=1 record, answered long before, was not readable until the upload was confirmed.
Open at this step: step 5, The consumer reads the records only nowSeconds later the WAL becomes an SSO in the controller. t+6.000s
Seconds after the confirm (4 s here, the simulator's shortened figure) broker-1 turned its confirmed WAL object into an SSO and committed it to the controller. The WAL object is trimmed.
Open at this step: step 6, Seconds later the WAL becomes an SSO in the controllerWhat you start with
AutoMQ 1.7.4 is a fork of Apache Kafka 3.9.1 that keeps every topic in S3. Each partition has one leader, chosen by the KRaft controller, and a replication factor of 1. A broker writes one WAL object in S3 for all the partitions it leads: acks=all is answered when that upload finishes, acks=1 as soon as the record is appended in memory. Producer p-all sends acks=all, p-one sends acks=1, both to partitions broker-1 leads; consumer g1 sits in another zone. Timings are slowed so each phase gets its own frame.
Step by step
- AutoMQ cluster: one leader per partition, one WAL per broker t+0.000s orders is an AutoMQ topic (AutoMQ 1.7.4, a fork of Apache Kafka 3.9.1): 6 partitions, one replica each, every byte in S3. The KRaft controller chose one leader per partition, two on each broker, and each broker will write one WAL object for all the partitions it leads. Producer p-all sends acks=all, p-one acks=1; consumer group g1 has one member in az-b. Open at this step: step 1, AutoMQ cluster: one leader per partition, one WAL per broker
- The leader assigns offsets; acks=1 is answered at once t+0.200s The leader of each partition numbered its record at append. p-one (acks=1) was answered right there, before anything reached S3, and its record is not readable yet. p-all (acks=all) is still waiting: it is answered only when the upload finishes. Open at this step: step 2, The leader assigns offsets; acks=1 is answered at once
- One WAL object mixes two partitions and uploads to S3 t+0.700s The buffer of broker-1 closed after the 500 ms batch interval (the simulator's figure) and is uploading as one WAL object that holds the records of both partitions it leads, one from each producer. The upload takes 600 ms in the simulator. Open at this step: step 3, One WAL object mixes two partitions and uploads to S3
- Upload done: acks=all answered, nothing written to the controller t+1.300s The upload finished and the WAL object is confirmed: the high watermark rose and p-all was answered. Nothing was written to the KRaft controller for this ack. The SSO has not been committed yet. Open at this step: step 4, Upload done: acks=all answered, nothing written to the controller
- The consumer reads the records only now t+2.500s g1 in az-b fetched both records from broker-1 in az-a, a cross-zone fetch. The acks=1 record, answered long before, was not readable until the upload was confirmed. Open at this step: step 5, The consumer reads the records only now
- Seconds later the WAL becomes an SSO in the controller t+6.000s Seconds after the confirm (4 s here, the simulator's shortened figure) broker-1 turned its confirmed WAL object into an SSO and committed it to the controller. The WAL object is trimmed. Open at this step: step 6, Seconds later the WAL becomes an SSO in the controller
The takeaway
The leader numbered both records at append, and acks=1 was answered there, before anything reached S3; its record could not be read until the upload was confirmed. One WAL object held the records of two partitions, and acks=all was answered when its upload finished, with no write to the controller. Only seconds later did the broker turn the confirmed WAL object into an SSO, commit it to the controller and trim the WAL object. Consumer g1 in az-b read from the az-a leader, which counts as cross-zone traffic. Simulator choices: the 500 ms batch interval (AutoMQ's code closes the buffer after 250 ms), the 600 ms upload and the 4 s SSO interval are the simulator's (AutoMQ's sources give no upload time, and its code default for the SSO interval is 60 s).
Configs in this scenario
-
acksHow many replicas must have a write before the producer counts it as sent: 0 (none), 1 (the leader only) or all (every in-sync replica, the default, and required for idempotence). How acks works
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=09.1.1" title="Kafka Simulator: AutoMQ: 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/automq-write-path/">AutoMQ diskless Kafka: one S3 WAL per broker, then ack</a></p> Further reading
AutoMQ v1.7.4 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 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: 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