Skip to content

[improve][client] Log V5 segment-gone send retries at DEBUG - #26615

Merged
lhotari merged 1 commit into
apache:masterfrom
merlimat:mmerli/v5-segment-gone-retry-debug-log
Sep 17, 2026
Merged

lhotari merged 1 commit into
apache:masterfrom
merlimat:mmerli/v5-segment-gone-retry-debug-log

Conversation

@merlimat

Copy link
Copy Markdown
Contributor

Motivation

When a scalable topic segment is split, the broker terminates the parent segment topic before it publishes the new layout. The per-segment v4 producer is disconnected, its reconnect is rejected with TopicTerminated, and it fails every pending message in one burst. The V5 ScalableTopicProducer then retries each message with backoff until the DAG watch delivers the new layout, and logged every one of those retries at INFO:

... INFO  org.apache.pulsar.client.impl.v5.ScalableTopicProducer - Target segment gone, retrying async send after layout update {attempt=1, segmentId=0, topic=topic://public/default/my-topic}

At a high publish rate that is one line per in-flight message on every split, which floods the log. Publishing recovers on its own once the new layout arrives; the noise is the problem.

Modifications

Lower the two "Target segment gone" retry logs in ScalableTopicProducer (the async path and its sync counterpart) from INFO to DEBUG. The split itself remains visible at INFO through the existing "Closing producer for sealed segment" and "Layout applied" lines, which are emitted once per layout change rather than once per message.

A segment split terminates the parent segment topic before the new
layout is published, so the per-segment v4 producer fails every pending
message in one burst and the V5 producer retries each of them until the
DAG watch delivers the new layout. Each retry was logged at INFO, one
line per in-flight message, which floods the log on every split at a
high publish rate. The split itself stays visible through the INFO
"Closing producer for sealed segment" and "Layout applied" lines; the
per-message retries are a DEBUG-level detail.

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for reducing the per-message retry noise while keeping layout changes visible at INFO.

@lhotari
lhotari merged commit 2187365 into apache:master Sep 17, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants