Monedula

Scenario 12.1.7 · Nisshi: what it refuses

Nisshi diskless Kafka: what 0.8.2 refuses

Diskless · Advanced · about 3 min · Apache Kafka 4.4 · Nisshi 0.8.2

Nisshi 0.8.2 · a transactional producer stops at TRANSACTIONAL_ID_AUTHORIZATION_FAILED, and on the S3 engine retention.ms is stored but not applied: a group joining 5 s later reads every record.

Run this scenario in the playground

tx1 stops at TRANSACTIONAL_ID_AUTHORIZATION_FAILED. t+0.150s

tx1 sets transactional.id=tx-orders and sends its first record at 100. Nisshi 0.8.2 implements no transactions: it refuses a producer with a transactional.id at InitProducerId with TRANSACTIONAL_ID_AUTHORIZATION_FAILED, which is not retriable, so tx1 stops. The simulator draws no InitProducerId step and shows the refusal when the first batch is sent, at 150.

Open at this step: step 1, tx1 stops at TRANSACTIONAL_ID_AUTHORIZATION_FAILED

What you start with

Nisshi implements most of the Kafka protocol, but not all of it. Two things a Kafka client may expect: transactions, which Nisshi 0.8.2 refuses, and retention on the S3 engine, which it stores but does not apply. tx1 sets transactional.id=tx-orders. p1 writes topic orders, which sets retention.ms=2000, through broker-2, where consumer group g1 reads too.

Step by step

  1. tx1 stops at TRANSACTIONAL_ID_AUTHORIZATION_FAILED t+0.150s tx1 sets transactional.id=tx-orders and sends its first record at 100. Nisshi 0.8.2 implements no transactions: it refuses a producer with a transactional.id at InitProducerId with TRANSACTIONAL_ID_AUTHORIZATION_FAILED, which is not retriable, so tx1 stops. The simulator draws no InitProducerId step and shows the refusal when the first batch is sent, at 150. Open at this step: step 1, tx1 stops at TRANSACTIONAL_ID_AUTHORIZATION_FAILED
  2. p1's three records are stored t+0.751s p1 (idempotent, on broker-2) writes three records to orders-0 in one request: offsets 0 to 2, one batch object, acked at 751. orders sets retention.ms=2000, and the Why tab says the S3 engine does not apply it. Open at this step: step 2, p1's three records are stored
  3. g1 reads them t+1.200s c1 reads offsets 0 to 2 through broker-2. Open at this step: step 3, g1 reads them
  4. 5 s later g-late reads all three t+6.800s g-late joins at 5000 with auto.offset.reset=earliest and reads offsets 0 to 2 (5600, 6200, 6800): the records are older than retention.ms=2000 and still there. On the PostgreSQL engine the maintenance sweep would have deleted them; one scene runs one engine, so that half is told here, not drawn. Open at this step: step 4, 5 s later g-late reads all three

The takeaway

tx1 stopped at once with TRANSACTIONAL_ID_AUTHORIZATION_FAILED: Nisshi refuses a transactional id at InitProducerId, and the error is not retriable. On the S3 engine retention.ms was stored and not applied, so a group that joined 5 s later still read every record; on the PostgreSQL engine the same setting takes effect at the next maintenance sweep (maintenance_interval, 10 minutes by default). Other refusals of 0.8.2: adding partitions (CreatePartitions is not implemented) and share groups. Simulator choices: the refusal shown at the first send, since the simulator draws no InitProducerId step, and one engine per scene.

Configs in this scenario

  • retention.ms How long a topic with cleanup.policy=delete keeps a log segment before it may be deleted (default 604800000, 7 days); -1 removes the time limit. How retention.ms works
  • transactional.id On Nisshi 0.8.2 a producer that sets transactional.id is refused at InitProducerId with TRANSACTIONAL_ID_AUTHORIZATION_FAILED, since Nisshi implements no transactions.
  • auto.offset.reset Where a consumer starts when its group has no committed offset or the offset no longer exists: latest (the default), earliest, by_duration (a time back from now, such as by_duration:PT1H), or none to throw an exception instead. How auto.offset.reset works
  • maintenance_interval A setting of the Nisshi PostgreSQL engine, 10 minutes by default, for how often its maintenance applies retention and compaction to the stored records.

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=12.1.7" title="Kafka Simulator: Nisshi: what it refuses" 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/nisshi-what-it-refuses/">Nisshi diskless Kafka: what 0.8.2 refuses</a></p>

Further reading

Nisshi v0.8.2 source on GitHub

Troubleshooting

More in Diskless

All scenarios