-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[fix][broker] Fix ProducerBusy issue due to incorrect userCreatedProducerCount on non-persistent topic #22685
Merged
Conversation
This file contains 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
…ucerCount on non-persistent topic
Technoboy-
approved these changes
May 9, 2024
/pulsarbot rerun-failure-checks |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #22685 +/- ##
============================================
- Coverage 73.57% 73.09% -0.48%
+ Complexity 32624 32465 -159
============================================
Files 1877 1888 +11
Lines 139502 141103 +1601
Branches 15299 15484 +185
============================================
+ Hits 102638 103145 +507
- Misses 28908 29971 +1063
- Partials 7956 7987 +31
Flags with carried forward coverage won't be shown. Click here to find out more.
|
dao-jun
approved these changes
May 9, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
nikhil-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 15, 2024
…ucerCount on non-persistent topic (apache#22685) Co-authored-by: ruihongzhou <ruihongzhou@tencent.com> (cherry picked from commit 253e650) (cherry picked from commit 89b545e)
srinath-ctds
pushed a commit
to datastax/pulsar
that referenced
this pull request
May 16, 2024
…ucerCount on non-persistent topic (apache#22685) Co-authored-by: ruihongzhou <ruihongzhou@tencent.com> (cherry picked from commit 253e650) (cherry picked from commit 89b545e)
hanmz
pushed a commit
to hanmz/pulsar
that referenced
this pull request
Feb 12, 2025
…ucerCount on non-persistent topic (apache#22685) Co-authored-by: ruihongzhou <ruihongzhou@tencent.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Labels
area/broker
cherry-picked/branch-3.0
cherry-picked/branch-3.2
cherry-picked/branch-3.3
doc-not-needed
Your PR changes do not impact docs
ready-to-test
release/3.0.5
release/3.2.3
release/3.3.1
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.
Motivation
#20607 introduced the variable
userCreatedProducerCount
to track the number of producers created by users. Concurrently, theremoveProducer
method inAbstractTopic
decreases the count ofuserCreatedProducerCount
usingUSER_CREATED_PRODUCER_COUNTER_UPDATER.decrementAndGet(this)
when a producer is removed. However,NonPersistentTopic
overrides theremoveProducer
method ofAbstractTopic
, and the overriddenremoveProducer
method inNonPersistentTopic
does not decrease the count ofuserCreatedProducerCount
. As a result, whenmaxProducersPerTopic
is set, this incorrect value ofuserCreatedProducerCount
can lead to aProducerBusy
error when creating a producer.Modifications
Since the
NonPersistentTopic
class extends theAbstractTopic
class and the implementation of theremoveProducer
method inNonPersistentTopic
is identical to that inAbstractTopic
, theremoveProducer
method inNonPersistentTopic
can be safely removed.Verifying this change
Added test in
org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopicTest#testRemoveProducerOnNonPersistentTopic
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: hrzzzz#5