Monedula

Kafka consumer config

isolation.level: read_committed vs read_uncommitted

Consumer config · default read_uncommitted · Apache Kafka 4.3

isolation.level controls whether a consumer sees records from Kafka transactions before they commit. read_uncommitted (the default) returns every record as soon as it is replicated, including records of open and aborted transactions. read_committed returns only committed transactional records and stops at the last stable offset (LSO) until each open transaction commits or aborts.

Config
isolation.level (consumer)
Default
read_uncommitted
Valid values
read_uncommitted, read_committed
Reference
Apache Kafka documentation for isolation.level
Produced · uncommitted. tx1 wrote one record to each partition. Both records are replicated (HW advanced), so read_uncommitted (ru) sees them - but the LSO is frozen, so read_committed (rc) is stuck and sees nothing. Neither partition's record is visible to rc until the transaction commits. Open this step in the full playground

Values

What it does

A transactional producer writes its records to the log straight away and resolves them later with a commit or abort marker. The partition keeps two bounds: the high watermark, up to which records are replicated, and the last stable offset, below which every transaction is resolved. read_uncommitted reads to the high watermark. read_committed reads to the LSO and uses the list of aborted transactions the broker returns with each fetch to drop their records, so the application sees each transaction all at once or not at all.

The trade-off

read_committed is what makes an exactly-once pipeline exactly once downstream: without it, a consumer reads records that are later aborted. The cost is latency: every record behind an open transaction, transactional or not, waits until that transaction ends, and a producer that hangs holds the LSO back until transaction.timeout.ms makes the coordinator abort it. read_uncommitted has no such wait but gives no transactional guarantee at all.

Advice

See it in the simulator

Related configs

All Kafka configs