﻿# Kafka read_committed: zero visible lag can hide later queued work

An open transaction can withhold later Kafka records from a healthy consumer. Interpret last stable offset, lag and business completion as different observations.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/enterprise-ai-kafka-read-committed-visible-work-boundary/
Language: en

## Investigate an idle consumer with unfinished upstream work

An enterprise assistant's action consumer polls Kafka successfully but receives no new eligible records. Operators see later records at the broker and suspect a stalled worker. The producer still has an open transaction earlier in the partition. Before restarting the consumer or weakening isolation, identify the boundary up to which its configured read mode is allowed to expose records. Broker connectivity and application-visible work are different observations.

## Read the configured isolation contract

The [Kafka consumer configuration reference](https://kafka.apache.org/41/configuration/consumer-configs/) distinguishes read_committed from read_uncommitted. A committed reader returns committed transactional records, while the uncommitted mode can expose aborted transactional records too. In committed mode, an open transaction can withhold later records until the relevant transaction completes. Preserve the effective configuration and partition assignment with the incident. Do not infer isolation from the fact that a producer uses transactions or from a consumer framework's name.

## Name the read boundary before measuring lag

The [KafkaConsumer API documentation](https://kafka.apache.org/41/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html) explains how the last stable offset affects committed readers, end-offset queries and fetch-lag metrics. Those metrics are relative to the eligible boundary. A consumer caught up to that boundary can still have later log records unavailable to it. Keep the consumer position, committed recovery position and observation of upstream transaction state distinct. A single zero-lag display cannot establish that every intended action has become readable.

## Do not convert visibility into business completion

A transaction becoming committed makes eligible records available under the read contract. It does not prove that an action handler processed them or that an external service accepted the effect. Conversely, gaps in consumed offsets do not automatically identify lost business messages: transaction markers and aborted records can occupy offsets without being delivered as ordinary records. Reconcile business-operation identifiers instead of treating an uninterrupted offset sequence as the expected application output.

## Reproduce the visibility boundary safely

In an isolated fixture, write harmless transactional records, leave a transaction open and publish later test records in the same partition. Observe the committed reader's visible boundary, then commit or abort the open transaction and inspect which operation identifiers become available. Compare the uncommitted reader only as an authorized diagnostic control. Acceptance requires the configured isolation contract to explain the observed eligibility; it does not authorize switching a production action consumer to weaker isolation. No Kafka cluster experiment or throughput result was produced here.

## Keep recovery decisions tied to the upstream state

Record whether the producer resolved the transaction, whether the read boundary advanced and whether the application actually processed the newly eligible work. [BatchWeave publication semantics](/journal/batchweave-transactional-batches-recovery-resource-boundaries/) offers related context on durable data becoming consumable, but its training protocol is a different system. [Request retry ledgers](/journal/provider-post-retry-idempotency-ledger/) address uncertain effects after execution. The Kafka question here is earlier: why a healthy consumer cannot yet see later work. A precise diagnosis preserves isolation while explaining the blocked visibility boundary instead of reporting an empty queue or a completed business process.
