mathieudruart commented on code in PR #9859:
URL: https://github.com/apache/pinot/pull/9859#discussion_r1031698031


##########
pinot-plugins/pinot-stream-ingestion/pinot-pulsar/src/main/java/org/apache/pinot/plugin/stream/pulsar/PulsarStreamMetadataProvider.java:
##########
@@ -156,11 +174,21 @@ public List<PartitionGroupMetadata> 
computePartitionGroupMetadata(String clientI
       LOGGER.warn("Error encountered while calculating pulsar partition group 
metadata: " + e.getMessage(), e);
     } finally {
       closeConsumer(consumer);
+      deleteSubscription(_topic, subscription);
     }
 
     return newPartitionGroupMetadataList;
   }
 
+  private void deleteSubscription(String topicName, String subscription) {
+    try {
+      _pulsarAdminClient.topics().deleteSubscription(topicName, subscription);

Review Comment:
   I saw that it was possible to create lightweight subscriptions using non 
durable subscription mode :
   
           Consumer<byte[]> consumer = pulsarClient.newConsumer()
                   .topic("my-topic")
                   .subscriptionName("my-sub")
                   .subscriptionMode(SubscriptionMode.NonDurable)
                   .subscribe();
   
   in this case the subscription is still stored in the Pulsar broker memory 
(but no longer persisted with a durable cursor).
   
   I think we should create them non-durable, but maybe also delete them to 
clean the memory of the Pulsar brokers.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to