[fix][broker] Fix ProducerBusy issue due to incorrect userCreatedProducerCount on non-persistent topic#22685
Merged
Merged
Conversation
…ucerCount on non-persistent topic
Technoboy-
approved these changes
May 9, 2024
Contributor
Author
|
/pulsarbot rerun-failure-checks |
Codecov Report✅ All 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.
🚀 New features to boost your workflow:
|
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>
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.
Motivation
#20607 introduced the variable
userCreatedProducerCountto track the number of producers created by users. Concurrently, theremoveProducermethod inAbstractTopicdecreases the count ofuserCreatedProducerCountusingUSER_CREATED_PRODUCER_COUNTER_UPDATER.decrementAndGet(this)when a producer is removed. However,NonPersistentTopicoverrides theremoveProducermethod ofAbstractTopic, and the overriddenremoveProducermethod inNonPersistentTopicdoes not decrease the count ofuserCreatedProducerCount. As a result, whenmaxProducersPerTopicis set, this incorrect value ofuserCreatedProducerCountcan lead to aProducerBusyerror when creating a producer.Modifications
Since the
NonPersistentTopicclass extends theAbstractTopicclass and the implementation of theremoveProducermethod inNonPersistentTopicis identical to that inAbstractTopic, theremoveProducermethod inNonPersistentTopiccan be safely removed.Verifying this change
Added test in
org.apache.pulsar.broker.service.nonpersistent.NonPersistentTopicTest#testRemoveProducerOnNonPersistentTopicDoes this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: hrzzzz#5