---
title: "Nisshi diskless Kafka: when PostgreSQL goes down"
description: "With Nisshi's PostgreSQL engine down, produce gets KAFKA_STORAGE_ERROR, fetches close the connection and commits fail; once it is back, nothing is lost."
url: https://monedula.dev/kafka-simulator/scenarios/nisshi-postgresql-unavailable/
---

# Nisshi diskless Kafka: when PostgreSQL goes down

Scenario 12.1.6 · Nisshi: PostgreSQL unavailable. Diskless · Advanced · about 4 min · Apache Kafka 4.4 · Nisshi 0.8.2.

Nisshi 0.8.2 on PostgreSQL · while PostgreSQL is down produce gets KAFKA_STORAGE_ERROR, fetches close the connection and offset commits get COORDINATOR_NOT_AVAILABLE; when it is back, nothing is lost and no offset is skipped.

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

## What you start with

PostgreSQL holds everything on Nisshi's production engine: records, watermarks, consumer group state and committed offsets. When it is unavailable no broker can serve a request that needs it, but a transaction either commits or stores nothing. p1 (idempotent, acks=all) writes through broker-1; consumer group g1 reads through broker-2 every 600 ms. PostgreSQL stops at 1000 and starts again at 3000.

## Step by step

1. **Steady traffic on PostgreSQL** (t+0.766s): p1 writes orders-0 at 100 and orders-1 at 700; each is one transaction, committed and acked (166, 766). c1 reads through broker-2 every 600 ms. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=12.1.6&t=0)
2. **PostgreSQL stops** (t+1.000s): PostgreSQL holds the records, the watermarks, the group state and the offsets. The simulator notices the outage at once. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=12.1.6&t=1)
3. **c1's fetches close the connection; its commit gets COORDINATOR_NOT_AVAILABLE** (t+1.200s): At c1's 1200 poll broker-2 cannot read the rows, so it closes the connection, as Nisshi 0.8.2 does (shown as REQUEST_TIMED_OUT); c1 reconnects at its next poll. Its offset commit gets COORDINATOR_NOT_AVAILABLE. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=12.1.6&t=2)
4. **p1's produce gets KAFKA_STORAGE_ERROR** (t+1.350s): p1's record for orders-2 reaches broker-1 at 1350. The transaction cannot run: nothing is stored and p1 gets KAFKA_STORAGE_ERROR, which is retriable. It retries every 400 ms, each failing the same way until PostgreSQL is back. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=12.1.6&t=3)
5. **PostgreSQL starts again** (t+3.000s): Produce, fetch and offset commits work again. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=12.1.6&t=4)
6. **p1's retry commits at offset 0: no gap** (t+3.366s): p1's retry at 3350 commits orders-2 offset 0 and is acked at 3366. The failed transactions stored nothing, so there is no gap to skip. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=12.1.6&t=5)
7. **c1 reads every record** (t+3.600s): c1's 3600 poll reads the three records it could not read during the outage: orders-1 offset 0, orders-2 offset 0 and orders-0 offset 1 (written at 3500). [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=12.1.6&t=6)
8. **Caught up: the commit goes through** (t+4.200s): c1's offset commit at 4200 succeeds: orders-0 at 2, orders-1 at 1, orders-2 at 1. Nothing acked was lost and no offset was skipped. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=12.1.6&t=7)

## The takeaway

While PostgreSQL was down, produce got KAFKA_STORAGE_ERROR (retriable) and the producer retried, fetches made the broker close the connection and the consumer reconnected, and offset commits got COORDINATOR_NOT_AVAILABLE. When it came back the next retry committed and the consumer read every record. A failed transaction stores nothing, so there was no gap and nothing acked was lost. Simulator choices: the outage noticed at once, REQUEST_TIMED_OUT standing for the closed connection, the 15 ms transaction borrowed from Inkless's figure, and the 400 ms retry backoff.

## Configs in this scenario

- [`acks`](https://kafka.apache.org/44/configuration/producer-configs/#producerconfigs_acks): How 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](https://monedula.dev/kafka/configs/acks/)

## Further reading

- [Nisshi v0.8.2 source on GitHub](https://github.com/nisshi-io/solace-nisshi/blob/v0.8.2/docs/storage.md)

## Troubleshooting

- [TimeoutException in Kafka producers: causes and fixes](https://monedula.dev/kafka/troubleshooting/producer-timeout-exception/)
- [KAFKA_STORAGE_ERROR in Kafka: disk failures and Inkless](https://monedula.dev/kafka/troubleshooting/kafka-storage-exception/)
- [COORDINATOR_NOT_AVAILABLE in Kafka: causes and fixes](https://monedula.dev/kafka/troubleshooting/coordinator-not-available/)
