Scenario 07.1.2 · Inkless: PostgreSQL goes down
Aiven Inkless: what a PostgreSQL outage does to Kafka
Aiven Inkless 0.51 · stop the PostgreSQL batch coordinator: diskless produce and fetch fail with KafkaStorageException while a classic topic in the same cluster keeps working; start it and the retries commit.
Run this scenario in the playgroundBoth topics flowing. t+1.400s
orders is a classic topic (replication factor 3) and clicks an Inkless diskless topic (replication factor 1). One record each: orders was acked at 450 ms after replicating to its followers; clicks was acked at 1310 ms, when PostgreSQL committed its object, wal-0001. Both producers and the clicks consumer sit in az-b, served by broker-2.
Open at this step: step 1, Both topics flowingPostgreSQL stops. t+2.450s
PostgreSQL, the Inkless batch coordinator, stopped at 2400 ms. A second clicks record is on its way to object storage as wal-0002: its upload started at 2150 ms and takes 600 ms, and PostgreSQL must commit it after that. Nothing has failed yet.
Open at this step: step 2, PostgreSQL stopsConsumers of clicks get KafkaStorageException. t+2.550s
The clicks consumer polled at 2500 ms and got KafkaStorageException: a diskless fetch needs PostgreSQL to find the batches, so it fails while the database is down (Inkless docs). In this simulator it fails even when broker-2 has the data cached.
Open at this step: step 3, Consumers of clicks get KafkaStorageExceptionThe uploaded object fails its commit and is deleted. t+2.850s
wal-0002 finished uploading and its commit came due at 2810 ms with PostgreSQL down, so it failed. No batch can point at it, so the broker deletes the object from storage, as Inkless's code does, and p-clicks got KafkaStorageException, a retriable error, for its record.
Open at this step: step 4, The uploaded object fails its commit and is deletedDiskless refused, classic acked. t+3.600s
At 3200 ms both producers wrote again. p-clicks was refused at once with KafkaStorageException and keeps retrying; p-orders was acked at 3550 ms, as before: classic topics do not use PostgreSQL and keep working.
Open at this step: step 5, Diskless refused, classic ackedPostgreSQL is back, retries commit. t+6.100s
PostgreSQL started at 4400 ms. p-clicks' next retries went through: both records were buffered, uploaded as wal-0003 and committed at 5570 ms, and the consumer read them. clicks ends at offset 3; in this run nothing was lost, because the outage was shorter than the producer's retries. wal-0002 was deleted and never got offsets.
Open at this step: step 6, PostgreSQL is back, retries commitWhat you start with
In Inkless, PostgreSQL orders every diskless batch and assigns its offsets. Its docs say that while PostgreSQL is unavailable, diskless produce and fetch fail with KAFKA_STORAGE_ERROR, which clients retry, and classic topics keep working. A classic topic, orders, and an Inkless diskless topic, clicks, take writes side by side; PostgreSQL stops while a clicks object is still being uploaded, before it can be committed. Watch the PostgreSQL lane, the object storage lane and both producers.
Step by step
- Both topics flowing t+1.400s orders is a classic topic (replication factor 3) and clicks an Inkless diskless topic (replication factor 1). One record each: orders was acked at 450 ms after replicating to its followers; clicks was acked at 1310 ms, when PostgreSQL committed its object, wal-0001. Both producers and the clicks consumer sit in az-b, served by broker-2. Open at this step: step 1, Both topics flowing
- PostgreSQL stops t+2.450s PostgreSQL, the Inkless batch coordinator, stopped at 2400 ms. A second clicks record is on its way to object storage as wal-0002: its upload started at 2150 ms and takes 600 ms, and PostgreSQL must commit it after that. Nothing has failed yet. Open at this step: step 2, PostgreSQL stops
- Consumers of clicks get KafkaStorageException t+2.550s The clicks consumer polled at 2500 ms and got KafkaStorageException: a diskless fetch needs PostgreSQL to find the batches, so it fails while the database is down (Inkless docs). In this simulator it fails even when broker-2 has the data cached. Open at this step: step 3, Consumers of clicks get KafkaStorageException
- The uploaded object fails its commit and is deleted t+2.850s wal-0002 finished uploading and its commit came due at 2810 ms with PostgreSQL down, so it failed. No batch can point at it, so the broker deletes the object from storage, as Inkless's code does, and p-clicks got KafkaStorageException, a retriable error, for its record. Open at this step: step 4, The uploaded object fails its commit and is deleted
- Diskless refused, classic acked t+3.600s At 3200 ms both producers wrote again. p-clicks was refused at once with KafkaStorageException and keeps retrying; p-orders was acked at 3550 ms, as before: classic topics do not use PostgreSQL and keep working. Open at this step: step 5, Diskless refused, classic acked
- PostgreSQL is back, retries commit t+6.100s PostgreSQL started at 4400 ms. p-clicks' next retries went through: both records were buffered, uploaded as wal-0003 and committed at 5570 ms, and the consumer read them. clicks ends at offset 3; in this run nothing was lost, because the outage was shorter than the producer's retries. wal-0002 was deleted and never got offsets. Open at this step: step 6, PostgreSQL is back, retries commit
The takeaway
orders kept being acked the whole time: classic topics do not use PostgreSQL. clicks writes and reads failed with KafkaStorageException until PostgreSQL returned, then the retried records were committed in a new object; in this run nothing was lost. The object that was in flight when PostgreSQL stopped never got offsets, and the broker deleted it from storage, as Inkless's code does when the control plane is unavailable. Simulator choices: brokers refuse diskless produce at once while PostgreSQL is down, and fetches fail even when the broker has the data cached.
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=07.1.2" title="Kafka Simulator: Inkless: PostgreSQL goes down" 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/inkless-postgresql-outage/">Aiven Inkless: what a PostgreSQL outage does to Kafka</a></p> Further reading
Aiven Inkless source on GitHub (inkless-release-0.51)
Troubleshooting
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 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 write path: Oxia assigns the offset
- 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