---
title: "WarpStream Kafka lightning topics: ack before the commit"
description: "WarpStream (Agent v857) lightning topics ack produce after the file upload with offset 0 and commit later; records are readable only after the commit."
url: https://monedula.dev/kafka-simulator/scenarios/warpstream-lightning-topics/
---

# WarpStream Kafka lightning topics: ack before the commit

Scenario 10.1.6 · WarpStream: lightning topics. Diskless · Advanced · about 3 min · Apache Kafka 4.4 · WarpStream (Agent v857).

WarpStream (Agent v857) · a produce to a lightning topic is acked when its file is uploaded, with offset 0, one commit earlier than on a classic topic; its records are readable only after the commit, and an idempotent producer is refused.

Run it: https://monedula.dev/kafka-simulator/playground/?scenario=10.1.6

## What you start with

WarpStream Agents run in your account, but the hosted control plane commits every file and assigns the offsets. A classic topic acks a produce after that commit. A lightning topic (warpstream.topic.type=lightning) acks it as soon as the file is in object storage, with offset 0, and commits it afterwards. Three Agents run here, one per zone. orders is classic and fast is lightning, three partitions each. p-orders writes to orders and p-fast to fast, both in az-a with idempotence off; p-fast-idem in az-b is idempotent and also writes to fast. Groups g-orders and g-fast read one topic each. Timings are slowed so each phase gets its own frame.

## Step by step

1. **A classic topic and a lightning topic side by side** (t+1.900s): orders is a classic WarpStream topic and fast a lightning topic (warpstream.topic.type=lightning), three partitions each (Agent v857). Three Agents run here, one per zone. p-orders and p-fast (ws_az=az-a), both with idempotence off, write through agent-1, which keeps lightning and classic records in separate files (the simulator's choice). Their first records, k1 to orders-2 and k2 to fast-1, went into two files uploaded from 650 to 1250. p-fast was acked at 1250, when its file's upload ended; p-orders at 1450, when the control plane committed its file. Both records got offset 0, and g-orders and g-fast (c-orders and c-fast in az-a) read them at 1800. The next round shows the difference. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.6&t=0)
2. **The lightning producer is acked after the upload, with offset 0** (t+3.500s): At 2300 p-orders sends k3 to orders and p-fast sends k5 to fast. agent-1 appends both at 2350, each to its own file (wal-0003 for orders, wal-0004 for fast), and uploads both from 2850. The uploads end at 3450: fast's file is journaled and p-fast is acked at once, with offset 0. That offset is a placeholder: k2 already holds offset 0 of fast-1. The control plane has not committed the file yet, so k5 has no offset and fast-1's high watermark is still 1. p-orders is still waiting for its ack. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.6&t=1)
3. **The classic producer is acked after the commit, with its offset** (t+3.700s): At 3650 the control plane commits both files (200 ms after the uploads ended, the slowed commit time). p-orders is acked then with k3's real offset, 1 of orders-2: one commit time after p-fast's ack. The same commit gives k5 its real offset, 1 of fast-1, and takes fast's file out of the journal; p-fast gets no second ack. The lightning topic saved its producer one commit time, and both files reached the log at the same moment. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.6&t=2)
4. **The lightning records become readable only after their commit** (t+4.250s): c-fast's poll at 3600 came after p-fast's ack and before the commit, and found nothing to read: a lightning record is readable only once it is committed. At 4200 c-fast reads k5 at offset 1 of fast-1, and c-orders reads k3 at offset 1 of orders-2 in the same poll. From send to read, the lightning record took as long as the classic one. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.6&t=3)
5. **An idempotent producer to the lightning topic is refused** (t+4.850s): At 4300 p-fast-idem (ws_az=az-b), an idempotent producer, sends k4 to fast. It is refused at the flush at 4350 with INVALID_REQUEST, not retriable: WarpStream's docs say a lightning topic rejects produce with enable.idempotence or a transactional.id, and the error code is the simulator's choice. k4 is never written to a file. At 4800 both groups commit their positions: each has read every acked record once. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=10.1.6&t=4)

## The takeaway

p-orders and p-fast sent at the same time through agent-1, each into its own file. p-fast was acked when its file's upload ended, with offset 0; p-orders was acked one commit time later, at the commit, with its real offset, 1. The same commit gave k5 its real offset, 1. c-fast's poll between the ack and the commit read nothing, so the lightning producer waited less, but its record took as long to become readable. p-fast-idem, idempotent, was refused. Both groups read every acked record once. WarpStream facts: the topic config warpstream.topic.type=lightning acks after the upload with offset 0 and commits asynchronously, the records are readable only after that commit, and it does not support idempotence or transactions (such produce is rejected). Simulator choices: the commit timing (the lightning file commits one commit time after its ack, when a classic file uploaded with it commits); lightning and classic records in separate files; INVALID_REQUEST as the refusal's code (the docs name none); and the 500 ms batchTimeout, 600 ms upload and 200 ms commit are slowed figures so each phase is a frame.

## Configs in this scenario

- [`enable.idempotence`](https://kafka.apache.org/44/configuration/producer-configs/#producerconfigs_enable.idempotence): Gives the producer an id and a sequence number per partition so the broker drops duplicate retries and keeps them in order; on by default unless a conflicting setting (acks other than all, retries=0, more than 5 in-flight requests) turns it off. [How enable.idempotence works](https://monedula.dev/kafka/configs/enable-idempotence/)
- [`transactional.id`](https://kafka.apache.org/44/configuration/producer-configs/#producerconfigs_transactional.id): A stable name that turns on transactions for a producer (and implies idempotence); a new producer that calls initTransactions() with the same id fences the older one.

## Further reading

- [WarpStream documentation](https://docs.warpstream.com/warpstream/kafka/advanced-agent-deployment-options/low-latency-clusters/lightning-topics)

## Troubleshooting

- [InvalidRequestException in Kafka: INVALID_REQUEST](https://monedula.dev/kafka/troubleshooting/invalid-request-exception/)
