You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by pe...@apache.org on 2020/11/04 13:49:59 UTC

[pulsar] branch master updated: Clear the recently joined consumers when there are only one consumer under the Key_Shared subscription. (#8427)

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

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


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

commit 505dcd5ccecbbb8d32eccf5e3a1f1caeae6163f9
Author: lipenghui <pe...@apache.org>
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)
---
 .../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 bee5eec..649e02d 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();
+            }
         }
     }