Monedula

Scenario 10.1.1 · WarpStream: the write path

WarpStream diskless Kafka: the write path through Agents

Diskless · Advanced · about 3 min · Apache Kafka 4.4 · WarpStream (Agent v857)

WarpStream (Agent v857) · stateless Agents in your account buffer many partitions into one file, upload it, and the hosted control plane assigns the offsets at commit; the ack comes after both.

Run this scenario in the playground

The acks carry their offsets. t+1.500s

The control plane committed wal-0002 next: k10 got offset 1 on partition 0, after k13, and k2 offset 0 on partition 1. Each producer was acked only after its file was uploaded and committed, and each ack carries the offset the control plane assigned: p-c got offset 0 on partitions 0 and 2 at the first commit, p-a offset 0 on partition 1 and offset 1 on partition 0 now. A committed record is readable at once.

Open at this step: step 5, The acks carry their offsets

What you start with

WarpStream Agents are stateless and run in your account, one per zone here; the control plane that orders the data is hosted by WarpStream, outside your account. Each producer writes through the Agent in its zone. An Agent buffers the records of many partitions into one file, uploads it to object storage, then commits it to the control plane, which assigns the offsets at that commit. A produce is acked only after the upload and the commit. Producer p-a sits in az-a and p-c in az-c; both write partition 0 of orders and one other partition each. Consumer g1 sits in az-b. Timings are slowed so each phase gets its own frame.

Step by step

  1. Three Agents, one per zone; the control plane is outside your account t+0.000s orders is a WarpStream topic (Agent v857): 3 partitions, no replicas, every record in object storage. Three stateless Agents run in your account, one per zone: agent-1 in az-a, agent-2 in az-b, agent-3 in az-c. The control plane that orders the data is hosted by WarpStream, outside your account. Producer p-a sits in az-a and p-c in az-c (ws_az in client.id); consumer group g1 has one member in az-b. Open at this step: step 1, Three Agents, one per zone; the control plane is outside your account
  2. Each producer writes through the Agent in its zone t+0.500s Within one 500 ms window each producer sent two records, and each record went to the Agent in the producer's zone: p-a's to agent-1, p-c's to agent-3. Both producers wrote partition 0 (keys k10 and k13), and each wrote one other partition: p-a partition 1, p-c partition 2. p-a's k10 was sent before p-c's k13. No record has an offset yet; they wait in each Agent's buffer. Open at this step: step 2, Each producer writes through the Agent in its zone
  3. Each Agent buffers many partitions into one file and uploads it t+0.800s Each Agent closed its buffer after the batchTimeout (500 ms here, the simulator's slowed figure) and is uploading it to object storage as one file: agent-3's wal-0001 holds partitions 2 and 0, agent-1's wal-0002 holds partitions 1 and 0. Partition 0 has records in both files. agent-3's buffer opened first, with p-c's k1, so its file went up first. The upload takes 600 ms in the simulator. Open at this step: step 3, Each Agent buffers many partitions into one file and uploads it
  4. The control plane commits the files and assigns the offsets t+1.450s wal-0001 finished uploading and agent-3 committed it to the control plane, which assigned the offsets at that commit: k13 got offset 0 on partition 0, k1 offset 0 on partition 2. wal-0002 holds k10, which was sent before k13, but its file finished uploading later and its commit is still at the control plane. Offsets follow the commit order, not the send order. A commit takes 200 ms in the simulator. Open at this step: step 4, The control plane commits the files and assigns the offsets
  5. The acks carry their offsets t+1.500s The control plane committed wal-0002 next: k10 got offset 1 on partition 0, after k13, and k2 offset 0 on partition 1. Each producer was acked only after its file was uploaded and committed, and each ack carries the offset the control plane assigned: p-c got offset 0 on partitions 0 and 2 at the first commit, p-a offset 0 on partition 1 and offset 1 on partition 0 now. A committed record is readable at once. Open at this step: step 5, The acks carry their offsets
  6. The consumer reads in offset order t+2.400s Consumer c1 (group g1, az-b) read all four records through agent-2, the Agent in its zone, in offset order: on partition 0 first k13 at offset 0, then k10 at offset 1, although k10 was sent first. The offsets of every partition are contiguous. The files did not land in the order the records were sent; the consumer follows the offsets the control plane assigned at commit. az-b loaded each file once from object storage, and g1 has committed its position. Open at this step: step 6, The consumer reads in offset order

The takeaway

Each Agent wrote the records of two partitions into one file, and partition 0 got records through two Agents. The stateless Agents in your account never numbered a record: the hosted control plane assigned the offsets when it committed each file, in commit order, so p-a's k10, sent before p-c's k13, got the higher offset on partition 0 because its Agent's file committed second. Each producer was acked only after its file was uploaded and committed, and the ack carried the offset the control plane had assigned. Consumer g1 read every partition in offset order, not in the order the records were sent. Simulator choices: the 500 ms batchTimeout (WarpStream's default is 250 ms), the 600 ms upload and the 200 ms commit are slowed figures the simulator picked so each phase is a frame.

Configs in this scenario

  • client.id A logical name the producer sends with every request - it shows up in broker logs, metrics, and quota enforcement so traffic can be attributed to an application.

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=10.1.1" title="Kafka Simulator: WarpStream: 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/warpstream-write-path/">WarpStream diskless Kafka: the write path through Agents</a></p>

Further reading

WarpStream documentation

More in Diskless

All scenarios