Scenario 13.1.1 · Ursa for Kafka: the write path
Ursa for Kafka write path: Oxia assigns the offset
StreamNative Ursa for Kafka · a zonal owner buffers many partitions into one WAL object, uploads it, and Oxia assigns the offsets when it commits the object; the ack carries them.
Run this scenario in the playgroundThree brokers, one per zone; orders is a diskless topic. t+0.000s
Three brokers, one in each zone (az-a, az-b, az-c), and three KRaft controllers for the cluster metadata. orders has three partitions and ursa.storage.enable=true, so it is diskless: object storage holds its records, and its replication factor is 1. Producer p-a (client.id: zone_id=az-a, idempotent) and producer p-c (client.id: zone_id=az-c) both send with acks set to all; consumer group g1 has one member in az-c.
Open at this step: step 1, Three brokers, one per zone; orders is a diskless topicEach producer writes to its zonal owner: broker-1 in az-a, broker-3 in az-c. t+0.260s
A client's broker for a partition is its zonal owner, a broker in the client's own zone. With one broker per zone, p-a's owner is broker-1 for every partition and p-c's is broker-3. p-c sent k1 (orders-2) to broker-3, and p-a sent k2 (orders-1) and k10 (orders-0) to broker-1, so no record crossed a zone.
Open at this step: step 2, Each producer writes to its zonal owner: broker-1 in az-a, broker-3 in az-cThe batch waits in the owner's buffer, with no offset yet. t+0.600s
Each owner keeps one open buffer, shared by every partition and producer it serves. p-c's k13 (orders-0) joined k1 in broker-3's buffer, so orders-0 now has a record waiting in two owners, in two zones. None of the four records has an offset yet: no high watermark has moved, and nothing is readable.
Open at this step: step 3, The batch waits in the owner's buffer, with no offset yetOne WAL object mixes partitions and uploads to object storage. t+0.750s
Each owner closed its buffer after 500 ms (Ursa closes it at about 250 ms or about 4 MB; slowed here) and is uploading it as one WAL object: broker-3's wal-0001 holds orders-2 and orders-0, broker-1's wal-0002 holds orders-1 and orders-0. Still no offsets: the objects are not in the offset index yet.
Open at this step: step 4, One WAL object mixes partitions and uploads to object storageOxia commits the object and assigns the offsets, in commit order. t+1.450s
broker-3's upload ended first, and wal-0001 was committed to the offset index in Oxia: p-c's records got offset 0 on orders-2 and offset 0 on orders-0. The offset comes from the commit, not from arrival: p-a's k10 reached broker-1 at 250 ms, before p-c's k13 reached broker-3 at 350 ms, but wal-0002 is not committed yet. The commit makes the records readable: orders-0 and orders-2 now have a high watermark of 1, and p-c is acked.
Open at this step: step 5, Oxia commits the object and assigns the offsets, in commit orderThe ack carries the offset Oxia assigned. t+1.500s
Oxia committed wal-0002 50 ms later: orders-1 offset 0, and orders-0 offset 1, after p-c's record. p-a is acked only now, after its object was uploaded and committed, and each ack carries the offset Oxia assigned: p-c's last ack holds orders-0 offset 0, p-a's holds orders-0 offset 1. In the simulator every acks value waits for the upload and the Oxia commit.
Open at this step: step 6, The ack carries the offset Oxia assignedThe consumer reads in offset order; the tail comes from the owner's memory. t+2.400s
c1 polled at 1800 ms and read all four records, each partition from offset 0 in offset order, then committed offsets 2, 1 and 1 on its next poll. Its zonal owner is broker-3: orders-0 and orders-2 start in wal-0001, which broker-3 still holds in memory, so it served them from there. orders-0's offset 1 is in broker-1's object, but the first offset of a fetch decides where it is served from (a simulator choice). orders-1 is in broker-1's wal-0002, which broker-3, the cache broker of az-c, loaded from object storage once.
Open at this step: step 7, The consumer reads in offset order; the tail comes from the owner's memoryWhat you start with
Ursa for Kafka (UFK) is StreamNative's fork of Apache Kafka. A topic created with ursa.storage.enable=true is diskless: object storage holds its data, not the brokers' disks. Each client names its zone in client.id (zone_id=az-a), and its broker for a partition is its zonal owner in that zone. The owner buffers the batches of many partitions and producers, closes the buffer at about 250 ms or about 4 MB, and uploads it to object storage as one WAL object. The object is then committed to the offset index in Oxia, which assigns the offsets, and only then is the producer acked, with that offset. Producer p-a writes through broker-1 in az-a and p-c through broker-3 in az-c; both write orders-0 and one other partition each. Consumer g1 sits in az-c. The timings are slowed so each phase gets its own frame (a simulator choice).
Step by step
- Three brokers, one per zone; orders is a diskless topic t+0.000s Three brokers, one in each zone (az-a, az-b, az-c), and three KRaft controllers for the cluster metadata. orders has three partitions and ursa.storage.enable=true, so it is diskless: object storage holds its records, and its replication factor is 1. Producer p-a (client.id: zone_id=az-a, idempotent) and producer p-c (client.id: zone_id=az-c) both send with acks set to all; consumer group g1 has one member in az-c. Open at this step: step 1, Three brokers, one per zone; orders is a diskless topic
- Each producer writes to its zonal owner: broker-1 in az-a, broker-3 in az-c t+0.260s A client's broker for a partition is its zonal owner, a broker in the client's own zone. With one broker per zone, p-a's owner is broker-1 for every partition and p-c's is broker-3. p-c sent k1 (orders-2) to broker-3, and p-a sent k2 (orders-1) and k10 (orders-0) to broker-1, so no record crossed a zone. Open at this step: step 2, Each producer writes to its zonal owner: broker-1 in az-a, broker-3 in az-c
- The batch waits in the owner's buffer, with no offset yet t+0.600s Each owner keeps one open buffer, shared by every partition and producer it serves. p-c's k13 (orders-0) joined k1 in broker-3's buffer, so orders-0 now has a record waiting in two owners, in two zones. None of the four records has an offset yet: no high watermark has moved, and nothing is readable. Open at this step: step 3, The batch waits in the owner's buffer, with no offset yet
- One WAL object mixes partitions and uploads to object storage t+0.750s Each owner closed its buffer after 500 ms (Ursa closes it at about 250 ms or about 4 MB; slowed here) and is uploading it as one WAL object: broker-3's wal-0001 holds orders-2 and orders-0, broker-1's wal-0002 holds orders-1 and orders-0. Still no offsets: the objects are not in the offset index yet. Open at this step: step 4, One WAL object mixes partitions and uploads to object storage
- Oxia commits the object and assigns the offsets, in commit order t+1.450s broker-3's upload ended first, and wal-0001 was committed to the offset index in Oxia: p-c's records got offset 0 on orders-2 and offset 0 on orders-0. The offset comes from the commit, not from arrival: p-a's k10 reached broker-1 at 250 ms, before p-c's k13 reached broker-3 at 350 ms, but wal-0002 is not committed yet. The commit makes the records readable: orders-0 and orders-2 now have a high watermark of 1, and p-c is acked. Open at this step: step 5, Oxia commits the object and assigns the offsets, in commit order
- The ack carries the offset Oxia assigned t+1.500s Oxia committed wal-0002 50 ms later: orders-1 offset 0, and orders-0 offset 1, after p-c's record. p-a is acked only now, after its object was uploaded and committed, and each ack carries the offset Oxia assigned: p-c's last ack holds orders-0 offset 0, p-a's holds orders-0 offset 1. In the simulator every acks value waits for the upload and the Oxia commit. Open at this step: step 6, The ack carries the offset Oxia assigned
- The consumer reads in offset order; the tail comes from the owner's memory t+2.400s c1 polled at 1800 ms and read all four records, each partition from offset 0 in offset order, then committed offsets 2, 1 and 1 on its next poll. Its zonal owner is broker-3: orders-0 and orders-2 start in wal-0001, which broker-3 still holds in memory, so it served them from there. orders-0's offset 1 is in broker-1's object, but the first offset of a fetch decides where it is served from (a simulator choice). orders-1 is in broker-1's wal-0002, which broker-3, the cache broker of az-c, loaded from object storage once. Open at this step: step 7, The consumer reads in offset order; the tail comes from the owner's memory
The takeaway
Each zonal owner put the records of two partitions into one WAL object, and orders-0 got records through two owners in two zones. No broker numbered a record: Oxia assigned the offsets when it committed each object, in commit order, so p-a's record on orders-0, which reached broker-1 before p-c's reached broker-3, got offset 1 because broker-1's object committed second. Each producer was acked only after its object was uploaded and committed, and the ack carried the offset Oxia had assigned. Consumer g1 read every partition in offset order. broker-3, its zonal owner, served orders-0 and orders-2 from memory, since both start in the object it had written, and the object broker-1 wrote came from object storage through broker-3, the cache broker of az-c. Simulator choices: the 500 ms buffer close (Ursa's is about 250 ms), the 600 ms upload and the 200 ms Oxia commit are slowed so each phase is a frame; the zonal owner is a stable hash over the brokers of the zone, standing in for Ursa's consistent hash ring; every acks value waits for the upload and the Oxia commit; and the first offset of a fetch decides where it is served from.
Configs in this scenario
-
ursa.A topic setting of Ursa for Kafka: a topic created with ursa.storage.enable=true is a diskless topic whose data is stored in object storage, while the other topics of the same cluster keep classic local disks.storage. enable -
client.On Ursa for Kafka a client asks for zone affinity by starting its client.id with zone_id= and its zone (zone_id=az-a, or zone_id=az-a,key1=value1 with other entries after it), and at least one broker must run in that zone.id
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=13.1.1" title="Kafka Simulator: Ursa for Kafka: 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/ursa-write-path/">Ursa for Kafka write path: Oxia assigns the offset</a></p> Further reading
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: 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 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