---
title: "KIP-890 explained: transactions v2 and hanging transactions"
description: "KIP-890 in plain words: how Kafka brokers stopped hanging and zombie transactions, what transaction.version=2 changes in Kafka 4.0, and what clients need."
url: https://monedula.dev/kafka/kips/kip-890/
---

# KIP-890: the broker defends transactions, transaction version 2

Producers and transactions · Shipped · since Kafka 3.6 · status checked November 2026.

KIP-890 made the broker check transactional writes instead of trusting the producer. Part one (Kafka 3.6) rejects a write to a partition that was never added to the transaction, which caused hanging transactions. Part two (Kafka 4.0) bumps the producer epoch on every commit and abort, so a late write from an earlier transaction can no longer land in the next one.

## At a glance

- Proposal: KIP-890, Transactions Server-Side Defense
- Status: Shipped. Part 1 in Kafka 3.6 (2023), part 2 in Kafka 4.0 (2025) as transaction.version 2.
- Area: Producers and transactions
- Proposal page: [KIP-890 on the Apache Kafka wiki](https://cwiki.apache.org/confluence/display/KAFKA/KIP-890%3A+Transactions+Server-Side+Defense)

## Why it was needed

A hanging transaction is one the coordinator thinks is finished while a partition still holds its open records. It pins the last stable offset, so read_committed consumers stop and compaction cannot clean past it, until someone aborts it by hand. The usual cause was a retried or delayed produce request arriving after the client had moved on.

## What it changes

With part one the leader asks the transaction coordinator to verify that the partition is in the ongoing transaction before it appends, so a stray write is refused. Part two, the new transaction protocol, adds partitions to the transaction implicitly on the server and bumps the producer epoch at the end of each transaction, which fences any request still in flight from the previous one. Older clients that break the rules get INVALID_TXN_STATE.

## How to use it

- Part one is on by default (transaction.partition.verification.enable=true) on brokers from 3.6; use 3.6.1 or newer, since 3.6.0 had a bug with compression.
- Part two needs the transaction.version=2 feature, enabled when a cluster finishes its upgrade to 4.0, and producers on Kafka 4.0 or newer clients.

## Where it stands

Part one shipped in Kafka 3.6 for data partitions and was extended to consumer-offset partitions in 3.7. Part two completed in Kafka 4.0 and is the default for clusters that finished upgrading to 4.0; producers switch to it at their next transaction, without a restart.

## What comes next

Follow-up KIPs refine error handling, such as KIP-1050 with a TransactionAbortableException, and Kafka 4.2 carried the transaction version into transaction markers (KIP-1228). Two-phase commit with external systems is a separate proposal.

## See it in the simulator

- [Kafka zombie producer fencing with transactional.id](https://monedula.dev/kafka-simulator/scenarios/eos-fencing/) (EOS - offsets in a txn + fencing), step 7: zombie fenced. tx-zombie (epoch 0) tries to open a new transaction, but tx holds a newer epoch, so the zombie is FENCED and can never write duplicates. In Kafka the fence lands on its first send or commit, since beginTransaction() is client-side, and transaction.version=2 bumps the epoch at every commit. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=04.3.2&t=6)
- [Kafka transaction.timeout.ms: the coordinator aborts](https://monedula.dev/kafka-simulator/scenarios/txn-timeout/) (Transaction timeout), step 3: Timed out · auto-aborted. tx1 never committed. Once transaction.timeout.ms passed, the coordinator's periodic check auto-aborted it: the offset-0 record becomes an aborted range, the LSO releases to the high watermark, and tx1 is errored (the simulator calls it transaction_timed_out; Kafka bumps the epoch, so tx1's next send or commit fails with an epoch error). read_committed skips the aborted record entirely. [Open at this step](https://monedula.dev/kafka-simulator/playground/?scenario=04.2.4&t=2)

## Sources

- [KIP-890: Transactions Server-Side Defense](https://cwiki.apache.org/confluence/display/KAFKA/KIP-890%3A+Transactions+Server-Side+Defense)
- [Apache Kafka 4.4: transaction protocol](https://kafka.apache.org/44/operations/transaction-protocol/)
- [Apache Kafka 4.0.0 release announcement](https://kafka.apache.org/blog/2025/03/18/apache-kafka-4.0.0-release-announcement/)

## Related KIPs

- [KIP-98 explained: idempotent producer and transactions](https://monedula.dev/kafka/kips/kip-98/)
- [KIP-447 explained: exactly-once v2 for stream processing](https://monedula.dev/kafka/kips/kip-447/)
