This is an automated email from the ASF dual-hosted git repository.

penghui pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-2.6 by this push:
     new f23626e  Clear the recently joined consumers when there are only one 
consumer under the Key_Shared subscription. (#8427)
f23626e is described below

commit f23626ebb814e42d23ccf5ef99d3842eb1e5e80d
Author: lipenghui <[email protected]>
AuthorDate: Wed Nov 4 21:49:34 2020 +0800

    Clear the recently joined consumers when there are only one consumer under 
the Key_Shared subscription. (#8427)
    
    
    (cherry picked from commit 505dcd5ccecbbb8d32eccf5e3a1f1caeae6163f9)
---
 .../persistent/PersistentStickyKeyDispatcherMultipleConsumers.java     | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java
index f3aca7f..6180e77 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentStickyKeyDispatcherMultipleConsumers.java
@@ -124,6 +124,9 @@ public class PersistentStickyKeyDispatcherMultipleConsumers 
extends PersistentDi
         selector.removeConsumer(consumer);
         if (recentlyJoinedConsumers != null) {
             recentlyJoinedConsumers.remove(consumer);
+            if (consumerList.size() == 1) {
+                recentlyJoinedConsumers.clear();
+            }
         }
     }
 

Reply via email to