[fix][broker] Lower log level of DrainingHashesTracker not-found entry to DEBUG#25558
Merged
lhotari merged 1 commit intoApr 21, 2026
Conversation
…y to DEBUG The `log.warn()` call in `DrainingHashesTracker.ConsumerDrainingHashesStats #updateConsumerStats` fires whenever the hash-iterator observes an entry that was already removed by a concurrent write path. In the original PIP-379 design the draining-hash stats were strongly consistent with the tracker state, so a missing entry on the read path was genuinely unexpected. That strong-consistency guarantee was intentionally dropped in apache#23854 to resolve a deadlock: the stats path is now allowed to race with entry removal. A missing entry is therefore a benign, expected outcome during normal operation, not a signal worth alerting on. Logging this at `WARN` floods broker logs without a corresponding actionable condition. Drop it to `DEBUG` and add an inline comment explaining the race so future readers understand why this is deliberately quiet. Fixes apache#25277
lhotari
approved these changes
Apr 21, 2026
lhotari
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for the contribution @singhvishalkr
Member
|
@singhvishalkr I've backported the change to maintenance branches. This change will be included in 4.0.10 and 4.2.1 releases which are currently in progress. The current ETA for the release is Apr 30th. |
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
Apr 23, 2026
…y to DEBUG (apache#25558) (cherry picked from commit 423a746) (cherry picked from commit 4850be8)
nodece
pushed a commit
to ascentstream/pulsar
that referenced
this pull request
May 27, 2026
…y to DEBUG (apache#25558) (cherry picked from commit 423a746)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #25277
Motivation
DrainingHashesTracker.ConsumerDrainingHashesStats#updateConsumerStatscurrently logs a WARN every time the hash iterator observes an entry that was concurrently removed:https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/DrainingHashesTracker.java#L188-L196
In the original PIP-379 design the draining-hash stats were strongly consistent with the tracker state, so a missing entry on this read path would indeed have been unexpected. That strong-consistency guarantee was intentionally dropped in #23854 to break a deadlock — the stats read path is now allowed to race with entry removal.
A null
entryis therefore a benign, expected outcome during normal broker operation, not an alertable condition. Logging at WARN floods broker logs and drowns out actionable warnings.The issue author (@lhotari) explicitly notes: "The warning log no longer makes sense and should be changed to debug logging."
Modifications
DrainingHashesTracker.java: change the not-found branch fromlog.warn()tolog.debug()and add an inline comment explaining why the log is deliberately quiet (pointing at the [fix][broker] Fix deadlock in Key_Shared PIP-379 implementation #23854 context), so future readers don't bump it back up.No behavioural change — the
continueand surrounding logic are untouched.Verifying this change
This change is a trivial fix without any test coverage: it only lowers the level of an existing log statement. No functional behaviour changes, so no new tests are required (existing
DrainingHashesTrackertests still cover the race path).Does this pull request potentially affect one of the following parts:
None of the listed areas are affected. Log level only.
Documentation
doc-not-neededNo user-facing or config documentation references this log line.