Skip to content

KafkaBinderMetrics not updating last stable offset #3208

Description

@berse2212

Describe the issue

Since our recent Spring / Kafka update the KafkaBinderMetrics repeatedly triggers the following warning log message:

Not updating last stable offset for partition <partition> as it is no longer assigned

This is happening for a lot of partitions and every x seconds, this generates a big flood of logs for us.

This is probably related to the following Kafka Issue: https://issues.apache.org/jira/browse/KAFKA-20449

However this ticket is only aiming to reduce the log level since it´s a benign race condition during rebalances. As the KafkaBinderMetrics should not triggering any rebalances nor does our log give any indication that rebalances are happening I don´t think the situation described in this kafka-issue is quite fitting. As such it rather indicates some underlying issue with the KafkaBinderMetrics.computeUnconsumedMessages(..).

To Reproduce
Starting a Spring Cloud Kafka Application, while enabling the KafkaBinderMetrics.
OffsetFetcherUtils log level should be set to at least "warn"

Version of the framework
spring-boot 4.0.6
spring-cloud-stream 5.0.1
spring-kafka 4.0.5
kafka-clients 4.1.2

Expected behavior
KafkaBinderMetrics should not trigger the mentioned log messages.

Screenshots

Here an exempt from our most recent logs, to illustrate the sheir amount of messages we get from this issue:

Image

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions