-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Broker] Fix messageDedup delete inactive producer name #12493
[Broker] Fix messageDedup delete inactive producer name #12493
Conversation
@congbobo184:Thanks for your contribution. For this PR, do we need to update docs? |
@congbobo184:Thanks for providing doc info! |
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
@@ -443,15 +445,15 @@ public void markDeleteFailed(ManagedLedgerException exception, Object ctx) { | |||
/** | |||
* Topic will call this method whenever a producer connects. | |||
*/ | |||
public synchronized void producerAdded(String producerName) { | |||
public void producerAdded(String producerName) { |
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.
We shouldn't remove the synchronized
here because it's used also to make operations atomic with other methods. eg. purgeInactiveProducers()
* up/master: fix delete authentication policies when delete topic. (apache#12215) [Broker] Fix messageDedup delete inactive producer name (apache#12493) Fixed getting children of parent nodes in LocalMemoryMetadataStore (apache#12491) Update Producer stats on producer close() (apache#12500) docs(cli):add restart command in pulsar-daemon (apache#12373) Add the pulsar java property memory allocator doc (apache#12481) [Doc]Update ci-documentbot.yml (apache#12480)
Now, remove inactive producerName in MessageDeduplication when producer close. But the producer has been closed before topic unload, this producerName will not be remove if producer don't connect broker with the same producerName. When topic recover `MessageDeduplication`, we should put every producerName into inactive producerNameMap. When producer with the same name, we will remove it from the inactive map, if this producerName can not connect within brokerDeduplicationProducerInactivityTimeoutMinutes, we can remove it.
## Issue Now, remove inactive producerName in MessageDeduplication when producer close. But the producer has been closed before topic unload, this producerName will not be remove if producer don't connect broker with the same producerName. ## implement When topic recover `MessageDeduplication`, we should put every producerName into inactive producerNameMap. When producer with the same name, we will remove it from the inactive map, if this producerName can not connect within brokerDeduplicationProducerInactivityTimeoutMinutes, we can remove it.
## Issue Now, remove inactive producerName in MessageDeduplication when producer close. But the producer has been closed before topic unload, this producerName will not be remove if producer don't connect broker with the same producerName. ## implement When topic recover `MessageDeduplication`, we should put every producerName into inactive producerNameMap. When producer with the same name, we will remove it from the inactive map, if this producerName can not connect within brokerDeduplicationProducerInactivityTimeoutMinutes, we can remove it. (cherry picked from commit 928924b)
Now, remove inactive producerName in MessageDeduplication when producer close. But the producer has been closed before topic unload, this producerName will not be remove if producer don't connect broker with the same producerName. When topic recover `MessageDeduplication`, we should put every producerName into inactive producerNameMap. When producer with the same name, we will remove it from the inactive map, if this producerName can not connect within brokerDeduplicationProducerInactivityTimeoutMinutes, we can remove it. (cherry picked from commit 04e8d7e)
Now, remove inactive producerName in MessageDeduplication when producer close. But the producer has been closed before topic unload, this producerName will not be remove if producer don't connect broker with the same producerName. When topic recover `MessageDeduplication`, we should put every producerName into inactive producerNameMap. When producer with the same name, we will remove it from the inactive map, if this producerName can not connect within brokerDeduplicationProducerInactivityTimeoutMinutes, we can remove it. (cherry picked from commit 928924b)
Motivation
fix #12478
Implement
when message deup recover, put producerName into inactiveProduceName map, if producer connect to, it will be removed from inactiveProduceName map
Verifying this change
Add the tests for it
Does this pull request potentially affect one of the following parts:
If yes was chosen, please highlight the changes
Dependencies (does it add or upgrade a dependency): (no)
The public API: (no)
The schema: (no)
The default values of configurations: (no)
The wire protocol: (yes)
The rest endpoints: (no)
The admin cli options: (no)
Anything that affects deployment: (no)